MIPS: Fix strnlen_user access check
Commit04324f44cb
("MIPS: Remove get_fs/set_fs") changed the access_ok for strnlen_user to check the whole range, which broke some callers of strndup_user(). Restore the old behaviour and just check the first byte. Fixes:04324f44cb
("MIPS: Remove get_fs/set_fs") Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
168b84d5d2
commit
2c92ef8ff8
|
@ -614,8 +614,8 @@ static inline long strnlen_user(const char __user *s, long n)
|
|||
{
|
||||
long res;
|
||||
|
||||
if (!access_ok(s, n))
|
||||
return -0;
|
||||
if (!access_ok(s, 1))
|
||||
return 0;
|
||||
|
||||
might_fault();
|
||||
__asm__ __volatile__(
|
||||
|
|
Loading…
Reference in New Issue