patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>,
	'Yunjian Wang' <wangyunjian@huawei.com>,
	dev@dpdk.org
Cc: jianwang@trustnetic.com, luyicai@huawei.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/1] net/txgbe: fix use-after-free on remove
Date: Thu, 18 May 2023 18:49:59 +0100	[thread overview]
Message-ID: <24d99809-aec2-8192-8c7e-985af35f8b34@amd.com> (raw)
In-Reply-To: <01e501d9895c$e242de90$a6c89bb0$@trustnetic.com>

On 5/18/2023 8:46 AM, Jiawen Wu wrote:
>> When cleaning up NIC's interrupts, it is possible to add some alarms
>> at the same time. However, if these alarms are not canceled, it may
>> cause use-after-free problems. Therefore, after cleaning up NIC's
>> interrupts, these alarms should also be canceled.
>>
>> Fixes: d3bb4a04eac1 ("net/txgbe: add SFP hotplug identification")
>> Fixes: e0d876ef6bbc ("net/txgbe: support device stop and close")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Pengfei Sun <sunpengfei16@huawei.com>
>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>> ---
>>  drivers/net/txgbe/txgbe_ethdev.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
>> index a502618bc5..a3d7461951 100644
>> --- a/drivers/net/txgbe/txgbe_ethdev.c
>> +++ b/drivers/net/txgbe/txgbe_ethdev.c
>> @@ -2032,8 +2032,10 @@ txgbe_dev_close(struct rte_eth_dev *dev)
>>  		rte_delay_ms(100);
>>  	} while (retries++ < (10 + TXGBE_LINK_UP_TIME));
>>
>> -	/* cancel the delay handler before remove dev */
>> +	/* cancel all alarm handler before remove dev */
>>  	rte_eal_alarm_cancel(txgbe_dev_interrupt_delayed_handler, dev);
>> +	rte_eal_alarm_cancel(txgbe_dev_detect_sfp, dev);
>> +	rte_eal_alarm_cancel(txgbe_dev_setup_link_alarm_handler, dev);
>>
>>  	/* uninitialize PF if max_vfs not zero */
>>  	txgbe_pf_host_uninit(dev);
>> --
>> 2.33.0
>>
>>
> 
> Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com>
> 
> 

Applied to dpdk-next-net/main, thanks.

      reply	other threads:[~2023-05-18 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  7:11 Yunjian Wang
2023-05-18  7:46 ` Jiawen Wu
2023-05-18 17:49   ` Ferruh Yigit [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=24d99809-aec2-8192-8c7e-985af35f8b34@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=dev@dpdk.org \
    --cc=jianwang@trustnetic.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=luyicai@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.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;
as well as URLs for NNTP newsgroup(s).