On Fri, May 08, 2020 at 01:45:25PM -0500, Eric W. Biederman wrote:
>
> Oleg modified the code that did
> "mutex_lock_interruptible(¤t->cred_guard_mutex)" to return
> -ERESTARTNOINTR instead of -EINTR, so that userspace will never see a
> failure to grab the mutex.
>
> Slightly earlier Liam R. Howlett defined mutex_lock_killable for
> exactly the same situation but it does it a little more cleanly.
>
> Switch the code to mutex_lock_killable so that it is clearer what the
> code is doing.
>
> Ref: ad776537cc6b ("Add mutex_lock_killable")
> Ref: 793285fcafce ("cred_guard_mutex: do not return -EINTR to user-space")
> Signed-off-by: "Eric W. Biederman" <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
--
Kees Cook