diff options
author | Taehee Yoo <ap420073@gmail.com> | 2019-01-09 02:23:56 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-11 18:05:40 -0800 |
commit | 73ab1cb2de9e3efe7f818d5453de271e5371df1d (patch) | |
tree | 597da57b75e0bceceea75e1cbf9980068bc5dc54 /include/linux/umh.h | |
parent | 2ff33d6637393fe9348357285931811b76e1402f (diff) | |
download | lwn-73ab1cb2de9e3efe7f818d5453de271e5371df1d.tar.gz lwn-73ab1cb2de9e3efe7f818d5453de271e5371df1d.zip |
umh: add exit routine for UMH process
A UMH process which is created by the fork_usermode_blob() such as
bpfilter needs to release members of the umh_info when process is
terminated.
But the do_exit() does not release members of the umh_info. hence module
which uses UMH needs own code to detect whether UMH process is
terminated or not.
But this implementation needs extra code for checking the status of
UMH process. it eventually makes the code more complex.
The new PF_UMH flag is added and it is used to identify UMH processes.
The exit_umh() does not release members of the umh_info.
Hence umh_info->cleanup callback should release both members of the
umh_info and the private data.
Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/umh.h')
-rw-r--r-- | include/linux/umh.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/umh.h b/include/linux/umh.h index 235f51b62c71..0c08de356d0d 100644 --- a/include/linux/umh.h +++ b/include/linux/umh.h @@ -47,6 +47,8 @@ struct umh_info { const char *cmdline; struct file *pipe_to_umh; struct file *pipe_from_umh; + struct list_head list; + void (*cleanup)(struct umh_info *info); pid_t pid; }; int fork_usermode_blob(void *data, size_t len, struct umh_info *info); |