On 02/02/2023 17:50, Luca Vizzarro wrote:
|diff --git a/net/socket.c b/net/socket.c index 7279bb1a4c28..1238bd1560ce 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1158,7 +1158,7 @@ void vlan_ioctl_set(int (*hook) (struct net *, void __user *)) EXPORT_SYMBOL(vlan_ioctl_set); static long sock_do_ioctl(struct net *net, struct socket *sock, - unsigned int cmd, unsigned long arg) + unsigned int cmd, user_uintptr_t arg)|
This patch looks all good, but like the first patch, trying to follow both the native and compat sides suggests there's an issue with the top-level compat handler, specifically compat_sock_ioctl_trans() in this file. For most commands, it passes the unsigned long arg directly to the native handler, and it looks like most commands expect a pointer.
Ideally we would only use compat_ptr() for the commands where the argument is actually a pointer, but if that proves too complicated, using it all for all the remaining commands would be acceptable.
Kevin