Re: Nasty 2.6 sendfile() bug / regression; affects vsftpd

From: Jamie Lokier
Date: Sun Apr 18 2004 - 19:48:00 EST


Looking at related code, sys_sendfile64 a few lines down.

if (unlikely(copy_from_user(&pos, offset, sizeof(loff_t))))
return -EFAULT;

if (unlikely(put_user(pos, offset)))
return -EFAULT;

It seems odd that put_user() is used to write an 8-byte value, but
get_user() cannot be used read one. I looked in <asm-i386/uaccess.h>
and indeed the asymmetry is there.

Is there a reason why put_user() supports 1/2/4/8 bytes and get_user()
supports only 1/2/4 bytes?

-- Jamie
-
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/