Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1379578ybc; Tue, 19 Nov 2019 20:04:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyeNDOFPw/OY4XKDt10dmEw2shgZBROXLwp68iS4f08ipyCXOEz25i4O29P2GXxWBxttagD X-Received: by 2002:a17:906:6552:: with SMTP id u18mr2185506ejn.36.1574222698168; Tue, 19 Nov 2019 20:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574222698; cv=none; d=google.com; s=arc-20160816; b=TW8TzkcF40eui6s1BQZpp8fFHBPk+7neUVYFmVe29D8knVAWaqZ+M6tv93P7qlOJdX /jW7wKkvjiFIckw9fPp+y57EvdSF1R5l0M5TvRDSvsdRmuYumiReHDwbwLtqgxWOlVq6 beXrYiN3bQeI0Dr/WenZisYu5bzogYLAXSmenpymiJZHBqSi3LzmS8cUIP0DHLcBvdhH fTKZUhgf2dYODel5DIDfrgkg9xvbwJoIZ1n6r5K76v/aJ3X/ZcTdXrDtzZZmF5a5UTy0 XMMSRzLgBZDpWJfm+N1VM2LPIAfqrC7QYqeCUBceZ6hJk41Ryn4G338MlAaZgxUEqu1W bxNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=mWI7eHD6ta71Vc7yCEWVPDtN9gE4oKgSIkIEeQqk/gY=; b=gU4IC6Cai57oBSQjv7O2aEeBTHiCWW65FziBw+Xc5pMXazuP5mmNXHtzNsSDL1m1C1 iEbziwa3msCMQaawk25xabA2BNHLc1iDyy4NuIypBW/pZ1Ovg4u4Lr4IgdIYAihDHVUk uEh1KyHHZrIrJwmo/Ywhv3yJn/ngtZsnZe5OeqGNbZf9aX9TnA6vuB4P39+Pde3PBO/P 98k/KV+zXnVIEOc7E7oGklRvoPAU8OgH63njSDB6YB7uocQeATYSautYIA72eOMK3Rq6 IXgzI/6WbJ/bfnqHrWHluqwwDO1TzgOJp5Cp3hHEiiZbPgr+p0xJz35d418mUAdkgxKF GbYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g24si16789264edv.239.2019.11.19.20.04.15; Tue, 19 Nov 2019 20:04:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbfKTEEJ (ORCPT + 99 others); Tue, 19 Nov 2019 23:04:09 -0500 Received: from gate.crashing.org ([63.228.1.57]:50026 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727508AbfKTEEJ (ORCPT ); Tue, 19 Nov 2019 23:04:09 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id xAK43hEk022130; Tue, 19 Nov 2019 22:03:44 -0600 Message-ID: <14e1a22937ce5a54d94dab04a103e159215fb654.camel@kernel.crashing.org> Subject: Re: general protection fault in kernfs_add_one From: Benjamin Herrenschmidt To: Linus Torvalds , syzbot , Marcel Holtmann , Johan Hedberg , "David S. Miller" Cc: Greg Kroah-Hartman , Linux Kernel Mailing List , Rafael Wysocki , syzkaller-bugs , Tejun Heo , linux-bluetooth Date: Wed, 20 Nov 2019 15:03:43 +1100 In-Reply-To: References: <000000000000bf6bd30575fec528@google.com> <000000000000e2ac670597ad2663@google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Tue, 2019-11-19 at 11:00 -0800, Linus Torvalds wrote: > So looking at the decode, as usual the noise generated by KASAN isn't > being very helpful, but it does look like at least one of the reports > (I picked 5.2 because I don't care about 4.19 etc) is because > 'kernfs_root(kn) is NULL in kernfs_add_one(). > > Looking at the reports, every single one seems to have a call chain > that comes from vhci_write() -> vhci_get_user() -> > vhci_create_device() -> __vhci_create_device() -> hci_register_dev() > -> device_add() -> kobject_add(). > > (In this case, "every single one" is by looking at the last 10 > reports > sorted by date, it wasn't exhaustive). > > The way it got into 'write()' can be a bit varied (splice, write, > whatever). > > That makes me think it's bluetooth that is the problem, but it might > be an effect of how syzbot groups the reports too, of course. > > Might the device have been added at the same time that the last > previous device was removed, so that the parent was deleted as the > new > device was aded? I dunno. The repro seem to be a repeated "open > /dev/vhci, write two random bytes to it" > > Or might it be some "it happens after you've added enough devices > that > something overflows" issue? > > Adding bluetooth people to the cc. Could this be what was fixed by: ac43432cb1f5c2950408534987e57c2071e24d8f ("driver core: Fix use-after-free and double free on glue directory") Which went into 5.3 afaik ? Cheers, Ben. > Linus > > On Mon, Nov 18, 2019 at 10:27 PM syzbot > wrote: > > > > syzbot has bisected this bug to: > > > > commit 726e41097920a73e4c7c33385dcc0debb1281e18 > > Author: Benjamin Herrenschmidt > > Date: Tue Jul 10 00:29:10 2018 +0000 > > > > drivers: core: Remove glue dirs from sysfs earlier > > > > bisection log: > > https://syzkaller.appspot.com/x/bisect.txt?x=168e1012e00000 > > start commit: 5e335542 Merge branch 'for-linus' of > > git://git.kernel.org/.. > > git tree: upstream > > final crash: > > https://syzkaller.appspot.com/x/report.txt?x=158e1012e00000 > > console output: > > https://syzkaller.appspot.com/x/log.txt?x=118e1012e00000 > > kernel config: > > https://syzkaller.appspot.com/x/.config?x=9917ff4b798e1a1e > > dashboard link: > > https://syzkaller.appspot.com/bug?extid=db1637662f412ac0d556 > > syz repro: > > https://syzkaller.appspot.com/x/repro.syz?x=10a66c11400000 > > C reproducer: > > https://syzkaller.appspot.com/x/repro.c?x=1346c771400000 > > > > Reported-by: syzbot+db1637662f412ac0d556@syzkaller.appspotmail.com > > Fixes: 726e41097920 ("drivers: core: Remove glue dirs from sysfs > > earlier") > > > > For information about bisection process see: > > https://goo.gl/tpsmEJ#bisection