Received: by 10.192.165.148 with SMTP id m20csp1877379imm; Thu, 26 Apr 2018 03:39:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+OquQ+f61PxEC5tXobHMiwjBva/QFHFZWSz12rY85LNT/EwjlX7ilOcupnddUNAF6X0WeP X-Received: by 10.99.119.195 with SMTP id s186mr25961694pgc.296.1524739157803; Thu, 26 Apr 2018 03:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524739157; cv=none; d=google.com; s=arc-20160816; b=v2KHavt0ebHYCZQ0JJzcELsaw7f1OIJpQ80qtszwLytZSPh9S7RAf5hZRWFm4x/bws h9ULk8TzfGe0COoWHcb/SLdSgnNic4PEFQevcThz5MyvCceeNgJi1qxxB2W0ZkChKhud 9f/4RBHFC0/hm7SntrVdyw639AA3jk1IzbQWDpH5CpRNKmD+8yuYky5TRbc9/synKSVE eoorVuld+urfkUoDxGC3EKpPbiavwQH4uQUa+vmL636QRMHwqkZ6aU1D6Z99qjSQZZ/N Y0izeSLXPxfU5pDPnwQsXoghDSRsall3v2dblr/TT432z2DtEYrRQem5SYJOGpmW+OwG tePA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ewsDL+aPyLfD5fkSnwohd0nQwbyJ74Ncf0kesK4il3w=; b=hvLEgyt/98sOJxjGJ2B2ZGPxlnRctc+lHokErkyYX0C19Oy06hoQbWCLm68TOrI9wq Vw9sIG0yR8z4NAhrGA/Psr2drZIlWMs7sE67FyWkxdNDr+FOvov4PZDfnEZqtho5vZY0 a/lQKPLdzEGeRaNDqQOj9KUTiUeSD8R7Cqai9p02IsljwvKmoQBIqb3JI51EILBtrmae LfGlLFcSWq3x2UdrNMCsGGcaW+/FJPTeR112guxaARtzyqE+S3mTup7OoPZGE8Hvq6nP FAbDMiSRbOuWrTlQhkV+WOw/xM1EVA3gdpy6NUelmFeFifidPi9jZDqiWbtBs70+QG6Q 2wuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fPlrQ5AR; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si19039146pld.167.2018.04.26.03.39.04; Thu, 26 Apr 2018 03:39:17 -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=@gmail.com header.s=20161025 header.b=fPlrQ5AR; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755944AbeDZKhW (ORCPT + 99 others); Thu, 26 Apr 2018 06:37:22 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33328 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755632AbeDZKhQ (ORCPT ); Thu, 26 Apr 2018 06:37:16 -0400 Received: by mail-pg0-f65.google.com with SMTP id i194so15613960pgd.0; Thu, 26 Apr 2018 03:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ewsDL+aPyLfD5fkSnwohd0nQwbyJ74Ncf0kesK4il3w=; b=fPlrQ5ARjK3PW/2OkhQ+Sxrbsd1p2D9KoH1dRkdwvm/60//Vxq9SPvXiVQc4Ykt6ne j0e4ss+CZd7bYQYin+VqgbTrp/6vztuWTOVcEvkAruknUBsM3KfDwsDgY+SRQCavqqfH zQAqjRxGluLLbD6pf1j85ffSfLjARTqsvy7Ve5oHIRNBGmMYX0bn7avlqdlggZYjYtxu QBvGlA5kvqNCHLzsPNvfNdds8e9+basy52CcglGikoOF+zyV5bUoW5v0z/qQb00/fO8s t05f4DZOwZhhUFe0rkXQlyK3mPgo6W4Toat2GmfwoumG6WHMVyfcpg7mNUEnykjrd0F+ 9uKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ewsDL+aPyLfD5fkSnwohd0nQwbyJ74Ncf0kesK4il3w=; b=I1dKI1lhAIQsFl7ksTaIMUxv5KIhOilWMg3yrj+vl73fQfUBGoehWuiLsP8sciHRBL l/+Znz2/s4xs8YwHnQBceXfn72JCvWeUePqabRsX+j5ZIklPac7HhYjJPHIS8kER/6UT s1LLpbzrPo6hX8Z0uzk/58F+R3iNBlXKzzwO5jAFB64czhsGw0TnJBUkY/APpEKFCnEC ljemirF343ufELSxq/HxX89owyLRTcDti3a5E2hDv6q+UX91E0rcUzXEe95trjOdDbw4 XZ5+zFS0T0T5s8QW9YXdE7FrkOzjJm1bTRIk+hbbIcv192CNUJcZy5vivu7rOgK5qd8w JjaQ== X-Gm-Message-State: ALQs6tCXwQ63XZovhn5WP4rqfM7/2xQ1BCsn80++NNTX9/1oJDYT5kwJ hinwXxMX0/+ysTripb5eVTc= X-Received: by 2002:a17:902:9a8b:: with SMTP id w11-v6mr33275992plp.75.1524739035143; Thu, 26 Apr 2018 03:37:15 -0700 (PDT) Received: from leo.usersys.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y17sm7844731pfl.19.2018.04.26.03.37.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 03:37:14 -0700 (PDT) Date: Thu, 26 Apr 2018 18:37:03 +0800 From: Hangbin Liu To: Dmitry Vyukov Cc: syzbot , bridge@lists.linux-foundation.org, David Miller , LKML , netdev , stephen hemminger , syzkaller-bugs , Greg Kroah-Hartman Subject: Re: WARNING: kobject bug in br_add_if Message-ID: <20180426103702.GI20683@leo.usersys.redhat.com> References: <001a113de2d878ade40569941a21@google.com> <20180426061314.GH20683@leo.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) 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 10:04:16AM +0200, Dmitry Vyukov wrote: > 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. > > >> > ------------[ cut here ]------------ > >> > binder: 23650:23651 unknown command 1078223622 > >> > kobject_add_internal failed for brport (error: -12 parent: bond0) Re-checked the error. This is a -ENOMEM. So normally we could ignore it. But on the other hand, although we could find out the slave iface's master in netdev_master_upper_dev_link(). It already go much further and allocate some resource and change iface state. e.g. [54273.968516] br0: port 1(em1) entered blocking state [54273.973979] br0: port 1(em1) entered disabled state So I think we'd better return as early as possible. I will post a fix for this. Thanks Hangbin > >> > 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..