In the futex_wake_op function
of futex.c in the Linux kernel source,I was trying to understand how the control reaches this point.This happens when in the above said function,the futex_atomic_op_inuser
returns -EFAULT,and yet the uaddr2
is writable.
But from the source of futex_atomic_op_inuser
, I see that it returns -EFAULT only on if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
.
futex_atomic_op_inuser
in turn calls a the __futex_atomic_op
macro where I see a -EFAULT in the code but I'm told that path to EFAULT does not involve calling __futex_atomic_op
How does the control reach the aforementioned point (i.e.if (!fshared)goto retry_private;)then?
Thanks in advance!