Re: Q: sys_futex() && timespec_valid()
From: Jakub Jelinek
Date: Mon Jun 28 2010 - 10:37:07 EST
On Mon, Jun 28, 2010 at 03:58:25PM +0200, Oleg Nesterov wrote:
> Honestly, it looks a bit strange to me that you blame the correct code,
Whether that is correct or not is what is being disputed.
> and at the same time you ignore the test-case which hangs because the
> kernel returns -EFAULT saying that this is the caller's problem.
The userspace code reads the abstime->tv_nsec value, so if it wouldn't
be valid address, the code would already segfault. And that's fine, POSIX
certainly allows that, reporting EFAULT isn't required. Well, it doesn't
read abstime->tv_sec in the assembly version, so if you try hard, you can
avoid the segfault, yet get EFAULT from futex syscall by putting abstime
8 bytes before start of some page with previous page not mmapped.
Jakub
--
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/