All of lore.kernel.org
 help / color / mirror / Atom feed
From: kuniyu@google.com
To: Yingjie Wang <1075151112@qq.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	corbet@lwn.net,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-api@vger.kernel.org,
	stable@vger.kernel.org, skhan@linuxfoundation.org,
	 rdunlap@infradead.org
Subject: Re: [PATCH net v3] net: unix: reject negative max_dgram_qlen values
Date: Sat, 17 Oct 2026 05:04:08 +0000	[thread overview]
Message-ID: <atMBc9DNAnFhsR9V@google.com> (raw)
In-Reply-To: <tencent_A643419B56079E9A448D97922763FF069F08@qq.com>

On Fri, 16 Oct 2026 11:02:58 +0800, Yingjie Wang wrote:
> net.unix.max_dgram_qlen is parsed as a signed int and copied to the u32
> sock::sk_max_ack_backlog when an AF_UNIX socket is created.  Consequently,
> a negative value such as -1 is accepted and converted to UINT_MAX.  Since
> the receive queue length is also u32, its fullness check cannot become true
> for that limit.
> 
> max_dgram_qlen has no documented negative sentinel.  Its existing signed
> interface represents nonnegative values only through INT_MAX; negative bit
> patterns are not a supported encoding for the upper half of the u32
> consumer range.
> 
> Switch to proc_dointvec_minmax and make the established 0..INT_MAX input
> range explicit.  This rejects negative values without adding new accepted
> values or changing the default and zero-value behavior.  Very large valid
> values can still make the queue limit impractical to reach; this change
> corrects the input domain rather than imposing a new resource ceiling.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:gpt-5
> Signed-off-by: Yingjie Wang <1075151112@qq.com>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

      parent reply	other threads:[~2026-10-17  5:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  3:02 [PATCH net v3] net: unix: reject negative max_dgram_qlen values Yingjie Wang
2026-10-16  3:08 ` netdev-bot+sinfo
2026-10-17  5:04 ` kuniyu [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=atMBc9DNAnFhsR9V@google.com \
    --to=kuniyu@google.com \
    --cc=1075151112@qq.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=stable@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.