aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/umh.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-05-15 13:48:59 -0700
committerDavid S. Miller <davem@davemloft.net>2020-05-15 13:48:59 -0700
commitda07f52d3caf6c24c6dbffb5500f379d819e04bd (patch)
tree836e51994554f1aeddeebb6cb6ee568944a467e7 /kernel/umh.c
parentMerge branch 'mptcp-fix-MP_JOIN-failure-handling' (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
downloadlinux-dev-da07f52d3caf6c24c6dbffb5500f379d819e04bd.tar.xz
linux-dev-da07f52d3caf6c24c6dbffb5500f379d819e04bd.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Move the bpf verifier trace check into the new switch statement in HEAD. Resolve the overlapping changes in hinic, where bug fixes overlap the addition of VF support. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/umh.c')
-rw-r--r--kernel/umh.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/umh.c b/kernel/umh.c
index 9788ed481a6a..79f139a7ca03 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -475,6 +475,12 @@ static void umh_clean_and_save_pid(struct subprocess_info *info)
{
struct umh_info *umh_info = info->data;
+ /* cleanup if umh_pipe_setup() was successful but exec failed */
+ if (info->pid && info->retval) {
+ fput(umh_info->pipe_to_umh);
+ fput(umh_info->pipe_from_umh);
+ }
+
argv_free(info->argv);
umh_info->pid = info->pid;
}
@@ -544,6 +550,11 @@ EXPORT_SYMBOL_GPL(fork_usermode_blob);
* Runs a user-space application. The application is started
* asynchronously if wait is not set, and runs as a child of system workqueues.
* (ie. it runs with full root capabilities and optimized affinity).
+ *
+ * Note: successful return value does not guarantee the helper was called at
+ * all. You can't rely on sub_info->{init,cleanup} being called even for
+ * UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers
+ * into a successful no-op.
*/
int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
{