Re: WARNING in netlink_ack (2)
From: Xin Long
Date: Fri Jan 12 2018 - 06:34:10 EST
On Thu, Jan 11, 2018 at 1:31 AM, syzbot
<syzbot+315fa6766d0f7c359327@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hello,
>
> syzkaller hit the following crash on
> cf1fb158230edce8a0482bfb2e59b9c390477fb6
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
> C reproducer is attached
> syzkaller reproducer is attached. See https://goo.gl/kgGztJ
> for information about syzkaller reproducers
>
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+315fa6766d0f7c359327@xxxxxxxxxxxxxxxxxxxxxxxxx
> It will help syzbot understand when the bug is fixed. See footer for
> details.
> If you forward the report, please keep this part and the footer.
>
> audit: type=1400 audit(1515595879.379:7): avc: denied { map } for
> pid=3498 comm="syzkaller002174" path="/root/syzkaller002174137" dev="sda1"
> ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
> tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
> tc_ctl_action: received NO action attribs
> WARNING: CPU: 0 PID: 3498 at net/netlink/af_netlink.c:2365
> netlink_ack+0x625/0xa10 net/netlink/af_netlink.c:2363
> Kernel panic - not syncing: panic_on_warn set ...
shoudn't the extack be cleared after the ack for one msg ?
@@ -2443,8 +2457,10 @@ int netlink_rcv_skb(struct sk_buff *skb, int
(*cb)(struct sk_buff *,
goto skip;
ack:
- if (nlh->nlmsg_flags & NLM_F_ACK || err)
+ if (nlh->nlmsg_flags & NLM_F_ACK || err) {
netlink_ack(skb, nlh, err, &extack);
+ memset(&extack, 0, sizeof(extack));
+ }
or just move the extack definition into the loop:
@@ -2417,11 +2431,11 @@ int netlink_rcv_skb(struct sk_buff *skb, int
(*cb)(struct sk_buff *,
struct nlmsghdr *,
struct netlink_ext_ack *))
{
- struct netlink_ext_ack extack = {};
struct nlmsghdr *nlh;
int err;
while (skb->len >= nlmsg_total_size(0)) {
+ struct netlink_ext_ack extack = {};
int msglen;
>
> CPU: 0 PID: 3498 Comm: syzkaller002174 Not tainted 4.15.0-rc7+ #256
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:17 [inline]
> dump_stack+0x194/0x257 lib/dump_stack.c:53
> panic+0x1e4/0x41c kernel/panic.c:183
> __warn+0x1dc/0x200 kernel/panic.c:547
> report_bug+0x211/0x2d0 lib/bug.c:184
> fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
> fixup_bug arch/x86/kernel/traps.c:247 [inline]
> do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
> do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
> invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:1079
> RIP: 0010:netlink_ack+0x625/0xa10 net/netlink/af_netlink.c:2363
> RSP: 0018:ffff8801bfd8f790 EFLAGS: 00010293
> RAX: ffff8801c00560c0 RBX: ffff8801d404dc00 RCX: ffffffff8455ad75
> RDX: 0000000000000000 RSI: ffff8801c03a3530 RDI: ffff8801d404dcd8
> RBP: ffff8801bfd8f848 R08: ffffed0038e8f55d R09: ffffed0038e8f55d
> R10: 0000000000000003 R11: ffffed0038e8f55c R12: ffff8801c03a3500
> R13: ffff8801c747aac0 R14: ffff8801d404d980 R15: 1ffff10037fb1ef8
> netlink_rcv_skb+0x375/0x470 net/netlink/af_netlink.c:2414
> rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4423
> netlink_unicast_kernel net/netlink/af_netlink.c:1275 [inline]
> netlink_unicast+0x4ee/0x700 net/netlink/af_netlink.c:1301
> netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1864
> sock_sendmsg_nosec net/socket.c:636 [inline]
> sock_sendmsg+0xca/0x110 net/socket.c:646
> ___sys_sendmsg+0x767/0x8b0 net/socket.c:2026
> __sys_sendmsg+0xe5/0x210 net/socket.c:2060
> SYSC_sendmsg net/socket.c:2071 [inline]
> SyS_sendmsg+0x2d/0x50 net/socket.c:2067
> entry_SYSCALL_64_fastpath+0x23/0x9a
> RIP: 0033:0x440c39
> RSP: 002b:00007ffeab2f1f98 EFLAGS: 00000217 ORIG_RAX: 000000000000002e
> RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440c39
> RDX: 0000000000008800 RSI: 00000000201dcfc8 RDI: 0000000000000003
> RBP: 00000000006cb018 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000004 R11: 0000000000000217 R12: 00000000004025a0
> R13: 0000000000402630 R14: 0000000000000000 R15: 0000000000000000
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Kernel Offset: disabled
> Rebooting in 86400 seconds..
>
>
> ---
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to syzkaller@xxxxxxxxxxxxxxxxx
>
> syzbot will keep track of this bug report.
> If you forgot to add the Reported-by tag, once the fix for this bug is
> merged
> into any tree, please reply to this email with:
> #syz fix: exact-commit-title
> If you want to test a patch for this bug, please reply with:
> #syz test: git://repo/address.git branch
> and provide the patch inline or as an attachment.
> To mark this as a duplicate of another syzbot report, please reply with:
> #syz dup: exact-subject-of-another-report
> If it's a one-off invalid bug report, please reply with:
> #syz invalid
> Note: if the crash happens again, it will cause creation of a new bug
> report.
> Note: all commands must start from beginning of the line in the email body.