[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3f3e501-2cb7-b683-4b85-2002b7603244@i-love.sakura.ne.jp>
Date: Thu, 2 Jul 2020 13:26:53 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Christian Borntraeger <borntraeger@...ibm.com>,
Christoph Hellwig <hch@...radead.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>, ast@...nel.org,
axboe@...nel.dk, bfields@...ldses.org,
bridge@...ts.linux-foundation.org, chainsaw@...too.org,
christian.brauner@...ntu.com, chuck.lever@...cle.com,
davem@...emloft.net, dhowells@...hat.com,
gregkh@...uxfoundation.org, jarkko.sakkinen@...ux.intel.com,
jmorris@...ei.org, josh@...htriplett.org, keescook@...omium.org,
keyrings@...r.kernel.org, kuba@...nel.org,
lars.ellenberg@...bit.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-security-module@...r.kernel.org, nikolay@...ulusnetworks.com,
philipp.reisner@...bit.com, ravenexp@...il.com,
roopa@...ulusnetworks.com, serge@...lyn.com, slyfox@...too.org,
viro@...iv.linux.org.uk, yangtiezhu@...ngson.cn,
netdev@...r.kernel.org, markward@...ux.ibm.com,
linux-s390 <linux-s390@...r.kernel.org>
Subject: Re: linux-next: umh: fix processed error when UMH_WAIT_PROC is used
seems to break linux bridge on s390x (bisected)
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 */
>
Powered by blists - more mailing lists