Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1219124imu; Fri, 11 Jan 2019 17:54:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN6dszT9wiLWreRTPBbIzYZ8AVZOY+Pr8EOQ3EDPqI/okclLqhmz1Hxu7EXk86qeAvwu8PU/ X-Received: by 2002:a62:4e83:: with SMTP id c125mr16947692pfb.101.1547258066229; Fri, 11 Jan 2019 17:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547258066; cv=none; d=google.com; s=arc-20160816; b=OcP3ybtzwgDoGvoa+dREZ1jzFywzzzoTZlL+fMbiu7KcycAkFM0daYm03Y37QFqU8j 6utCDxMUUnIZzpzfRz12koKbz/p84mpS/saGLAQKWNBhEjlxRjEkkD11nqGEeRyfqYZv XduOfeE0H9aZ+FCdu/93VvX0SR6TFYybxoXkamkC34XRRWBOCZP1CYHKdxOpAknPZNT6 7vT8TpDCl5vBGuQcuMmtY/CzINK1aUd5xAqj6buuKCvD+4zd6J6Nil1/se7/GIq8V+Kl P3gh20C9C0WjUlsZad5VRkzCoWIHPTmTXHpNs8dvQPORNk2FDfC76y2Xfk9Hko4WsxtP chAA== 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:from:subject:cc:to:message-id:date; bh=ocMT6avqkl8l/Y4beO/HRUTxD1wh2YNGZ0UUwlj1slI=; b=wU2pTufKxs2+N/P6aaToH3JraSfulBHJLh4q8QXAb0nBtwQtKautDQOmSpKXXQZM8j JRyFA7j7nQKPggyAYKEtdW/2Tsbp4sOWsSCaHZKDm6WemS5Meov27MqOpy3qZZs/b3QU 1fEToI6Eqfl18uK/JXBIWlxvU+P5M+MDU9DZZDLpReH20kqla3cfqsqzkqAqsDHL3qJV bmxjc4QRsk3FVdxxvD5psJ92k9TFJALJ/qABUVFZ24w380IMPhnA3CgsLuvImehWIRuX 2yBNhM65tts32hlFG4Q0pr+83bSvEnZ6A2tT+laM0JVNcD25xeu4oV1mIV2M62J4Fixf Bnfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 2si460690pla.156.2019.01.11.17.54.10; Fri, 11 Jan 2019 17:54:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726472AbfALBxF (ORCPT + 99 others); Fri, 11 Jan 2019 20:53:05 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:39500 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbfALBxF (ORCPT ); Fri, 11 Jan 2019 20:53:05 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 85D3F14CCB492; Fri, 11 Jan 2019 17:53:04 -0800 (PST) Date: Fri, 11 Jan 2019 17:53:03 -0800 (PST) Message-Id: <20190111.175303.1528012358618102203.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: yanjun.zhu@oracle.com, keescook@chromium.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: nvidia: forcedeth: Fix two possible concurrency use-after-free bugs From: David Miller In-Reply-To: <20190108124518.21986-1-baijiaju1990@gmail.com> References: <20190108124518.21986-1-baijiaju1990@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 11 Jan 2019 17:53:04 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Tue, 8 Jan 2019 20:45:18 +0800 > In drivers/net/ethernet/nvidia/forcedeth.c, the functions > nv_start_xmit() and nv_start_xmit_optimized() can be concurrently > executed with nv_poll_controller(). > > nv_start_xmit > line 2321: prev_tx_ctx->skb = skb; > > nv_start_xmit_optimized > line 2479: prev_tx_ctx->skb = skb; > > nv_poll_controller > nv_do_nic_poll > line 4134: spin_lock(&np->lock); > nv_drain_rxtx > nv_drain_tx > nv_release_txskb > line 2004: dev_kfree_skb_any(tx_skb->skb); > > Thus, two possible concurrency use-after-free bugs may occur. I do not think so, the netif_tx_lock_bh() done will prevent the parallel execution.