From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Peter Zijlstra" <peterz@infradead.org>,
"André Almeida" <andrealmeid@collabora.com>,
"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 5.15.y 2/6] futex: Rename hash_futex()
Date: Thu, 10 Sep 2026 10:06:13 -0400 [thread overview]
Message-ID: <20260910140617.564852-2-sashal@kernel.org> (raw)
In-Reply-To: <20260910140617.564852-1-sashal@kernel.org>
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit eee5a7bc96becd7cdb8e4fabd327ca5e49136704 ]
In order to prepare introducing these symbols into the global
namespace; rename:
s/hash_futex/futex_hash/g
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20210923171111.300673-8-andrealmeid@collabora.com
Stable-dep-of: a3b8d46fe401 ("futex: Prevent rcuwait use-after-free during requeue PI")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/futex/core.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index ff61ed8184a32..2a1ecbbedd155 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -298,7 +298,7 @@ struct futex_hash_bucket {
/*
* The base of the bucket array and its size are always used together
- * (after initialization only in hash_futex()), so ensure that they
+ * (after initialization only in futex_hash()), so ensure that they
* reside in the same cacheline.
*/
static struct {
@@ -408,13 +408,13 @@ static inline int hb_waiters_pending(struct futex_hash_bucket *hb)
}
/**
- * hash_futex - Return the hash bucket in the global hash
+ * futex_hash - Return the hash bucket in the global hash
* @key: Pointer to the futex key for which the hash is calculated
*
* We hash on the keys returned from get_futex_key (see below) and return the
* corresponding hash bucket in the global hash.
*/
-static struct futex_hash_bucket *hash_futex(union futex_key *key)
+static struct futex_hash_bucket *futex_hash(union futex_key *key)
{
u32 hash = jhash2((u32 *)key, offsetof(typeof(*key), both.offset) / 4,
key->both.offset);
@@ -923,7 +923,7 @@ static void exit_pi_state_list(struct task_struct *curr)
next = head->next;
pi_state = list_entry(next, struct futex_pi_state, list);
key = pi_state->key;
- hb = hash_futex(&key);
+ hb = futex_hash(&key);
/*
* We can race against put_pi_state() removing itself from the
@@ -1673,7 +1673,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset)
if (unlikely(ret != 0))
return ret;
- hb = hash_futex(&key);
+ hb = futex_hash(&key);
/* Make sure we really have tasks to wakeup */
if (!hb_waiters_pending(hb))
@@ -1771,8 +1771,8 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
if (unlikely(ret != 0))
return ret;
- hb1 = hash_futex(&key1);
- hb2 = hash_futex(&key2);
+ hb1 = futex_hash(&key1);
+ hb2 = futex_hash(&key2);
retry_private:
double_lock_hb(hb1, hb2);
@@ -2216,8 +2216,8 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
if (requeue_pi && match_futex(&key1, &key2))
return -EINVAL;
- hb1 = hash_futex(&key1);
- hb2 = hash_futex(&key2);
+ hb1 = futex_hash(&key1);
+ hb2 = futex_hash(&key2);
retry_private:
hb_waiters_inc(hb2);
@@ -2459,7 +2459,7 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
{
struct futex_hash_bucket *hb;
- hb = hash_futex(&q->key);
+ hb = futex_hash(&q->key);
/*
* Increment the counter before taking the lock so that
@@ -3224,7 +3224,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
if (ret)
return ret;
- hb = hash_futex(&key);
+ hb = futex_hash(&key);
spin_lock(&hb->lock);
/*
--
2.53.0
next prev parent reply other threads:[~2026-09-10 14:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:18 FAILED: patch "[PATCH] futex: Prevent rcuwait use-after-free during requeue PI" failed to apply to 5.15-stable tree gregkh
2026-09-10 14:06 ` [PATCH 5.15.y 1/6] futex: Rename __unqueue_futex() Sasha Levin
2026-09-10 14:06 ` Sasha Levin [this message]
2026-09-10 14:06 ` [PATCH 5.15.y 3/6] futex: Rename: {get,cmpxchg}_futex_value_locked() Sasha Levin
2026-09-10 14:06 ` [PATCH 5.15.y 4/6] futex: Rename mark_wake_futex() Sasha Levin
2026-09-10 14:06 ` [PATCH 5.15.y 5/6] futex: Split out requeue Sasha Levin
2026-09-10 14:06 ` [PATCH 5.15.y 6/6] futex: Prevent rcuwait use-after-free during requeue PI Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260910140617.564852-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andrealmeid@collabora.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.