lkml.org 
[lkml]   [2020]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-next: umh: fix processed error when UMH_WAIT_PROC is used seems to break linux bridge on s390x (bisected)
From
Date
On 2020/07/02 0:38, Luis Chamberlain wrote:
> @@ -156,6 +156,18 @@ static void call_usermodehelper_exec_sync(struct subprocess_info *sub_info)
> */
> if (KWIFEXITED(ret))
> sub_info->retval = KWEXITSTATUS(ret);
> + /*
> + * Do we really want to be passing the signal, or do we pass
> + * a single error code for all cases?
> + */
> + else if (KWIFSIGNALED(ret))
> + sub_info->retval = KWTERMSIG(ret);

No, this is bad. Caller of usermode helper is unable to distinguish exit(9)
and e.g. SIGKILL'ed by the OOM-killer. Please pass raw exit status value.

I feel that caller of usermode helper should not use exit status value.
For example, call_sbin_request_key() is checking

test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || key_validate(key) < 0

condition (if usermode helper was invoked) in order to "ignore any errors from
userspace if the key was instantiated".

> + /* Same here */
> + else if (KWIFSTOPPED((ret)))
> + sub_info->retval = KWSTOPSIG(ret);
> + /* And are we really sure we want this? */
> + else if (KWIFCONTINUED((ret)))
> + sub_info->retval = 0;
> }
>
> /* Restore default kernel sig handler */
>

\
 
 \ /
  Last update: 2020-07-02 06:28    [W:0.136 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site