[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251017-fix-fix-me-v1-1-8c509d7122ed@yahoo.com>
Date: Fri, 17 Oct 2025 14:30:45 +0100
From: Sunday Adelodun <adelodunolaoluwa@...oo.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org, Sunday Adelodun <adelodunolaoluwa@...oo.com>
Subject: [PATCH] net: unix: clarify BSD behavior comment in
unix_release_sock()
The long-standing comment in unix_release_sock() mentioned a "FIXME" about
BSD sending ECONNRESET to connected sockets upon closure, while Linux waits
for the last reference. This behavior has existed since early UNIX socket
implementations and is intentional.
Update the comment to clarify that this is a deliberate design difference,
not a pending fix, and remove the outdated FIXME marker.
Signed-off-by: Sunday Adelodun <adelodunolaoluwa@...oo.com>
---
net/unix/af_unix.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 768098dec231..c21230a69f42 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -734,14 +734,13 @@ static void unix_release_sock(struct sock *sk, int embrion)
/* ---- Socket is dead now and most probably destroyed ---- */
/*
- * Fixme: BSD difference: In BSD all sockets connected to us get
- * ECONNRESET and we die on the spot. In Linux we behave
- * like files and pipes do and wait for the last
- * dereference.
+ * Note: BSD sends ECONNREST to all sockets connected to a closing peer
+ * and terminates immediately. Linux, however, intentionally behaves more
+ * like pipes - waiting for the final dereference before destruction.
*
- * Can't we simply set sock->err?
- *
- * What the above comment does talk about? --ANK(980817)
+ * This behaviour is by design and aligns with Linux's file semantics.
+ * Historical note: this difference from BSD has been present since the
+ * early UNIX socket implementation and is not considered a bug.
*/
if (READ_ONCE(unix_tot_inflight))
---
base-commit: 7ea30958b3054f5e488fa0b33c352723f7ab3a2a
change-id: 20251017-fix-fix-me-59b369ffcfb5
Best regards,
--
Sunday Adelodun <adelodunolaoluwa@...oo.com>
Powered by blists - more mailing lists