Received: by 10.192.165.148 with SMTP id m20csp1728517imm; Thu, 26 Apr 2018 01:06:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+iyrEWq/a2X9fr0IEHuSdx7aYFBfjuXZsOfhRI79IKgiFDf6cT2HX9UTIRihBbAECdQO6Q X-Received: by 2002:a17:902:5597:: with SMTP id g23-v6mr19378256pli.347.1524729970408; Thu, 26 Apr 2018 01:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524729970; cv=none; d=google.com; s=arc-20160816; b=BpaeM6pY+0y7KvC0PGmUzp4LiKkMmI4Q4tNPdJ0QFypYOUoUC/DP2zEEV48PQ2IrlN Ff4Ki9nC2GVtKkIRleOeNAgfRrOZdWn7GSwHVSRcnw+3JTGOZZfIz1I6nR6y5nsLcAly GTvF2GSgopZvZloQC8uK1PPAnQ8oTsPB3AbU7mXTHQYzf5jnMLMm2wFXgEIlbvbYhhQk JSLT49H72fupJYUBhys+ERniWGpTNekSVC6Oi4OQemLF5ewZFp5JEYykj4YCaOfrnKuw TmFsGmMnUj3z1QtiRTteJa8P2M7mTLE8DiRMElD0pec7AVs0ByZOLpFy5GdLTkHOK82V kjUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Vy9zaq0croSC2acavMLFSBtq9Nb0WS9kT55BZ4mrz8U=; b=OzhzI9A/3s71BGQEXMcyZqdy4ohPlrVGauIVz3aeWIJfUsT1WtMcd7cYFLzPtyvoFr fM97uMEnsPwjd2d3loZvOhLVjsaV3dfvlbuMr2j2svYs4t2fIi6J/XEGribMqzsr/C/+ sNeznOI+c18yZ723C4L+kowNK9vXdvBfRheyxdx4TfJoQxckSAKoy0OAbHwtQZQC1whG l/NQSh32MT9DuBTnrXkYbj8iF0O4NbhJyya69N83+iKDJC1SozMSxtdFkikoAsb+caxp 3bCx4GA6dSEqELJgwRR4vA2hKp4wPMpmo/AzW6PzY0MJFE7mlIOwBCtq4Xid9uWrGijL OSOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BI87/Mx0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si17024922pff.73.2018.04.26.01.05.55; Thu, 26 Apr 2018 01:06:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BI87/Mx0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753589AbeDZIEr (ORCPT + 99 others); Thu, 26 Apr 2018 04:04:47 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34906 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbeDZIEh (ORCPT ); Thu, 26 Apr 2018 04:04:37 -0400 Received: by mail-pf0-f171.google.com with SMTP id j5so17639980pfh.2 for ; Thu, 26 Apr 2018 01:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Vy9zaq0croSC2acavMLFSBtq9Nb0WS9kT55BZ4mrz8U=; b=BI87/Mx0kuPZmD5oic7nZzezyetyMPa4re+lcy0iZFKtylt5tjCkpbAQfVKdcrr9GH /t4rJMVfxypmS4F2Q7k25oXTvSb5EpJKIVJwRZm1G3BJ997sRF9ukk+2I0jx6Mm9etlK tSNCefDijYyc13kY1cVdW1ZyT5xC8ayAzUC/1HDzKuBDShakYt1ENuHiSnCk8uppuJ+I 7l3UAe/oWw+b1kGXS/RM4P9YVCryLdENXFAyGjDwZ2X+0U7rfKnFPOLixHdmV3911S+8 4RbskxgxAlWAKLEekU0Fs0XYKlNr0et2yYywCFCY6R6Y/o7tHw9paFLmb8vSMcqKJu+3 9MPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vy9zaq0croSC2acavMLFSBtq9Nb0WS9kT55BZ4mrz8U=; b=AnLJ6dzWGnUjZS+h8ixv5v9g64KMI7J4XoBAt+UUZjC3bJz+rzF6Te1xVTZouUfeI9 2EDFSUiUfexs9scYdKKTsMrQPaH0CV0C5Ai9U2d6lIb3uMODiMXQ5b/NmgBGubh37ytg /PWWoRRm63uo5FiSxtKryarkQvIjvwiUdyFn3xyBq536Mavz4EmHjEhDNJBv9miH6Fyi hentZUCBODSUa0EKp+GKwQTB6ir2LDyCJo0a65z5lSs4uUufHDfQRGABY8G4m5ZII6pM BgeQiJDhY4anTdqqcRrhKQYPuyAoPaFPDMwGFiUCQLlwsP42kICC9d3FPLLX9iSlENee ApmA== X-Gm-Message-State: ALQs6tAQRyXTUI6qh8TSLY/lz/qh/bK6kPGxkRDGKHrLNcQJLkwvr+d7 vAPGSv2jpP2+6LimGYBGnDWG+9ILCB3RCePq4ehtnw== X-Received: by 2002:a17:902:595e:: with SMTP id e30-v6mr32494439plj.233.1524729876834; Thu, 26 Apr 2018 01:04:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.147.130 with HTTP; Thu, 26 Apr 2018 01:04:16 -0700 (PDT) In-Reply-To: <20180426061314.GH20683@leo.usersys.redhat.com> References: <001a113de2d878ade40569941a21@google.com> <20180426061314.GH20683@leo.usersys.redhat.com> From: Dmitry Vyukov Date: Thu, 26 Apr 2018 10:04:16 +0200 Message-ID: Subject: Re: WARNING: kobject bug in br_add_if To: Hangbin Liu Cc: syzbot , bridge@lists.linux-foundation.org, David Miller , LKML , netdev , stephen hemminger , syzkaller-bugs , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 8:13 AM, Hangbin Liu wrote: > On Wed, Apr 11, 2018 at 05:18:23PM +0200, Dmitry Vyukov wrote: >> On Wed, Apr 11, 2018 at 5:15 PM, syzbot >> wrote: >> > Hello, >> > >> > syzbot hit the following crash on upstream commit >> > 10b84daddbec72c6b440216a69de9a9605127f7a (Sat Mar 31 17:59:00 2018 +0000) >> > Merge branch 'perf-urgent-for-linus' of >> > git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip >> > syzbot dashboard link: >> > https://syzkaller.appspot.com/bug?extid=de73361ee4971b6e6f75 >> > >> > So far this crash happened 4 times on net-next, upstream. >> > Unfortunately, I don't have any reproducer for this crash yet. >> > Raw console output: >> > https://syzkaller.appspot.com/x/log.txt?id=5007286875455488 >> > Kernel config: >> > https://syzkaller.appspot.com/x/.config?id=-2760467897697295172 >> > compiler: gcc (GCC) 7.1.1 20170620 >> > >> > IMPORTANT: if you fix the bug, please add the following tag to the commit: >> > Reported-by: syzbot+de73361ee4971b6e6f75@syzkaller.appspotmail.com >> > 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. >> >> +Greg >> >> The plan is to remove this WARNING from kobject_add, if there are no objections. > > Hi Dmitry, > > For this bug, why should we remove the WARNING instead of adding a check in > br_add_if()? Something like Mainline because nobody wants to fix these. If you think this is a real bug and you are ready to fix it, please mail an official patch. > diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c > index 82c1a6f..79dcc3d 100644 > --- a/net/bridge/br_if.c > +++ b/net/bridge/br_if.c > @@ -518,8 +518,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev, > return -ELOOP; > } > > - /* Device is already being bridged */ > - if (br_port_exists(dev)) > + /* Device still has master upper dev */ > + if (netdev_master_upper_dev_get(dev)) > return -EBUSY; > > /* No bridging devices that dislike that (e.g. wireless) */ > > Thanks > Hangbin >> >> > ------------[ cut here ]------------ >> > binder: 23650:23651 unknown command 1078223622 >> > kobject_add_internal failed for brport (error: -12 parent: bond0) >> > binder: 23650:23651 ioctl c0306201 2000dfd0 returned -22 >> > WARNING: CPU: 1 PID: 23647 at lib/kobject.c:242 >> > kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:240 >> > Kernel panic - not syncing: panic_on_warn set ... >> > >> > CPU: 1 PID: 23647 Comm: syz-executor7 Not tainted 4.16.0-rc7+ #374 >> > binder: BINDER_SET_CONTEXT_MGR already set >> > 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/0x24d lib/dump_stack.c:53 >> > panic+0x1e4/0x41c kernel/panic.c:183 >> > __warn+0x1dc/0x200 kernel/panic.c:547 >> > report_bug+0x1f4/0x2b0 lib/bug.c:186 >> > fixup_bug.part.10+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+0x1b/0x40 arch/x86/entry/entry_64.S:986 >> > RIP: 0010:kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:240 >> > RSP: 0018:ffff8801d089f560 EFLAGS: 00010286 >> > RAX: dffffc0000000008 RBX: ffff8801adbee178 RCX: ffffffff815b193e >> > RDX: 0000000000040000 RSI: ffffc900022aa000 RDI: 1ffff1003a113e31 >> > RBP: ffff8801d089f658 R08: 1ffff1003a113df3 R09: 0000000000000000 >> > R10: 0000000000000000 R11: 0000000000000000 R12: 1ffff1003a113eb2 >> > R13: 00000000fffffff4 R14: ffff8801abd88828 R15: ffff8801d75a1e00 >> > kobject_add_varg lib/kobject.c:364 [inline] >> > kobject_init_and_add+0xf9/0x150 lib/kobject.c:436 >> > br_add_if+0x79a/0x1a70 net/bridge/br_if.c:533 >> > add_del_if+0xf4/0x140 net/bridge/br_ioctl.c:101 >> > br_dev_ioctl+0xa2/0xc0 net/bridge/br_ioctl.c:396 >> > dev_ifsioc+0x333/0x9b0 net/core/dev_ioctl.c:334 >> > dev_ioctl+0x176/0xbe0 net/core/dev_ioctl.c:500 >> > sock_do_ioctl+0x1ba/0x390 net/socket.c:981 >> > sock_ioctl+0x367/0x670 net/socket.c:1081 >> > vfs_ioctl fs/ioctl.c:46 [inline] >> > do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 >> > SYSC_ioctl fs/ioctl.c:701 [inline] >> > SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 >> > do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 >> > entry_SYSCALL_64_after_hwframe+0x42/0xb7 >> > RIP: 0033:0x454e79 >> > RSP: 002b:00007eff7dab7c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 >> > RAX: ffffffffffffffda RBX: 00007eff7dab86d4 RCX: 0000000000454e79 >> > RDX: 0000000020000000 RSI: 00000000000089a2 RDI: 0000000000000014 >> > RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 >> > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000015 >> > R13: 0000000000000369 R14: 00000000006f7278 R15: 0000000000000006 >> > Dumping ftrace buffer: >> > (ftrace buffer empty) >> > Kernel Offset: disabled >> > Rebooting in 86400 seconds..