Re: [PATCH net v8 1/1] llc: fix listener child socket leaks before passive open completes
From: Jakub Kicinski
Date: Fri Sep 11 2026 - 19:34:10 EST
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@xxxxxxxxxx
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.