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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  9 Jan 2019 17:06:27 +0800
From:   Peng Wang <rocking@....edu.cn>
To:     cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
        iamjoonsoo.kim@....com, akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Peng Wang <rocking@....edu.cn>
Subject: [PATCH] mm/slub.c: re-randomize random_seq if necessary

calculate_sizes() could be called in several places
like (red_zone/poison/order/store_user)_store() while
random_seq remains unchanged.

If random_seq is not NULL in calculate_sizes(), re-randomize it.

Signed-off-by: Peng Wang <rocking@....edu.cn>
---
 mm/slub.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 1e3d0ec4e200..2a9d18019545 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3583,6 +3583,15 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
 	if (oo_objects(s->oo) > oo_objects(s->max))
 		s->max = s->oo;
 
+#ifdef CONFIG_SLAB_FREELIST_RANDOM
+	if (unlikely(s->random_seq)) {
+		kfree(s->random_seq);
+		s->random_seq = NULL;
+		if (init_cache_random_seq(s))
+			return 0;
+	}
+#endif
+
 	return !!oo_objects(s->oo);
 }
 
-- 
2.19.1

Powered by blists - more mailing lists