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:   Sat, 24 Feb 2018 11:04:53 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     davem@...emloft.net, willy@...radead.org
Cc:     netdev@...r.kernel.org, linux-mm@...ck.org, ikomyagin@...il.com,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH 1/2] slab: add flag to block merging of UAPI elements

The iproute2 program ss reads /proc/slabinfo to get TCP socket
statistics; therefore those kmem cache's can not be merged.
This patch adds a new flag to block merging in these kind
of cases.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 include/linux/slab.h | 6 ++++++
 mm/slab_common.c     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 231abc8976c5..867acc2ddcbc 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -108,6 +108,12 @@
 #define SLAB_KASAN		0
 #endif
 
+/*
+ * Some old applications may want to read/write particular slab cache
+ * by name and therefore this can not be merged.
+ */
+#define SLAB_VISIBLE_UAPI	0x10000000UL
+
 /* The following flags affect the page allocator grouping pages by mobility */
 /* Objects are reclaimable */
 #define SLAB_RECLAIM_ACCOUNT	((slab_flags_t __force)0x00020000U)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 10f127b2de7c..71eb5fc63cf8 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -49,7 +49,7 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work,
  */
 #define SLAB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
 		SLAB_TRACE | SLAB_TYPESAFE_BY_RCU | SLAB_NOLEAKTRACE | \
-		SLAB_FAILSLAB | SLAB_KASAN)
+		SLAB_FAILSLAB | SLAB_KASAN | SLAB_VISIBLE_UAPI)
 
 #define SLAB_MERGE_SAME (SLAB_RECLAIM_ACCOUNT | SLAB_CACHE_DMA | \
 			 SLAB_ACCOUNT)
-- 
2.16.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ