public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+e34177f6091df113ef20@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] x86/mm/pat: fix oob error
Date: Sat, 13 Sep 2025 00:36:08 -0700	[thread overview]
Message-ID: <68c51ee8.050a0220.2ff435.0370.GAE@google.com> (raw)
In-Reply-To: <68b87c9f.050a0220.3db4df.01fa.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] x86/mm/pat: fix oob error
Author: chandna.linuxkernel@gmail.com

Signed-off-by: Sahil Chandna <chandna.linuxkernel@gmail.com>
---
 arch/x86/mm/pat/set_memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index 8834c76f91c9..944e6a912fc6 100644
#syz test

--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -305,6 +305,9 @@ static inline unsigned long fix_addr(unsigned long addr)
 
 static unsigned long __cpa_addr(struct cpa_data *cpa, unsigned long idx)
 {
+	if (WARN_ON_ONCE(!cpa->pages || !cpa->pages[idx]))
+		return 0;
+
 	if (cpa->flags & CPA_PAGES_ARRAY) {
 		struct page *page = cpa->pages[idx];
 
-- 
2.51.0


  parent reply	other threads:[~2025-09-13  7:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 17:36 [syzbot] [kernel?] KASAN: slab-out-of-bounds Read in change_page_attr_set_clr syzbot
2025-09-13  5:13 ` Forwarded: " syzbot
2025-09-13  7:36 ` syzbot [this message]
2025-09-29  7:50 ` Forwarded: syzbot
2025-10-20  9:16 ` [syzbot] [kernel?] KASAN: slab-out-of-bounds Read in change_page_attr_set_clr syzbot
2025-10-20 23:21   ` Dave Hansen
2025-11-19 21:32 ` syzbot

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=68c51ee8.050a0220.2ff435.0370.GAE@google.com \
    --to=syzbot+e34177f6091df113ef20@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /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