Patch "sfc: Don't invoke xdp_do_flush() from netpoll." has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sfc: Don't invoke xdp_do_flush() from netpoll.

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sfc-don-t-invoke-xdp_do_flush-from-netpoll.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 74d5045a9a5497d20116195a9a54f9da6fd4d982
Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Date:   Wed Oct 2 14:58:37 2024 +0200

    sfc: Don't invoke xdp_do_flush() from netpoll.
    
    [ Upstream commit 55e802468e1d38dec8e25a2fdb6078d45b647e8c ]
    
    Yury reported a crash in the sfc driver originated from
    netpoll_send_udp(). The netconsole sends a message and then netpoll
    invokes the driver's NAPI function with a budget of zero. It is
    dedicated to allow driver to free TX resources, that it may have used
    while sending the packet.
    
    In the netpoll case the driver invokes xdp_do_flush() unconditionally,
    leading to crash because bpf_net_context was never assigned.
    
    Invoke xdp_do_flush() only if budget is not zero.
    
    Fixes: 401cb7dae8130 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.")
    Reported-by: Yury Vostrikov <mon@xxxxxxxxxxx>
    Closes: https://lore.kernel.org/5627f6d1-5491-4462-9d75-bc0612c26a22@xxxxxxxxxxxxxxxx
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Reviewed-by: Edward Cree <ecree.xilinx@xxxxxxxxx>
    Link: https://patch.msgid.link/20241002125837.utOcRo6Y@xxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c
index c9e17a8208a90..f1723a6fb082b 100644
--- a/drivers/net/ethernet/sfc/efx_channels.c
+++ b/drivers/net/ethernet/sfc/efx_channels.c
@@ -1260,7 +1260,8 @@ static int efx_poll(struct napi_struct *napi, int budget)
 
 	spent = efx_process_channel(channel, budget);
 
-	xdp_do_flush();
+	if (budget)
+		xdp_do_flush();
 
 	if (spent < budget) {
 		if (efx_channel_has_rx_queue(channel) &&
diff --git a/drivers/net/ethernet/sfc/siena/efx_channels.c b/drivers/net/ethernet/sfc/siena/efx_channels.c
index a7346e965bfe7..d120b3c83ac07 100644
--- a/drivers/net/ethernet/sfc/siena/efx_channels.c
+++ b/drivers/net/ethernet/sfc/siena/efx_channels.c
@@ -1285,7 +1285,8 @@ static int efx_poll(struct napi_struct *napi, int budget)
 
 	spent = efx_process_channel(channel, budget);
 
-	xdp_do_flush();
+	if (budget)
+		xdp_do_flush();
 
 	if (spent < budget) {
 		if (efx_channel_has_rx_queue(channel) &&




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux