The compat_sock_ioctl_trans handler currently passes the argument from a compat syscall directly to the generic ioctl handler without changing it. With PCuABI the ioctl handler can either take a capability or a real number value. Given that the compat handler takes a pointer or a number, this needs to be converted correctly when passed along.
This commits introduces changes that pass the argument as a capability where required.
Signed-off-by: Luca Vizzarro Luca.Vizzarro@arm.com --- net/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/socket.c b/net/socket.c index 1238bd1560ce..741086ceff95 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3363,7 +3363,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, case SIOCGIFCONF: case SIOCSIFBR: case SIOCGIFBR: - return sock_ioctl(file, cmd, arg); + return sock_ioctl(file, cmd, (user_uintptr_t)argp);
case SIOCGIFFLAGS: case SIOCSIFFLAGS: @@ -3411,7 +3411,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, case SIOCOUTQ: case SIOCOUTQNSD: case SIOCATMARK: - return sock_do_ioctl(net, sock, cmd, arg); + return sock_do_ioctl(net, sock, cmd, (user_uintptr_t)argp); }
return -ENOIOCTLCMD;