From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
syzbot+9afaf6749e3a7aa1bdf3@syzkaller.appspotmail.com,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/urgent] futex: Handle invalid node numbers supplied by user
Date: Wed, 11 Jun 2025 09:20:07 -0000 [thread overview]
Message-ID: <174963360765.406.1360605707570146966.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250528085521.1938355-4-bigeasy@linutronix.de>
The following commit has been merged into the locking/urgent branch of tip:
Commit-ID: 8337204c58899fe422db765b481711eb2d95eb0b
Gitweb: https://git.kernel.org/tip/8337204c58899fe422db765b481711eb2d95eb0b
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Wed, 28 May 2025 10:55:21 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 05 Jun 2025 14:37:58 +02:00
futex: Handle invalid node numbers supplied by user
syzbot used a negative node number which was not rejected early and led
to invalid memory access in node_possible().
Reject negative node numbers except for FUTEX_NO_NODE.
[bigeasy: Keep the FUTEX_NO_NODE check]
Closes: https://lore.kernel.org/all/6835bfe3.a70a0220.253bc2.00b5.GAE@google.com/
Fixes: cec199c5e39bd ("futex: Implement FUTEX2_NUMA")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reported-by: syzbot+9afaf6749e3a7aa1bdf3@syzkaller.appspotmail.com
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250528085521.1938355-4-bigeasy@linutronix.de
---
kernel/futex/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 565f971..b652d2f 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -583,8 +583,8 @@ int get_futex_key(u32 __user *uaddr, unsigned int flags, union futex_key *key,
if (futex_get_value(&node, naddr))
return -EFAULT;
- if (node != FUTEX_NO_NODE &&
- (node >= MAX_NUMNODES || !node_possible(node)))
+ if ((node != FUTEX_NO_NODE) &&
+ ((unsigned int)node >= MAX_NUMNODES || !node_possible(node)))
return -EINVAL;
}
prev parent reply other threads:[~2025-06-11 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 8:55 [PATCH 0/3] futex: Fixups for the testsuite and FUTEX_NUMA Sebastian Andrzej Siewior
2025-05-28 8:55 ` [PATCH 1/3] selftests/futex: getopt() requires int as return value Sebastian Andrzej Siewior
2025-06-11 9:20 ` [tip: locking/urgent] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-28 8:55 ` [PATCH 2/3] selftests/futex: Set the home_node in futex_numa_mpol Sebastian Andrzej Siewior
2025-06-11 9:20 ` [tip: locking/urgent] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-28 8:55 ` [PATCH 3/3] futex: Handle invalid node numbers supplied by user Sebastian Andrzej Siewior
2025-06-11 9:20 ` tip-bot2 for Peter Zijlstra [this message]
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=174963360765.406.1360605707570146966.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=syzbot+9afaf6749e3a7aa1bdf3@syzkaller.appspotmail.com \
--cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®