mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Zihan Xi <zihanx@nebusec.ai>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Kees Cook <kees@kernel.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Vega <vega@nebusec.ai>
Subject: Re: [PATCH net v8 1/1] llc: fix listener child socket leaks before passive open completes
Date: Fri, 11 Sep 2026 16:27:22 -0700	[thread overview]
Message-ID: <20260911162722.6d6a40e7@kernel.org> (raw)
In-Reply-To: <abc8b115321dbd417b8491d9e51f1988998ff50e.1788707641.git.zihanx@nebusec.ai>

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.

      reply	other threads:[~2026-09-11 23:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  3:47 [PATCH net v8 0/1] " Zihan Xi
2026-09-07  3:47 ` [PATCH net v8 1/1] " Zihan Xi
2026-09-11 23:27   ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260911162722.6d6a40e7@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=vega@nebusec.ai \
    --cc=zihanx@nebusec.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®