From: David Miller <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
Date: Fri, 11 Jan 2019 17:53:03 -0800 (PST) [thread overview]
Message-ID: <20190111.175303.1528012358618102203.davem@davemloft.net> (raw)
In-Reply-To: <20190108124518.21986-1-baijiaju1990@gmail.com>
From: Jia-Ju Bai <baijiaju1990@gmail.com>
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.
prev parent reply other threads:[~2019-01-12 1:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 12:45 Jia-Ju Bai
2019-01-08 12:54 ` Zhu Yanjun
2019-01-08 12:57 ` Jia-Ju Bai
2019-01-09 1:24 ` Yanjun Zhu
2019-01-09 2:03 ` Jia-Ju Bai
2019-01-09 2:35 ` Yanjun Zhu
2019-01-09 3:20 ` Jia-Ju Bai
2019-01-09 3:24 ` Yanjun Zhu
2019-01-09 3:25 ` Jia-Ju Bai
2019-01-12 1:53 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190111.175303.1528012358618102203.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=baijiaju1990@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yanjun.zhu@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®