]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.181/fbdev-fix-warning-in-__alloc_pages_nodemask-bug.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / fbdev-fix-warning-in-__alloc_pages_nodemask-bug.patch
1 From 8c40292be9169a9cbe19aadd1a6fc60cbd1af82f Mon Sep 17 00:00:00 2001
2 From: Jiufei Xue <jiufei.xue@linux.alibaba.com>
3 Date: Thu, 11 Apr 2019 19:25:12 +0200
4 Subject: fbdev: fix WARNING in __alloc_pages_nodemask bug
5
6 From: Jiufei Xue <jiufei.xue@linux.alibaba.com>
7
8 commit 8c40292be9169a9cbe19aadd1a6fc60cbd1af82f upstream.
9
10 Syzkaller hit 'WARNING in __alloc_pages_nodemask' bug.
11
12 WARNING: CPU: 1 PID: 1473 at mm/page_alloc.c:4377
13 __alloc_pages_nodemask+0x4da/0x2130
14 Kernel panic - not syncing: panic_on_warn set ...
15
16 Call Trace:
17 alloc_pages_current+0xb1/0x1e0
18 kmalloc_order+0x1f/0x60
19 kmalloc_order_trace+0x1d/0x120
20 fb_alloc_cmap_gfp+0x85/0x2b0
21 fb_set_user_cmap+0xff/0x370
22 do_fb_ioctl+0x949/0xa20
23 fb_ioctl+0xdd/0x120
24 do_vfs_ioctl+0x186/0x1070
25 ksys_ioctl+0x89/0xa0
26 __x64_sys_ioctl+0x74/0xb0
27 do_syscall_64+0xc8/0x550
28 entry_SYSCALL_64_after_hwframe+0x49/0xbe
29
30 This is a warning about order >= MAX_ORDER and the order is from
31 userspace ioctl. Add flag __NOWARN to silence this warning.
32
33 Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
34 Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
35 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36
37 ---
38 drivers/video/fbdev/core/fbcmap.c | 2 ++
39 1 file changed, 2 insertions(+)
40
41 --- a/drivers/video/fbdev/core/fbcmap.c
42 +++ b/drivers/video/fbdev/core/fbcmap.c
43 @@ -94,6 +94,8 @@ int fb_alloc_cmap_gfp(struct fb_cmap *cm
44 int size = len * sizeof(u16);
45 int ret = -ENOMEM;
46
47 + flags |= __GFP_NOWARN;
48 +
49 if (cmap->len != len) {
50 fb_dealloc_cmap(cmap);
51 if (!len)