lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Mar 2010 15:08:51 +0100
From:	Bob Sleigh <bobslgh@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] oom_kill: set default process to kill

---
 mm/Kconfig    |    9 +++++++++
 mm/oom_kill.c |   10 ++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 9c61158..3911730 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -287,3 +287,12 @@ config NOMMU_INITIAL_TRIM_EXCESS
          of 1 says that all excess pages should be trimmed.

          See Documentation/nommu-mmap.txt for more information.
+
+config MM_USUAL_SUSPECT
+       string "Default executable name to be killed by the OOM killer"
+       default ""
+       help
+         This option sets the default executable name to be killed when we run
+         out of memory.
+
+         If unsure, set to "firefox-bin".
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 35755a4..333fa46 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -300,6 +300,16 @@ static struct task_struct
*select_bad_process(unsigned long *ppoints,
                if (p->signal->oom_adj == OOM_DISABLE)
                        continue;

+#ifdef CONFIG_MM_USUAL_SUSPECT
+               /*
+                * Select the task if matching the usual suspect.
+                */
+               if (strcmp(p->comm, CONFIG_MM_USUAL_SUSPECT)) {
+                       chosen = p;
+                       continue;
+               }
+#endif
+
                points = badness(p, uptime.tv_sec);
                if (points > *ppoints || !chosen) {
                        chosen = p;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ