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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 06 Jan 2017 09:13:23 +0100
From:   Mike Galbraith <efault@....de>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        linux-rt-users <linux-rt-users@...r.kernel.org>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: [rfc patch-rt] radix-tree: Partially disable memcg accounting in
 radix_tree_node_alloc()

radix-tree: Partially disable memcg accounting in radix_tree_node_alloc()

Having no preload, which turns accounting off for non-rt kernels, trying to
allocate coming from shmem_fault() when memcg is full sends us scurrying off
to pagefault_out_of_memory(), with dramatic (usually terminal) consequences.
LTP's madvise06 testcase triggers this quite well, and per gitk, the below
was the beginning of RT memcg woes.

58e698af4c63 radix-tree: account radix_tree_node to memory cgroup

Turn memcg accounting off for RT in the problematic path.

Signed-off-by: Mike Galbraith <efault@....de>
Cc: stable-rt@...r.kernel.org # +v4.6-rt
---
 lib/radix-tree.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -303,6 +303,13 @@ radix_tree_node_alloc(struct radix_tree_
 	if (!gfpflags_allow_blocking(gfp_mask) && !in_interrupt()) {
 		struct radix_tree_preload *rtp;
 
+#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_MEMCG)
+		/*
+		 * Arriving here from shmem_fault() and meeting a full memcg
+		 * will send us to pagefault_out_of_memory(), and a dead box.
+		 */
+		gfp_mask &= ~__GFP_ACCOUNT;
+#endif
 		/*
 		 * Even if the caller has preloaded, try to allocate from the
 		 * cache first for the new node to get accounted to the memory

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ