Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4701964imu; Tue, 8 Jan 2019 04:58:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN6b5aGdRln3RrcOOeUfVX6Z7LudAXm6iQRr+hRHPQl1owuP5FKNAsdcMPCBUqAU81qY3OiC X-Received: by 2002:a63:5f89:: with SMTP id t131mr1495954pgb.26.1546952329656; Tue, 08 Jan 2019 04:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546952329; cv=none; d=google.com; s=arc-20160816; b=elCavZ3fUCiJfJx6UwjCUjyFARQ+rhvrdU+7OP+fE8Wbmh8dYfRQeHZeAOEFF1wc4F i8fciZ4Q3trYeT2kfNow03yPOt6pBG2Cv8K3pP6JqiQZWcbJzgX7bn3nmkcw6cUjSnsX tAGuwYr1pgUJVBBcZJqUKS91xmIrWPooXdkzJb2e0NRr5YwteYO18+3WNgao1g4kLxmW g4ou8kD/l/0crktcAAURgGwioraoa7BjVSWuEnL4SgVyK+P/w+deo8Vc6s9nq6bqkeIy Ve0l9Q5DtRIEE01CgUJHm6XLv+4BBCk41/hqGUq99wQXnrOqxrC526BxKpMN00M2tH/U Eb3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Ct+vC2YU8GpAw05IcANMMWtSRlijHvSbhvy81WFotpA=; b=Gp7vp1RBBsKDvRidkJLENMKhtidq8vItH0RkhLId3wLjm2ntjWeZNyU0ZSkhHwFm5G 5kNexyzMii70gsqBnxr/5Nnevh1sgmAg+U9gLvdolPue1Zuh9+bLZkLR3GMxnjqWGGfU xdQCbyx3wTuT6fuMphmr4sTT4VmXTynj5JKucaGmesbP+gTVUYQeMZmJInRJYPQwV95q 2xn7DEFROe6r1jBbC+az4H+e8xID/6RLZUXZIToO9FVvvJR6175qJRLGKZJ1n5wB28qP t1NaH8YWHmCOB3MAs29Sa01MqX1k3Lw2WOx1MbsX6kxtxl4tnhGXSfBPETe/wWm4ZTJ4 lQSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FQWhCyc9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si27324598pgc.164.2019.01.08.04.58.33; Tue, 08 Jan 2019 04:58:49 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FQWhCyc9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727980AbfAHM5T (ORCPT + 99 others); Tue, 8 Jan 2019 07:57:19 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33239 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfAHM5T (ORCPT ); Tue, 8 Jan 2019 07:57:19 -0500 Received: by mail-pf1-f194.google.com with SMTP id c123so1924605pfb.0; Tue, 08 Jan 2019 04:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Ct+vC2YU8GpAw05IcANMMWtSRlijHvSbhvy81WFotpA=; b=FQWhCyc9PeU1oOqEsrbpxWVYO0P9hzzQKVL6vZwmxZMA1Lio8I5jMgFJEdu/aZ8Nyh jucRxUkIXAxwpT2/MvR1+IVjAX8UP81l+i4NZbNPEh9vAi4yUxTLVL5dZBsVCEAUsQ5r RRGmzVcKvIBykA+iAWZ8yrGzyToD0irck87qhPT5ZnqedTTn+GSwOrGm0m6HxpR/pxZC XbzEmUxLZ91ETTDmvKd1u0h2Irlwp+lslEbs8uUNVKPZiP92bjvvk/LNmsHq/FEtbfxG +Uf+w+WSKynASD4qtrREL+r0vNKcMvFSWmnz0cUKCYagPzgwJjFOKfwCspPqSj5UT+9/ CJPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Ct+vC2YU8GpAw05IcANMMWtSRlijHvSbhvy81WFotpA=; b=eq7dw6I98Tb+XQsk36JKKIOV67gqc+O+h6G05jaWTohcAhxdO1KjdtjIw8p2tfHtLI LivU95juOi8rgzbpajynJmgWMsWDNyo6pToJS0xS7tbpQcFhG+DYJfQ5PQMC3fpqOJFl 8dO0+qL8J+jUEUSa5403U1vVYYFsPx98klgVcUfeXcF+EOMsEZzQwcor4iKOzRresAlB NA2myTJ/+//uId0xGJEAOLIoDfiP95IYHKGchxyN75TqCd20JMPoLJsSgXKueQgGrq6f lmemkPy7rcHXxWHgBuTXeJ4ED/HMR9bH4UH7ByW3fGGN2mg0Pb0RI2FBRrp9IgZFrmB2 sDBg== X-Gm-Message-State: AJcUukcdL+3FfQ5ccBEQlz/OvXuYFQp5EVerMV85Zd5kO6pjqVTmsc+D BEKu0GW9vVcDqrLi0UaqO7rtAWAW X-Received: by 2002:a63:cc12:: with SMTP id x18mr1430990pgf.33.1546952238457; Tue, 08 Jan 2019 04:57:18 -0800 (PST) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.71.59? ([2402:f000:1:1501:200:5efe:a66f:473b]) by smtp.gmail.com with ESMTPSA id w88sm121006670pfk.11.2019.01.08.04.57.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 04:57:17 -0800 (PST) Subject: Re: [PATCH] net: nvidia: forcedeth: Fix two possible concurrency use-after-free bugs To: Zhu Yanjun , davem@davemloft.net, keescook@chromium.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190108124518.21986-1-baijiaju1990@gmail.com> <27392ae0-2c0f-f099-05d8-f9cdbfbd313e@oracle.com> From: Jia-Ju Bai Message-ID: Date: Tue, 8 Jan 2019 20:57:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <27392ae0-2c0f-f099-05d8-f9cdbfbd313e@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/1/8 20:54, Zhu Yanjun wrote: > > 在 2019/1/8 20:45, Jia-Ju Bai 写道: >> 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. >> >> To fix these possible bugs, > > > Does this really occur? Can you reproduce this ? This bug is not found by the real execution. It is found by a static tool written by myself, and then I check it by manual code review. Best wishes, Jia-Ju Bai