Re: dev_ifname32() fails on 32->64bit calls in copy_in_user().

From: Arnd Bergmann
Date: Tue Oct 30 2007 - 21:13:12 EST


On Wednesday 31 October 2007, Joel Becker wrote:
>
>         Instrumenting the kernel with printks, the EFAULT comes from
> the first copy_in_user() at line 325 of fs/compat_ioctl.c (in
> dev_ifname32()).  I put some access_ok() checks in, and they do not
> trigger (access is ok).  The call never even gets into sys_ioctl().

Can you printk the pointers (arg and uifr) as well? Maybe the end up
unaligned or otherwise corrupted for some reason.

Does the same thing happen when you try the ioctl on something that
is not even a socket? E.g.

#include <whatever you need...>
int main(void)
{
struct ifreq ifr = {};
ioctl(0 /* standard input! */, SIOCGIFNAME, &ifr);
perror("ioctl");
}

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/