fix kmalloc bug in bpf_prog_alloc_no_stats
Subsystems (3)
PATCH 1/1 fix kmalloc bug in bpf_prog_alloc_no_stats
From: Hithashri Bojanala <[email protected]>
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(-)
kernel/bpf/core.c +2 -1
@@ -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;
Signature · 1 line
2.47.0
Matthew Wilcox
NAKQuoted 4 lines · Hithashree Bojanala
From: Hithashri Bojanala <[email protected]>
fix https://syzkaller.appspot.com/bug?extid=d4264133b3e51212ea30
vmalloc doesnt support__GFP_ACCOUNT
NAK.
https://lore.kernel.org/linux-mm/[email protected]/
fixed this. Discussion here:
https://lore.kernel.org/linux-mm/aRXeK_C44xGb3ovg@milan/