signal/GenWQE: Fix sending of SIGKILL
A message that is not in the archive (sent off-list or not yet received): [email protected]
Greg Kroah-Hartman
Acked-byQuoted 40 lines · Eric W. Biederman
The
genweq_add_fileandgenwqe_del_fileby caching current without using reference counting embed the assumption that a file descriptor will never be passed from one process to another. It even embeds the assumption that the the thread that opened the file will be in
existence when the process terminates. Neither of which are
guaranteed to be true.Therefore replace caching the
task_structof the opener with pid of the openers thread group id. All the knowledge of the opener is used for is as the target of SIGKILL and a SIGKILL will kill the entire process group.Rename
genwqe_force_sigtogenwqe_terminate, remove it's unncessary signal argument, update it's ownly caller, and usekill_pidinstead offorce_sig.The work
force_sigdoes in changing signal handling state is not relevant to SIGKILL sent asSEND_SIG_PRIV. The exact same processess will be killed just with less work, and less confusion. The work done byforce_sigis really only needed for handling syncrhonous exceptions.It will still be possible to cause
genwqe_device_removeto wait 8 seconds by passing a file descriptor to another process but the possible user after free is fixed.Fixes eaf4722d4645 ("GenWQE Character device and DDCB queue")Cc Greg Kroah-Hartman <[email protected]>Cc Frank Haverkamp <[email protected]>Cc Joerg-Stephan Vogt <[email protected]>Cc Michael Jung <[email protected]>Cc Michael Ruettger <[email protected]>Cc Kleber Sacilotto de Souza <[email protected]>Cc Sebastian Ott <[email protected]>Cc Eberhard S. Amann <[email protected]>Cc Gabriel Krisman Bertazi <[email protected]>Cc Guilherme G. Piccoli <[email protected]>Signed-off-by "Eric W. Biederman" <[email protected]>
Quoted 4 lines
---
Greg I intend to take this through my signal tree, but if you would rather take this through your driver tree please feel free.
No objection from me for you to take it through your tree: