All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ernestas Kulik <ernestas.k@iconn-networks.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] llc: Return -EINPROGRESS from llc_ui_connect()
Date: Mon, 20 Apr 2026 11:41:38 -0700	[thread overview]
Message-ID: <20260420114138.1aa52551@kernel.org> (raw)
In-Reply-To: <20260415063457.1008868-1-ernestas.k@iconn-networks.com>

On Wed, 15 Apr 2026 09:34:57 +0300 Ernestas Kulik wrote:
> Given a zero sk_sndtimeo, llc_ui_connect() skips waiting for state
> change and returns 0, confusing userspace applications that will assume
> the socket is connected, making e.g. getpeername() calls error out.
> 
> Set rc to -EINPROGRESS before considering blocking, akin to AF_INET
> sockets.

Please add a note on how you discovered this issue.
Including whether you're actively using this code or just scanning it
for bugs.

> diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
> index 59d593bb5d18..9317d092ba84 100644
> --- a/net/llc/af_llc.c
> +++ b/net/llc/af_llc.c
> @@ -515,10 +515,12 @@ static int llc_ui_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
>  		sock->state  = SS_UNCONNECTED;
>  		sk->sk_state = TCP_CLOSE;
>  		goto out;
>  	}
>  
> +	rc = -EINPROGRESS;

Isn't this a bit of an odd placement? ..

>  	if (sk->sk_state == TCP_SYN_SENT) {
>  		const long timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
>  
>  		if (!timeo || !llc_ui_wait_for_conn(sk, timeo))
>  			goto out;

.. I suspect you mean to target this branch, right?

  reply	other threads:[~2026-04-20 18:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15  6:34 [PATCH] llc: Return -EINPROGRESS from llc_ui_connect() Ernestas Kulik
2026-04-20 18:41 ` Jakub Kicinski [this message]
2026-04-21  5:48   ` Ernestas Kulik
2026-04-21  5:54 ` [PATCH v2] " Ernestas Kulik
2026-04-21  6:02 ` [PATCH v3] " Ernestas Kulik
2026-04-23 17:26   ` Simon Horman
2026-04-23 18:50   ` patchwork-bot+netdevbpf

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=20260420114138.1aa52551@kernel.org \
    --to=kuba@kernel.org \
    --cc=ernestas.k@iconn-networks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.