mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull user access str* updates from Al Viro: "uaccess str...() dead code removal" * 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: s390 keyboard.c: don't open-code strndup_user() mips: get rid of unused __strnlen_user() get rid of unused __strncpy_from_user() instances kill strlen_user()
This commit is contained in:
commit
dc502142b6
40 changed files with 5 additions and 601 deletions
|
|
@ -278,19 +278,15 @@ clear_user(void *addr, unsigned long size)
|
|||
|
||||
|
||||
extern long __strncpy_user(char *, const char *, long);
|
||||
#define __strncpy_from_user __strncpy_user
|
||||
|
||||
static inline long
|
||||
strncpy_from_user(char *dst, const char *src, long count)
|
||||
{
|
||||
if (access_ok(VERIFY_READ, src, 1))
|
||||
return __strncpy_from_user(dst, src, count);
|
||||
return __strncpy_user(dst, src, count);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
||||
#define strlen_user(str) strnlen_user((str), TASK_SIZE - 1)
|
||||
|
||||
/*
|
||||
* Return the size of a string (including the ending 0!)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue