Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp224085rdb; Tue, 31 Oct 2023 06:02:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEow0Yjfsz8kBPDluvIb8otaI/l1ni4TsaFrui20oGVwuRGfwdht1vT+F+Oof8ZYHskGohd X-Received: by 2002:a05:6808:1a27:b0:3ae:554b:6c57 with SMTP id bk39-20020a0568081a2700b003ae554b6c57mr15306600oib.11.1698757379260; Tue, 31 Oct 2023 06:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698757379; cv=none; d=google.com; s=arc-20160816; b=zGTdxW5PmY9etBpMyYnfDXCAONi75yT9av/K1V2ZWN/0OjXDqC6ujI6WDhmkuAnm3n L3OtrYyBeBDYPfsOzLceYyyu2cGWUKqF1jydTsjnFNKDJzvx5OXfNnF6qGjTEo5wH7r3 jqs5f1OOX+baLzrVyhEkVc8OSZPvVel9cLYSK1pxtUYAt6KcWa0Jv7VcaOC22PHDUbif Y0aJRA68CMdSNWpYCCKbUCEE0ybzKZIhL5XYKItBjRzoAPy6I/PBOZiZHksbMYZuE/Qa zTHmikSKlHhL6b+x/bs8McRUC+lIMwuTAYFAJhcLTB12sco2vgWBStEPERWEr2/QpwVG PxpA== 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=+Aunl4u8heIeJyKK98fBjm2kWaNW4974GCfiYp5bN9w=; fh=u+NKV6jGi+yTNDlg0AXMY4uQk8eMNdLlecfZ/so1J1U=; b=H+9gAWTRipPZab/BLqWavkm/twECT+cv6XcLDU6HKISY9cDO2qs7ZZe5QyViiBtB64 8tiZ0kviYH/URviKGj7N9BuiUr8xP90PXJRclxCOpsEO0mUss6gqqDGrjN0Z/TmHVSqe HGqW3AqPYaUspn8QSNLauPNnHhfd2mR5Rjn5URBCxD5yoz+MVeb5fZjtIjV96MhIGckw VH0Jeg6dMcmDRPAl+GffYvrQMf9yEkUFRABrPDxSGSyggPjZvM2o4RGKFGA3pmwgBapw YwBuadKSxGKhSXMeJ9wzFKX8LBs90z59T+H0qW+KOUdQnpEyTpztDtF9CUBwCL25kKXw 0Hmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=icnAV7+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id gr18-20020a0568083a1200b003ae149e3a00si367048oib.183.2023.10.31.06.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:02:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=icnAV7+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 048F480301CB; Tue, 31 Oct 2023 06:02:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344382AbjJaNCt (ORCPT + 99 others); Tue, 31 Oct 2023 09:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344366AbjJaNCt (ORCPT ); Tue, 31 Oct 2023 09:02:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0617CB7 for ; Tue, 31 Oct 2023 06:02:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1E12C433C9; Tue, 31 Oct 2023 13:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698757366; bh=i9Bih+a16N50+/wqLFiAeUDIZcIh3ceZh6I9qgR2a5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=icnAV7+5EBcAHpu97hpv3ZB78z2tDH2iMG8B9ft8cQCXz446hHGiaVQGw6VAhoXS4 98+bb5MtZqD7l6YKxlwafs0h2XFpLodgAPAGROwlP+WAMLt0qxO1od3vbGqHYPo1xO CR0uuqay2LQ8GUDMVKjs6uE/wTRGcekSuzzUaU30= Date: Tue, 31 Oct 2023 14:02:43 +0100 From: Greg KH To: Mukesh Ojha Cc: Johannes Berg , Yu Wang , rafael@kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com Subject: Re: [PATCH] Devcoredump: fix use-after-free issue when releasing devcd device Message-ID: <2023103119-litigator-yonder-6ee1@gregkh> References: <20231027055521.2679-1-quic_yyuwang@quicinc.com> <2023102730-twins-thieving-d04e@gregkh> <22ab53d1ae36d4925732e6e1dc989dc75af126da.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 31 Oct 2023 06:02:56 -0700 (PDT) On Tue, Oct 31, 2023 at 06:16:08PM +0530, Mukesh Ojha wrote: > > > On 10/31/2023 2:29 PM, Johannes Berg wrote: > > On Tue, 2023-10-31 at 16:29 +0800, Yu Wang wrote: > > > > > > In this case, the device is temporarily added for dump only, so we need to > > > delete it when dump is completed. > > > The other users doesn't add/delete the device like this. > > > > For good reason, I guess? I think this is probably a bad idea. > > > > The whole point of this was to actually know which device created the > > coredump? If you make one up on the fly that's ... pointless? Surely you > > must have _some_ device that already exists? > > Passing device name to be user space looks to be the reason. Wait, again, why are you creating a fake device just to dump data? That's not what this api is for at all, why are you abusing it in ways it was not designed to be used? And I will strongly argue, that if no in-kernel users are having problems, perhaps it is your out-of-tree code? Unless you can show any in-kernel user of this trigging the issue, I don't think there's anything we need to do here, do you? thanks, greg k-h