Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2200992pxm; Thu, 24 Feb 2022 19:13:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx630bHbSeqqpR6drwt5CWrET0A6EAksvVqGbTU2gP2OtcTCyH/lNnsqaavhXLQrTM08Bi1 X-Received: by 2002:a17:906:b201:b0:6b5:58c8:e43c with SMTP id p1-20020a170906b20100b006b558c8e43cmr4368387ejz.441.1645758834316; Thu, 24 Feb 2022 19:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645758834; cv=none; d=google.com; s=arc-20160816; b=xKDz6/aUcP6DwPfQzob089xc7tszahUOrHZUdXbo6PoiRcSlpcW9UjEztN/PotVXhV U4Z5rY4c+mfz5MSpoXdU2+vAyuCzHIuYz/0xi5fG5/FGydu1KebhZlw/lZmOp+kXP49w bSXPPPFy4nHX0vDyv4V2FT4gwjpMGOrWAuXAE1D39KAHAM9I3/mjUNnoTslKBl6wLK39 xG3g6XwI8829WelxoKoorQc1eQ8JNUAW6A0rO6o0CGJl2kF8iva+NaHewyqm24SxHDqd melQ3TKrG+b9LWcBlmrll599J77et+1uXurwaibVxNiE4UFJp68H/yPlSjFt9BC9Plv0 GZJw== 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; bh=NQ03IZoJe9XVX230YjnEEG2nGQbaZZz7diy5TodzMLM=; b=lWcQ7b0okNhOH6NQXB5bHw3HFHJOAeXth/AUtU73WR2XDEmkXeYuaFRGGUuIgYGXPo 8Hig5C4j1nCnRTcfnGxNYFfcMtLJ/3es/PoXPPi2nFQEAAFkP/b17fYU/JFlFQz6TfxM h15QUFQxWvDSozId5OjWglPYY6HrCp3lKukfNta6eQSNE34X4DgkVyYuXgnrTMLJJGeA Slx7wx1ZiyuXtJTx6lg0QIeMqJEX8Lf4GxEOx3SnB48qR61xSZCG9/zwfBFUJoI4WtwQ u82pTszmg90Fn89OwVfkYV4lK5/LuCpDFpLlEhYC8XMThhwRemP3oLgRPZSMB4nuAcDt QfZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a509545000000b004131c5d0885si778871eda.466.2022.02.24.19.13.31; Thu, 24 Feb 2022 19:13:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236567AbiBYCGq (ORCPT + 99 others); Thu, 24 Feb 2022 21:06:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233794AbiBYCGp (ORCPT ); Thu, 24 Feb 2022 21:06:45 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 4CFAC1D6F59 for ; Thu, 24 Feb 2022 18:06:14 -0800 (PST) Received: (qmail 1066190 invoked by uid 1000); 24 Feb 2022 21:06:13 -0500 Date: Thu, 24 Feb 2022 21:06:13 -0500 From: "stern@rowland.harvard.edu" To: "gregkh@linuxfoundation.org" 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: <00000000000033314805d8765175@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 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?. 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. > That will be more work, but it's the correct fix here. Otherwise it > needs to take the same bus locks that the device lives on to keep things > in sync, like the driver core would do if it were managing these things. > That could be the "short term" fix if no one wants to do the real work > needed here. Nothing should be needed to change in the driver core > itself, it is rightfully thinking it owns the device and can free it > when needed. All right, thanks. I'll think about implementing it. Alan Stern