Hi,
oom_kill_task's comment states that we should be careful about not sending
SIGKILL to processes with SYS_CAP_RAWIO, then the code happily sends it
anyway.
Here's a patch that fixes that.
Signed-Off-By: Colin Leroy <[email protected]>
--- a/mm/oom_kill.c 2005-09-09 17:29:08.000000000 +0200
+++ b/mm/oom_kill.c 2005-09-09 17:29:10.000000000 +0200
@@ -199,7 +199,12 @@ static void __oom_kill_task(task_t *p)
p->time_slice = HZ;
set_tsk_thread_flag(p, TIF_MEMDIE);
- force_sig(SIGKILL, p);
+ /* This process has hardware access, be more careful. */
+ if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_RAWIO)) {
+ force_sig(SIGTERM, p);
+ } else {
+ force_sig(SIGKILL, p);
+ }
}
static struct mm_struct *oom_kill_task(task_t *p)
Hi,
Alternatively, if sending SIGKILL is intended, here's the patch that fixes the
comment.
Thanks,
Signed-Off-By: Colin Leroy <[email protected]>
--- a/mm/oom_kill.c 2005-09-09 17:29:08.000000000 +0200
+++ b/mm/oom_kill.c 2005-09-09 17:32:47.000000000 +0200
@@ -168,11 +168,6 @@ static struct task_struct * select_bad_p
return chosen;
}
-/**
- * We must be careful though to never send SIGKILL a process with
- * CAP_SYS_RAW_IO set, send SIGTERM instead (but it's unlikely that
- * we select a process with CAP_SYS_RAW_IO set).
- */
static void __oom_kill_task(task_t *p)
{
if (p->pid == 1) {