Netdev List
 help / color / mirror / Atom feed
* [PATCH] xprtsock: Fix a loop in xs_tcp_setup_socket()
@ 2024-04-20 10:48 Lex Siegel
  2024-04-20 11:06 ` Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lex Siegel @ 2024-04-20 10:48 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton, Neil Brown, Olga Kornievskaia, Dai Ngo,
	Tom Talpey, Trond Myklebust, Anna Schumaker, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-nfs, netdev,
	linux-kernel, bpf

When using a bpf on kernel_connect(), the call can return -EPERM.
This causes xs_tcp_setup_socket() to loop forever, filling up the
syslog and causing the kernel to freeze up.

Signed-off-by: Lex Siegel <usiegl00@gmail.com>
---
 net/sunrpc/xprtsock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index bb9b747d58a1..47b254806a08 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2446,6 +2446,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
 		/* Happens, for instance, if the user specified a link
 		 * local IPv6 address without a scope-id.
 		 */
+	case -EPERM:
+		/* Happens, for instance, if a bpf is preventing the connect */
 	case -ECONNREFUSED:
 	case -ECONNRESET:
 	case -ENETDOWN:
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-22  3:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-20 10:48 [PATCH] xprtsock: Fix a loop in xs_tcp_setup_socket() Lex Siegel
2024-04-20 11:06 ` Jeff Layton
2024-04-21 22:32 ` Trond Myklebust
2024-04-21 23:22 ` NeilBrown
2024-04-22  3:32   ` Lex Siegel
2024-04-22  3:44     ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox