mbox series

[0/4] um: Set parent-death signal for sub-processes

Message ID 20241024142828.2612828-1-tiwei.btw@antgroup.com
Headers show
Series um: Set parent-death signal for sub-processes | expand

Message

Tiwei Bie Oct. 24, 2024, 2:28 p.m. UTC
The ubd io and write_sigio threads/processes may leak e.g. when
the main process is killed by "kill -9". Fix it by setting the
parent-death signal for them.

Tiwei Bie (4):
  um: Add os_set_pdeathsig helper function
  um: Set parent-death signal for ubd io thread/process
  um: Set parent-death signal for write_sigio thread/process
  um: Use os_set_pdeathsig helper in winch thread/process

 arch/um/drivers/chan_user.c | 3 +--
 arch/um/drivers/ubd_kern.c  | 1 +
 arch/um/include/shared/os.h | 2 ++
 arch/um/os-Linux/process.c  | 6 ++++++
 arch/um/os-Linux/sigio.c    | 1 +
 5 files changed, 11 insertions(+), 2 deletions(-)

Comments

Johannes Berg Oct. 25, 2024, 9:37 a.m. UTC | #1
On Thu, 2024-10-24 at 22:28 +0800, Tiwei Bie wrote:
> The ubd io and write_sigio threads/processes may leak e.g. when
> the main process is killed by "kill -9". Fix it by setting the
> parent-death signal for them.
> 

I always used killall, but yeah, good idea, thanks!

johannes