Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp973694pxm; Sat, 26 Feb 2022 02:51:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9gSZCTzLbN0w8OG8mRGL07eLiOe7e3oFlvu81+/4Xt3RdS8KSFQRt0HWPk5wJZpKi55PW X-Received: by 2002:a05:6a00:1704:b0:4cc:c8d7:e54a with SMTP id h4-20020a056a00170400b004ccc8d7e54amr12171708pfc.16.1645872704130; Sat, 26 Feb 2022 02:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645872704; cv=none; d=google.com; s=arc-20160816; b=XGnmi+i1UFAZwFBWVq5BJbpMx/MN7RLeCMBnwy2ILIAfBzOQQcKqMRaIhsHA2w7aMr 0+v9UHbW2ryRDI/OrAmy0iUDv0vOcvH+2k3gyK72fBdQsvqlH3H1TeDxi1voZj6HY/Vi /HONBCEBSfWkyYf58Cv3iHtwYAEfiCXGOqamEE9NqsOCI+PTZYw18ilh9vm7RQWPsNi7 X5r9YJUpUK6bp+68waoDx/OJ6R3MZdYQiCUrSQGkXSYS28lt8GurW2DSCNPv0CU4YZL2 oYIoqC2xa/kHAGSE6PDn111WzwrKsHRG301Cv5eZYv/tAy/37y5nhTLn1DRDhHC2GZBE /NXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y6WgpLSXAXOoP2CQ0LsKdAgCgUSWUoja0GkB+FfEvQ4=; b=iHq68DXqd6JcfrCqPQJAACMmecl3pCLGPuomIEXuSSBe2JKz8/45DpohzUm3sVqcWI TuUzgvem4jmvTW15pz6PDFFhg9bivxtsTx4rxwCs4CmsZUi3o8fqfwaTRmq7DmZE+ilG hujkQTiVQv4g9WRxrTi97FukhvFm9MhrmPzDrgCe638Rn7pVJ9BIfNdZOsMbD0QZwpx4 Dq1SSp8ihPlehmh0BxVDj3R4KwMwgUR0GInLS0Rwnnjr5K4E+zFTg7VkBiQV8mBxa3i7 ZE+7iD1xycBB2uHFDttrrIQ3jBN1Bw98tpVU1WzCcOF8gPIH5dYd6GS+1QTHGMu3SxWF HhYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eWU8C++r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a17090acf9000b001bc71b9758fsi9516057pju.46.2022.02.26.02.51.29; Sat, 26 Feb 2022 02:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eWU8C++r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiBZJHo (ORCPT + 99 others); Sat, 26 Feb 2022 04:07:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiBZJHn (ORCPT ); Sat, 26 Feb 2022 04:07:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A5C20586A for ; Sat, 26 Feb 2022 01:07:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E02AFB81201 for ; Sat, 26 Feb 2022 09:07:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE60AC340F0; Sat, 26 Feb 2022 09:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645866426; bh=usvEE0pEm0EOteEfF241E3y3GrnzYZ9F1cmd4JnZ6XI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eWU8C++rMZTrtO73vWnPKiX2HnGxNw33m4pglCeKa1S8usfhMTQXopuIjaHfU7rjC LV+0RK+RJQL1o5xhucpgo5H3N2LcN3xecy+20B2YqikZZdpZyifgQVc2Aj/EOgLRG6 HfWNYBofXurqfrEPoYc7lagC3oEMx+xPqtQDxo/8= Date: Sat, 26 Feb 2022 10:07:02 +0100 From: "gregkh@linuxfoundation.org" To: "stern@rowland.harvard.edu" Cc: "Zhang, Qiang1" , Tejun Heo , syzbot , "linux-kernel@vger.kernel.org" , "syzkaller-bugs@googlegroups.com" , "balbi@kernel.org" Subject: Re: [syzbot] KASAN: use-after-free Read in dev_uevent Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 10:51:48AM -0500, stern@rowland.harvard.edu wrote: > On Fri, Feb 25, 2022 at 09:53:35AM +0100, gregkh@linuxfoundation.org wrote: > > On Thu, Feb 24, 2022 at 09:06:13PM -0500, stern@rowland.harvard.edu wrote: > > > On Thu, Feb 24, 2022 at 11:37:39PM +0100, gregkh@linuxfoundation.org wrote: > > > > On Thu, Feb 24, 2022 at 04:23:26PM -0500, stern@rowland.harvard.edu wrote: > > > > > Can you tell us how this should be fixed? > > > > > > > > It should be fixed by properly using the driver core to bind/unbind the > > > > driver to devices like I mentioned previously :) > > > > > > This would involve creating a "gadget" bus_type (or should it be a > > > device_type under the platform bus?) and registering the gadgets > > > on it, right?. > > > > Yes. Or you can use the aux bus for this, which might be easier. > > > > > Similarly, the gadget drivers would be registered on > > > this bus. I suppose we can control which drivers get bound to which > > > gadgets with careful matching code. > > > > The aux bus might make this easier: > > Documentation/driver-api/auxiliary_bus.rst > > Won't this end up changing the user-visible filenames and directories in > sysfs for gadgets and gadget drivers? > > For instance, currently gadgets get registered under their UDC driver > name, like "net2280" or "at91". If we put them on the aux bus then they > will have to get registered under a name looking something like > "udc.gadget.0", i.e., module name, generic device name, and ID number. Ah, yeah, that isn't good. > We will be forced to use a generic device name because the aux bus does > matching based on it, and we want every gadget driver to be able to > match every UDC. We don't want some gadget drivers restricted to > net2280 gadgets, others restricted to fotg210 gadgets, and so on. So yes, I guess it does need to be a "real" bus, sorry. thanks, greg k-h