From: Hithashree Bojanala <bojanalahithashri@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
Hithashri Bojanala <bojanalahithashri@gmail.com>
Subject: [PATCH] fix kmalloc bug in bpf_prog_alloc_no_stats
Date: Mon, 24 Nov 2025 13:05:20 -0500 [thread overview]
Message-ID: <20251124180522.5350-1-bojanalahithashri@gmail.com> (raw)
From: Hithashri Bojanala <bojanalahithashri@gmail.com>
fix https://syzkaller.appspot.com/bug?extid=d4264133b3e51212ea30
vmalloc doesnt support __GFP_ACCOUNT
---
kernel/bpf/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index d595fe512498..ffe2658ce165 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -263,7 +263,8 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
if (pages <= fp_old->pages)
return fp_old;
- fp = __vmalloc(size, gfp_flags);
+ /*vmalloc doesn't support __GFP_ACCOUNT, so strip it for the vmalloc call */
+ fp = __vmalloc(size, gfp_flags & ~__GFP_ACCOUNT);
if (fp) {
memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE);
fp->pages = pages;
--
2.47.0
next reply other threads:[~2025-11-24 18:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 18:05 Hithashree Bojanala [this message]
2025-11-24 18:33 ` Matthew Wilcox
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=20251124180522.5350-1-bojanalahithashri@gmail.com \
--to=bojanalahithashri@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@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 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®