提交 73dad6ef 编写于 作者: J Julien Thierry 提交者: Greg Kroah-Hartman

ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()

Commit 319508902600c2688e057750148487996396e9ca upstream.

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: NJulien Thierry <julien.thierry@arm.com>
Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: NDavid A. Long <dave.long@linaro.org>
Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 9cad5755
...@@ -277,6 +277,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, ...@@ -277,6 +277,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
int maxevents, int timeout) int maxevents, int timeout)
{ {
struct epoll_event *kbuf; struct epoll_event *kbuf;
struct oabi_epoll_event e;
mm_segment_t fs; mm_segment_t fs;
long ret, err, i; long ret, err, i;
...@@ -295,8 +296,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, ...@@ -295,8 +296,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
set_fs(fs); set_fs(fs);
err = 0; err = 0;
for (i = 0; i < ret; i++) { for (i = 0; i < ret; i++) {
__put_user_error(kbuf[i].events, &events->events, err); e.events = kbuf[i].events;
__put_user_error(kbuf[i].data, &events->data, err); e.data = kbuf[i].data;
err = __copy_to_user(events, &e, sizeof(e));
if (err)
break;
events++; events++;
} }
kfree(kbuf); kfree(kbuf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册