diff options
author | Julien Thierry <julien.thierry@arm.com> | 2018-09-11 11:12:49 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-10-05 11:51:15 +0200 |
commit | 319508902600c2688e057750148487996396e9ca (patch) | |
tree | 736da190a255a6e245690ec55fe4002fa50b5ce0 /arch/arm/kernel/sys_oabi-compat.c | |
parent | ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state (diff) | |
download | linux-319508902600c2688e057750148487996396e9ca.tar.xz linux-319508902600c2688e057750148487996396e9ca.zip |
ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()
Copy events to user using __copy_to_user() rather than copy members of
individually with __put_user_error().
This has the benefit of disabling/enabling PAN once per event intead of
once per event member.
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/kernel/sys_oabi-compat.c')
-rw-r--r-- | arch/arm/kernel/sys_oabi-compat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index 4abe4909417f..a87684532327 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c @@ -277,6 +277,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, int maxevents, int timeout) { struct epoll_event *kbuf; + struct oabi_epoll_event e; mm_segment_t fs; long ret, err, i; @@ -295,8 +296,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, set_fs(fs); err = 0; for (i = 0; i < ret; i++) { - __put_user_error(kbuf[i].events, &events->events, err); - __put_user_error(kbuf[i].data, &events->data, err); + e.events = kbuf[i].events; + e.data = kbuf[i].data; + err = __copy_to_user(events, &e, sizeof(e)); + if (err) + break; events++; } kfree(kbuf); |