FAILED: patch "[PATCH] rxrpc: Fix irq-disabled in local_bh_enable()" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x e4d2878369d590bf8455e3678a644e503172eafa
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026073004-doodle-trickery-d104@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e4d2878369d590bf8455e3678a644e503172eafa Mon Sep 17 00:00:00 2001
From: David Howells <[email protected]>
Date: Thu, 17 Jul 2025 08:43:41 +0100
Subject: [PATCH] rxrpc: Fix irq-disabled in local_bh_enable()
The rxrpc_assess_MTU_size() function calls down into the IP layer to find out the MTU size for a route. When accepting an incoming call, this is called from rxrpc_new_incoming_call() which holds interrupts disabled across the code that calls down to it. Unfortunately, the IP layer uses local_bh_enable() which, config dependent, throws a warning if IRQs are enabled:
WARNING: CPU: 1 PID: 5544 at kernel/softirq.c:387 __local_bh_enable_ip+0x43/0xd0 ... RIP: 0010:__local_bh_enable_ip+0x43/0xd0 ... Call Trace: <TASK> rt_cache_route+0x7e/0xa0 rt_set_nexthop.isra.0+0x3b3/0x3f0 __mkroute_output+0x43a/0x460 ip_route_output_key_hash+0xf7/0x140 ip_route_output_flow+0x1b/0x90 rxrpc_assess_MTU_size.isra.0+0x2a0/0x590 rxrpc_new_incoming_peer+0x46/0x120 rxrpc_alloc_incoming_call+0x1b1/0x400 rxrpc_new_incoming_call+0x1da/0x5e0 rxrpc_input_packet+0x827/0x900 rxrpc_io_thread+0x403/0xb60 kthread+0x2f7/0x310 ret_from_fork+0x2a/0x230 ret_from_fork_asm+0x1a/0x30 ... hardirqs last enabled at (23): _raw_spin_unlock_irq+0x24/0x50 hardirqs last disabled at (24): _raw_read_lock_irq+0x17/0x70 softirqs last enabled at (0): copy_process+0xc61/0x2730 softirqs last disabled at (25): rt_add_uncached_list+0x3c/0x90
Fix this by moving the call to rxrpc_assess_MTU_size() out of rxrpc_init_peer() and further up the stack where it can be done without interrupts disabled.
It shouldn't be a problem for rxrpc_new_incoming_call() to do it after the locks are dropped as pmtud is going to be performed by the I/O thread - and we're in the I/O thread at this point.
net/rxrpc/ar-internal.h +1 -0
@@ -1383,6 +1383,7 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *, const struct sockaddr_rxrpc *);struct rxrpc_peer *rxrpc_lookup_peer (struct rxrpc_local *local,struct sockaddr_rxrpc *srx,gfp_t gfp); +void rxrpc_assess_MTU_size (struct rxrpc_local *local,struct rxrpc_peer *peer);struct rxrpc_peer *rxrpc_alloc_peer (struct rxrpc_local *,gfp_t ,enum rxrpc_peer_trace );void rxrpc_new_incoming_peer (struct rxrpc_local *local,struct rxrpc_peer *peer);
net/rxrpc/call_accept.c +1 -0
@@ -406,6 +406,7 @@ bool rxrpc_new_incoming_call(struct rxrpc_local *local,spin_unlock (&rx->incoming_lock);read_unlock_irq (&local->services_lock); +rxrpc_assess_MTU_size (local, call->peer);if (hlist_unhashed (&call->error_link)) {spin_lock_irq (&call->peer->lock);
net/rxrpc/peer_object.c +2 -4
@@ -149,8 +149,7 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *local,* assess the MTU size for the network interface through which this peer is * reached */ -static void rxrpc_assess_MTU_size (struct rxrpc_local *local, -struct rxrpc_peer *peer) +void rxrpc_assess_MTU_size (struct rxrpc_local *local,struct rxrpc_peer *peer) {struct net *net = local->net;struct dst_entry *dst;
@@ -277,8 +276,6 @@ static void rxrpc_init_peer(struct rxrpc_local *local, struct rxrpc_peer *peer, peer->hdrsize +=sizeof (struct rxrpc_wire_header ); peer->max_data = peer->if_mtu - peer->hdrsize; - -rxrpc_assess_MTU_size (local, peer); }/*
@@ -297,6 +294,7 @@ static struct rxrpc_peer *rxrpc_create_peer(struct rxrpc_local *local,if (peer) {memcpy (&peer->srx, srx,sizeof (*srx));rxrpc_init_peer (local, peer, hash_key); +rxrpc_assess_MTU_size (local, peer); }_leave (" = %p" , peer);
Sasha Levin
maintainerPATCH 1/1 rxrpc: Fix irq-disabled in local_bh_enable()
From: David Howells <[email protected]>
[ Upstream commit e4d2878369d590bf8455e3678a644e503172eafa ]
The rxrpc_assess_MTU_size() function calls down into the IP layer to find out the MTU size for a route. When accepting an incoming call, this is called from rxrpc_new_incoming_call() which holds interrupts disabled across the code that calls down to it. Unfortunately, the IP layer uses local_bh_enable() which, config dependent, throws a warning if IRQs are enabled:
WARNING: CPU: 1 PID: 5544 at kernel/softirq.c:387 __local_bh_enable_ip+0x43/0xd0 ... RIP: 0010:__local_bh_enable_ip+0x43/0xd0 ... Call Trace: <TASK> rt_cache_route+0x7e/0xa0 rt_set_nexthop.isra.0+0x3b3/0x3f0 __mkroute_output+0x43a/0x460 ip_route_output_key_hash+0xf7/0x140 ip_route_output_flow+0x1b/0x90 rxrpc_assess_MTU_size.isra.0+0x2a0/0x590 rxrpc_new_incoming_peer+0x46/0x120 rxrpc_alloc_incoming_call+0x1b1/0x400 rxrpc_new_incoming_call+0x1da/0x5e0 rxrpc_input_packet+0x827/0x900 rxrpc_io_thread+0x403/0xb60 kthread+0x2f7/0x310 ret_from_fork+0x2a/0x230 ret_from_fork_asm+0x1a/0x30 ... hardirqs last enabled at (23): _raw_spin_unlock_irq+0x24/0x50 hardirqs last disabled at (24): _raw_read_lock_irq+0x17/0x70 softirqs last enabled at (0): copy_process+0xc61/0x2730 softirqs last disabled at (25): rt_add_uncached_list+0x3c/0x90
Fix this by moving the call to rxrpc_assess_MTU_size() out of rxrpc_init_peer() and further up the stack where it can be done without interrupts disabled.
It shouldn't be a problem for rxrpc_new_incoming_call() to do it after the locks are dropped as pmtud is going to be performed by the I/O thread - and we're in the I/O thread at this point.
--- net/rxrpc/ar-internal.h | 1 + net/rxrpc/call_accept.c | 1 + net/rxrpc/peer_object.c | 12 +++++++----- 3 files changed, 9 insertions(+), 5 deletions(-)
net/rxrpc/ar-internal.h +1 -0
@@ -1188,6 +1188,7 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *, const struct sockaddr_rxrpc *);struct rxrpc_peer *rxrpc_lookup_peer (struct rxrpc_local *local,struct sockaddr_rxrpc *srx,gfp_t gfp); +void rxrpc_assess_MTU_size (struct rxrpc_local *local,struct rxrpc_peer *peer);struct rxrpc_peer *rxrpc_alloc_peer (struct rxrpc_local *,gfp_t ,enum rxrpc_peer_trace );void rxrpc_new_incoming_peer (struct rxrpc_local *local,struct rxrpc_peer *peer);
net/rxrpc/call_accept.c +1 -0
@@ -407,6 +407,7 @@ bool rxrpc_new_incoming_call(struct rxrpc_local *local,spin_unlock (&rx->incoming_lock);read_unlock_irq (&local->services_lock); +rxrpc_assess_MTU_size (local, call->peer);if (hlist_unhashed (&call->error_link)) {spin_lock_irq (&call->peer->lock);
net/rxrpc/peer_object.c +7 -5
@@ -147,8 +147,7 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *local,* assess the MTU size for the network interface through which this peer is * reached */ -static void rxrpc_assess_MTU_size (struct rxrpc_local *local, -struct rxrpc_peer *peer) +void rxrpc_assess_MTU_size (struct rxrpc_local *local,struct rxrpc_peer *peer) {struct net *net = local->net;struct dst_entry *dst;
@@ -160,6 +159,8 @@ static void rxrpc_assess_MTU_size(struct rxrpc_local *local,#endif peer->if_mtu =1500 ; + peer->mtu = peer->if_mtu; + peer->maxdata = peer->mtu - peer->hdrsize;memset (&fl,0 ,sizeof (fl));switch (peer->srx.transport.family) {
@@ -199,6 +200,9 @@ static void rxrpc_assess_MTU_size(struct rxrpc_local *local, peer->if_mtu =dst_mtu (dst);dst_release (dst); + peer->mtu = peer->if_mtu; + peer->maxdata = peer->mtu - peer->hdrsize; +_leave (" [if_mtu %u]" , peer->if_mtu); }
@@ -240,8 +244,6 @@ static void rxrpc_init_peer(struct rxrpc_local *local, struct rxrpc_peer *peer, unsigned long hash_key) { peer->hash_key = hash_key; -rxrpc_assess_MTU_size (local, peer); - peer->mtu = peer->if_mtu; peer->rtt_last_req =ktime_get_real ();switch (peer->srx.transport.family) {
@@ -266,7 +268,6 @@ static void rxrpc_init_peer(struct rxrpc_local *local, struct rxrpc_peer *peer, } peer->hdrsize +=sizeof (struct rxrpc_wire_header ); - peer->maxdata = peer->mtu - peer->hdrsize; }/*
@@ -285,6 +286,7 @@ static struct rxrpc_peer *rxrpc_create_peer(struct rxrpc_local *local,if (peer) {memcpy (&peer->srx, srx,sizeof (*srx));rxrpc_init_peer (local, peer, hash_key); +rxrpc_assess_MTU_size (local, peer); }_leave (" = %p" , peer);
Signature · 1 line
2.53.0