Skip to content

Commit b6e47f3

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9109/1: oabi-compat: add epoll_pwait handler
The epoll_wait() syscall has a special version for OABI compat mode to convert the arguments to the EABI structure layout of the kernel. However, the later epoll_pwait() syscall was added in arch/arm in linux-2.6.32 without this conversion. Use the same kind of handler for both. Fixes: 3698426 ("ARM: 5677/1: ARM support for TIF_RESTORE_SIGMASK/pselect6/ppoll/epoll_pwait") Cc: [email protected] Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 344179f commit b6e47f3

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

arch/arm/kernel/sys_oabi-compat.c

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,8 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
265265
return do_epoll_ctl(epfd, op, fd, &kernel, false);
266266
}
267267

268-
asmlinkage long sys_oabi_epoll_wait(int epfd,
269-
struct oabi_epoll_event __user *events,
270-
int maxevents, int timeout)
268+
static long do_oabi_epoll_wait(int epfd, struct oabi_epoll_event __user *events,
269+
int maxevents, int timeout)
271270
{
272271
struct epoll_event *kbuf;
273272
struct oabi_epoll_event e;
@@ -314,6 +313,39 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
314313
}
315314
#endif
316315

316+
SYSCALL_DEFINE4(oabi_epoll_wait, int, epfd,
317+
struct oabi_epoll_event __user *, events,
318+
int, maxevents, int, timeout)
319+
{
320+
return do_oabi_epoll_wait(epfd, events, maxevents, timeout);
321+
}
322+
323+
/*
324+
* Implement the event wait interface for the eventpoll file. It is the kernel
325+
* part of the user space epoll_pwait(2).
326+
*/
327+
SYSCALL_DEFINE6(oabi_epoll_pwait, int, epfd,
328+
struct oabi_epoll_event __user *, events, int, maxevents,
329+
int, timeout, const sigset_t __user *, sigmask,
330+
size_t, sigsetsize)
331+
{
332+
int error;
333+
334+
/*
335+
* If the caller wants a certain signal mask to be set during the wait,
336+
* we apply it here.
337+
*/
338+
error = set_user_sigmask(sigmask, sigsetsize);
339+
if (error)
340+
return error;
341+
342+
error = do_oabi_epoll_wait(epfd, events, maxevents, timeout);
343+
restore_saved_sigmask_unless(error == -EINTR);
344+
345+
return error;
346+
}
347+
#endif
348+
317349
struct oabi_sembuf {
318350
unsigned short sem_num;
319351
short sem_op;

arch/arm/tools/syscall.tbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
343 common vmsplice sys_vmsplice
361361
344 common move_pages sys_move_pages
362362
345 common getcpu sys_getcpu
363-
346 common epoll_pwait sys_epoll_pwait
363+
346 common epoll_pwait sys_epoll_pwait sys_oabi_epoll_pwait
364364
347 common kexec_load sys_kexec_load
365365
348 common utimensat sys_utimensat_time32
366366
349 common signalfd sys_signalfd

0 commit comments

Comments
 (0)