2021-04-12 01:38:20

by Hao Sun

[permalink] [raw]
Subject: BUG: unable to handle kernel paging request in __build_skb

Hi

When using Healer(https://github.com/SunHao-0/healer/tree/dev) to fuzz
the Linux kernel, I found the following bug report, but I'm not sure
about this.
Sorry, I do not have a reproducing program for this bug.
I hope that the stack trace information in the crash log can help you
locate the problem.

Here is the details:
commit: 4ebaab5fb428374552175aa39832abf5cedb916a
version: linux 5.12
git tree: kmsan

==============================================
RAX: ffffffffffffffda RBX: 000000000059c080 RCX: 000000000047338d
RDX: 0000000000000010 RSI: 0000000020002400 RDI: 0000000000000003
RBP: 00007fb6512c2c90 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007fffbb36285f R14: 00007fffbb362a00 R15: 00007fb6512c2dc0
BUG: unable to handle page fault for address: ffffa73d01c96a40
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1810067 P4D 1810067 PUD 1915067 PMD 4b84067 PTE 0
Oops: 0002 [#1] SMP
CPU: 0 PID: 6273 Comm: syz-executor Not tainted 5.12.0-rc6+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64
Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6
f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 <f3> aa
4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01
RSP: 0018:ffff9f3d01c9b930 EFLAGS: 00010082
RAX: ffffa73d01c96a00 RBX: 0000000000000020 RCX: 0000000000000020
RDX: 0000000000000020 RSI: 0000000000000000 RDI: ffffa73d01c96a40
RBP: ffff9f3d01c9b960 R08: ffffc2390000000f R09: ffffa73d01c96a40
R10: 000000007dee4e6b R11: ffffffffb2000782 R12: 0000000000000000
R13: 0000000000000020 R14: 0000000000000000 R15: ffff9f3d01c96a40
FS: 00007fb6512c3700(0000) GS:ffff97407fa00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffa73d01c96a40 CR3: 0000000030087005 CR4: 0000000000770ef0
PKRU: 55555554
Call Trace:
kmsan_internal_unpoison_shadow+0x1d/0x70 mm/kmsan/kmsan.c:110
__msan_memset+0x64/0xb0 mm/kmsan/kmsan_instr.c:130
__build_skb_around net/core/skbuff.c:209 [inline]
__build_skb+0x34b/0x520 net/core/skbuff.c:243
netlink_alloc_large_skb net/netlink/af_netlink.c:1193 [inline]
netlink_sendmsg+0xdc1/0x14d0 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:654 [inline]
sock_sendmsg net/socket.c:674 [inline]
____sys_sendmsg+0x13b5/0x1450 net/socket.c:2350
___sys_sendmsg net/socket.c:2404 [inline]
__sys_sendmsg+0x683/0x770 net/socket.c:2433
__do_sys_sendmsg net/socket.c:2442 [inline]
__se_sys_sendmsg+0x97/0xb0 net/socket.c:2440
__x64_sys_sendmsg+0x4a/0x70 net/socket.c:2440
do_syscall_64+0xa2/0x120 arch/x86/entry/common.c:48
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x47338d
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d
01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb6512c2c58 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000059c080 RCX: 000000000047338d
RDX: 0000000000000010 RSI: 0000000020002400 RDI: 0000000000000003
RBP: 00007fb6512c2c90 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007fffbb36285f R14: 00007fffbb362a00 R15: 00007fb6512c2dc0
Modules linked in:
Dumping ftrace buffer:
(ftrace buffer empty)
CR2: ffffa73d01c96a40
---[ end trace 3ef482cb4df9d746 ]---
RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64
Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6
f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 <f3> aa
4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01
RSP: 0018:ffff9f3d01c9b930 EFLAGS: 00010082
RAX: ffffa73d01c96a00 RBX: 0000000000000020 RCX: 0000000000000020
RDX: 0000000000000020 RSI: 0000000000000000 RDI: ffffa73d01c96a40
RBP: ffff9f3d01c9b960 R08: ffffc2390000000f R09: ffffa73d01c96a40
R10: 000000007dee4e6b R11: ffffffffb2000782 R12: 0000000000000000
R13: 0000000000000020 R14: 0000000000000000 R15: ffff9f3d01c96a40
FS: 00007fb6512c3700(0000) GS:ffff97407fa00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffa73d01c96a40 CR3: 0000000030087005 CR4: 0000000000770ef0
PKRU: 55555554


Attachments:
kmsan-config (173.72 kB)

2021-04-12 02:23:14

by Willem de Bruijn

[permalink] [raw]
Subject: Re: BUG: unable to handle kernel paging request in __build_skb

On Sun, Apr 11, 2021 at 9:31 PM Hao Sun <[email protected]> wrote:
>
> Hi
>
> When using Healer(https://github.com/SunHao-0/healer/tree/dev) to fuzz
> the Linux kernel, I found the following bug report, but I'm not sure
> about this.
> Sorry, I do not have a reproducing program for this bug.
> I hope that the stack trace information in the crash log can help you
> locate the problem.
>
> Here is the details:
> commit: 4ebaab5fb428374552175aa39832abf5cedb916a
> version: linux 5.12
> git tree: kmsan
>
> ==============================================
> RAX: ffffffffffffffda RBX: 000000000059c080 RCX: 000000000047338d
> RDX: 0000000000000010 RSI: 0000000020002400 RDI: 0000000000000003
> RBP: 00007fb6512c2c90 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
> R13: 00007fffbb36285f R14: 00007fffbb362a00 R15: 00007fb6512c2dc0
> BUG: unable to handle page fault for address: ffffa73d01c96a40
> #PF: supervisor write access in kernel mode
> #PF: error_code(0x0002) - not-present page
> PGD 1810067 P4D 1810067 PUD 1915067 PMD 4b84067 PTE 0
> Oops: 0002 [#1] SMP
> CPU: 0 PID: 6273 Comm: syz-executor Not tainted 5.12.0-rc6+ #1
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> 1.13.0-1ubuntu1.1 04/01/2014
> RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64
> Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6
> f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 <f3> aa
> 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01
> RSP: 0018:ffff9f3d01c9b930 EFLAGS: 00010082
> RAX: ffffa73d01c96a00 RBX: 0000000000000020 RCX: 0000000000000020
> RDX: 0000000000000020 RSI: 0000000000000000 RDI: ffffa73d01c96a40
> RBP: ffff9f3d01c9b960 R08: ffffc2390000000f R09: ffffa73d01c96a40
> R10: 000000007dee4e6b R11: ffffffffb2000782 R12: 0000000000000000
> R13: 0000000000000020 R14: 0000000000000000 R15: ffff9f3d01c96a40
> FS: 00007fb6512c3700(0000) GS:ffff97407fa00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: ffffa73d01c96a40 CR3: 0000000030087005 CR4: 0000000000770ef0
> PKRU: 55555554
> Call Trace:
> kmsan_internal_unpoison_shadow+0x1d/0x70 mm/kmsan/kmsan.c:110
> __msan_memset+0x64/0xb0 mm/kmsan/kmsan_instr.c:130
> __build_skb_around net/core/skbuff.c:209 [inline]
> __build_skb+0x34b/0x520 net/core/skbuff.c:243
> netlink_alloc_large_skb net/netlink/af_netlink.c:1193 [inline]
> netlink_sendmsg+0xdc1/0x14d0 net/netlink/af_netlink.c:1902
> sock_sendmsg_nosec net/socket.c:654 [inline]
> sock_sendmsg net/socket.c:674 [inline]

I don't have an idea what might be up, but some context:

This happens in __build_skb_around at

memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));

on vmalloc'd memory in netloc_alloc_large_skb:

data = vmalloc(size);
if (data == NULL)
return NULL;

skb = __build_skb(data, size);