Thread (3 messages) flat view 3 messages, 2 authors, 10d ago

Re: [PATCH net v8 1/1] llc: fix listener child socket leaks before passive open completes

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-09-11 23:27:23
Also in: lkml, stable

On Mon,  7 Sep 2026 03:47:51 +0000 Zihan Xi wrote:
+			if (atomic_read(&llc_sk(newsk)->incoming_state) ==
+			    LLC_INCOMING_PENDING)
+				llc_release_incoming_sock(newsk);
+			if (newsk != sk) {
+				bh_unlock_sock(newsk);
+				local_bh_enable();
+			}
+		} else if (newsk &&
+			   atomic_read(&llc_sk(newsk)->incoming_state) ==
+			   LLC_INCOMING_QUEUED) {
+			if (newsk != sk) {
+				local_bh_disable();
+				bh_lock_sock_nested(newsk);
+			}
+			if (llc_sk(newsk)->state < LLC_CONN_STATE_ADM) {
+				if (newsk != sk) {
+					bh_unlock_sock(newsk);
+					local_bh_enable();
+				}
+				goto out_kfree_skb;
+			}
+			rc = llc_conn_rcv(newsk, skb);
+			if (newsk != sk) {
+				bh_unlock_sock(newsk);
+				local_bh_enable();
+			}
+		} else if (newsk && newsk != sk) {
+			if (llc_sk(newsk)->state < LLC_CONN_STATE_ADM)
+				goto out_kfree_skb;
+			local_bh_disable();
+			bh_lock_sock_nested(newsk);
+			if (llc_sk(newsk)->state < LLC_CONN_STATE_ADM) {
+				bh_unlock_sock(newsk);
+				local_bh_enable();
+				goto out_kfree_skb;
+			}
+			rc = llc_conn_rcv(newsk, skb);
+			bh_unlock_sock(newsk);
+			local_bh_enable();
+		} else if (likely(llc->state > 1)) {
+			rc = llc_conn_rcv(sk, skb);
This looks pretty terrible and incomprehensible.
Clashiko has some comments but it runs out token budget trying to make
sense of your code:
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/abc8b115321dbd417b8491d9e51f1988998ff50e.1788707641.git.zihanx@nebusec.ai
Which again, strongly suggests poor code quality.

Please do better, or maybe post a patch to delete the LLC sockets?
There was a person mentioning using them in recent git history
but I emailed them a while back and have not heard back.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help