Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1061076iog; Wed, 15 Jun 2022 19:57:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIzH89eRybdxoI4TWBMKwVYtHVSMboQlR/mHeUl5tsAkSYF4u0KN81AemWBqKnMRkhRp38 X-Received: by 2002:a05:6402:61a:b0:433:406a:8d25 with SMTP id n26-20020a056402061a00b00433406a8d25mr3699535edv.276.1655348221282; Wed, 15 Jun 2022 19:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655348221; cv=none; d=google.com; s=arc-20160816; b=cqXOSG0s52jFUrzCYWek6nhXejYl0HmUMFVpoTUJIlIKmmnurhKELBihXEZe55QpMM EP89BfkDdWaudvQGKllbwA77NlavS/r6LEQupoQ+ZWgOu7F0bvKiUPb2UVEAGDnKyvH4 zfFcTc+RxezGAvkB0MMX7xm+VbEXinZGYuwPaWwyuvGEDBd++fKgRea+2TgnbgOUNMtf TMnVUIxtEcRs0LhHLNSNwFTdJO6AZC8aPFMLefCeQwGYtVCK4ehMwAv6j2RBlcrMrhGw 41Zgwz7Bmxyh7Qkg7uTwD4JQSnEMwMgiG/NbOs7SGTi55kJgBF1dEE/Rjz7XgrXU1Y5u QoXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0qiIt4YmG6kPL/Q4hy9mhu5h6pPLao+TnNMVUCWMk1c=; b=u84/v8pg4q78weKX/jM/6VhRDxG1uyx/diqzUunPzaLgKBPE/banvLRJqJWfqAhPgX 9acbO5q97SFoscZxa5qYppjPBfkkyVUggKKi8lFjN01dE/wIr4XpocP1aWMJRqAn++06 Xmq4ENrk3ulV9E4qSLbUPjgYdDvnY/CuaxrI2cCMbNexDAc+xxC/SRNsCJL/ZLwZ/82m Pje5DH3yLTFvq3EulO8ojTsBU73rrfYVrKp7XNHOy9zYBMYd/ehMKc2Vs5vhKaafUNnE dxBz0Qs670MAnVT7VY/aohmlA5uFo70AKitt+1c6vwR5urfh6mYq40TYZP12tuAhEmrk 4wKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OsbNIRhy; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a17090627c400b006fed575b9a7si640758ejc.207.2022.06.15.19.56.35; Wed, 15 Jun 2022 19:57:01 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=OsbNIRhy; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348016AbiFPCuz (ORCPT + 99 others); Wed, 15 Jun 2022 22:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiFPCuy (ORCPT ); Wed, 15 Jun 2022 22:50:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B6157B21; Wed, 15 Jun 2022 19:50:53 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 93257612A0; Thu, 16 Jun 2022 02:50:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3AF6C3411A; Thu, 16 Jun 2022 02:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655347852; bh=Wr/3th+k8NUJhza5MLu2fT8FjL/q3kYO2ECCExYM1ts=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OsbNIRhynU56uid/iiYCHDdgucR2CA8sYFj7fErVGfAG/IhL30cKlpfCR1T4V7Hgv caKKrZ6QU/ML01n5Thz25Qbv2olH7htW41OOXxeX9vWtmiAEiWppNoxBLcvMGNazsH RfjHDbSUWI7Sjbw5grC5CwqPVgFtQkrLRYNK+VHFl6t25IidHGRD4bbrk3Mm5++t7X HfHmLyb5CPiuPtatGFLvAQcduY2MBapUq0X7jtTg98Z6drYw54DEVZs9LglRcYccwq awweRc7CialJmZTJx2nWv9YoRtlzc21rnG25xwx1jAK8DhExIWdfjSIWEmpV+kdFyc MgWDpQoM6n5Mg== Date: Wed, 15 Jun 2022 19:50:50 -0700 From: Jakub Kicinski To: Wentao_Liang , jdmason@kudzu.us Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [PATCH net v2]vexy: Fix a use-after-free bug in vxge-main.c Message-ID: <20220615195050.6e4785ef@kernel.org> In-Reply-To: <20220615013816.6593-1-Wentao_Liang_g@163.com> References: <20220615013816.6593-1-Wentao_Liang_g@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 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 Jon, if you're there, do you have any sense on whether this HW is still in production somewhere? I scrolled thru last 5 years of the git history and there doesn't seem to be any meaningful change here while there's a significant volume of refactoring going in. On the patch itself: On Wed, 15 Jun 2022 09:38:16 +0800 Wentao_Liang wrote: > Subject: [PATCH] [PATCH net v2]vexy: Fix a use-after-free bug in vxge-main.c No need to repeat "[PATCH]" The driver is not called "vexy" as far as I can tell. > The pointer vdev points to a memory region adjacent to a net_device > structure ndev, which is a field of hldev. At line 4740, the invocation > to vxge_device_unregister unregisters device hldev, and it also releases > the memory region pointed by vdev->bar0. At line 4743, the freed memory > region is referenced (i.e., iounmap(vdev->bar0)), resulting in a > use-after-free vulnerability. We can fix the bug by calling iounmap > before vxge_device_unregister. Are you sure the bar0 is not needed by the netdev? You're freeing memory that the netdev may need until it's unregistered.