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]
Message-Id: <20230922205450.033535181@infradead.org>
Date:   Fri, 22 Sep 2023 22:01:23 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     tglx@...utronix.de, axboe@...nel.dk
Cc:     linux-kernel@...r.kernel.org, peterz@...radead.org,
        mingo@...hat.com, dvhart@...radead.org, dave@...olabs.net,
        andrealmeid@...lia.com, Andrew Morton <akpm@...ux-foundation.org>,
        urezki@...il.com, hch@...radead.org, lstoakes@...il.com,
        Arnd Bergmann <arnd@...db.de>, linux-api@...r.kernel.org,
        linux-mm@...ck.org, linux-arch@...r.kernel.org,
        malteskarupke@....de, steve.shaw@...el.com,
        marko.makela@...iadb.com, andrei.artemev@...el.com
Subject: [PATCH 17/15] [HACK] futex: Force futex hash collision

If you hate performance -- use this.

Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 kernel/futex/core.c     |    6 ++++++
 kernel/sched/features.h |    2 ++
 2 files changed, 8 insertions(+)

--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -128,6 +128,9 @@ static int futex_put_value(u32 val, u32
 	}
 }
 
+#include <linux/sched/cputime.h>
+#include "../sched/sched.h"
+
 /**
  * futex_hash - Return the hash bucket in the global hash
  * @key:	Pointer to the futex key for which the hash is calculated
@@ -159,6 +162,9 @@ struct futex_hash_bucket *futex_hash(uni
 		}
 	}
 
+	if (sched_feat(FUTEX_SQUASH))
+		hash = 0;
+
 	return &futex_queues[node][hash & (futex_hashsize - 1)];
 }
 
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -89,3 +89,5 @@ SCHED_FEAT(UTIL_EST_FASTUP, true)
 SCHED_FEAT(LATENCY_WARN, false)
 
 SCHED_FEAT(HZ_BW, true)
+
+SCHED_FEAT(FUTEX_SQUASH, false)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ