Re: [PATCH] epoll: fix compat syscall wire up of epoll_pwait2

From: Arnd Bergmann
Date: Sun Dec 20 2020 - 18:27:17 EST


On Sun, Dec 20, 2020 at 10:06 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Dec 20, 2020 at 12:14 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> >
> > The sigset_t argument is actually compatible between x86-32 and x86-64
>
> Well, random high bits in size_t or the pointer value aren't. So it
> still looks a bit iffy to me.
>
> But it might end up working almost by accident.

The direct syscall arguments all get the correct zero-extension with
asm/syscall_wrapper.h, just like they do with any other syscall that
is used in both native and compat mode, like epoll_wait().

It probably makes sense to change it just for consistency with the other
architectures, but I would assume that it was intentional when this was
added originally, as the compat handling for epoll_pwait() went through
several iterations before it first worked correctly.

Arnd