diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
commit | 0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch) | |
tree | 41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /arch/arm/kernel/sys_oabi-compat.c | |
parent | aa877175e7a9982233ed8f10cb4bfddd78d82741 (diff) | |
parent | 3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff) |
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'arch/arm/kernel/sys_oabi-compat.c')
-rw-r--r-- | arch/arm/kernel/sys_oabi-compat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index 087acb569b63..5f221acd21ae 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c | |||
@@ -279,8 +279,12 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, | |||
279 | mm_segment_t fs; | 279 | mm_segment_t fs; |
280 | long ret, err, i; | 280 | long ret, err, i; |
281 | 281 | ||
282 | if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event))) | 282 | if (maxevents <= 0 || |
283 | maxevents > (INT_MAX/sizeof(*kbuf)) || | ||
284 | maxevents > (INT_MAX/sizeof(*events))) | ||
283 | return -EINVAL; | 285 | return -EINVAL; |
286 | if (!access_ok(VERIFY_WRITE, events, sizeof(*events) * maxevents)) | ||
287 | return -EFAULT; | ||
284 | kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL); | 288 | kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL); |
285 | if (!kbuf) | 289 | if (!kbuf) |
286 | return -ENOMEM; | 290 | return -ENOMEM; |
@@ -317,6 +321,8 @@ asmlinkage long sys_oabi_semtimedop(int semid, | |||
317 | 321 | ||
318 | if (nsops < 1 || nsops > SEMOPM) | 322 | if (nsops < 1 || nsops > SEMOPM) |
319 | return -EINVAL; | 323 | return -EINVAL; |
324 | if (!access_ok(VERIFY_READ, tsops, sizeof(*tsops) * nsops)) | ||
325 | return -EFAULT; | ||
320 | sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL); | 326 | sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL); |
321 | if (!sops) | 327 | if (!sops) |
322 | return -ENOMEM; | 328 | return -ENOMEM; |