From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: netdev@vger.kernel.org
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
Thomas Gleixner <tglx@kernel.org>,
Joel Granados <joel.granados@kernel.org>,
Fernando Fernandez Mancera <fmancera@suse.de>,
Petr Pavlu <petr.pavlu@suse.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
Maoyi Xie <maoyi.xie@ntu.edu.sg>, Oleg Nesterov <oleg@redhat.com>,
Zhan Xusheng <zhanxusheng1024@gmail.com>,
Gerd Rausch <gerd.rausch@oracle.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>,
Wyatt Feng <bronzed_45_vested@icloud.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Flavio Leitner <fbl@redhat.com>, Petr Mladek <pmladek@suse.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net v3 0/5] net: fix misc signed overflows caused by bad sysctl values
Date: Sun, 1 Nov 2026 14:11:58 +0800 [thread overview]
Message-ID: <20261101061331.286404-1-jiayuan.chen@linux.dev> (raw)
Recently I have reviewed quite a few fixes for variable overflows caused
by config values, i.e. a value set from sysctl, module params or netlink
that is accepted as valid but later overflows when it is used in a
calculation. I believe there are more of these still out there, so I
used an LLM to dig through the code and it found the issues fixed in
this series.
All of them have been reproduced and verified in QEMU.
v3:
- gc_elasticity: make the max bound an unsigned int, matching how
proc_dou8vec_minmax() reads extra2 (Kuniyuki)
- message_cost: kernel-doc "Return:" section (Jakub)
- picked up Fernando's Reviewed-by on redirect and message_cost
v2: https://lore.kernel.org/netdev/20261027104701.296240-1-jiayuan.chen@linux.dev/
v2:
- gc_elasticity, mld_qrv, igmp_qrv: store the sysctl as u8 and use
proc_dou8vec_minmax(), as suggested by Kuniyuki
- docs: add the missing "Maximum: 255" to the mld_qrv and igmp_qrv
entries in ip-sysctl.rst
- message_cost: add proc_dointvec_jiffies_minmax() instead of a local
handler, as Joel suggested
- redirect_load: reject negative values as well
- kept Fernando's Reviewed-by on gc_elasticity, mld_qrv and igmp_qrv:
v2 narrows the storage type to u8, the fix itself is the same
v1: https://lore.kernel.org/netdev/20261023091419.167088-1-jiayuan.chen@linux.dev/
Jiayuan Chen (5):
ipv6: restrict gc_elasticity to 31
ipv4: fix shift-out-of-bounds in ip_rt_send_redirect()
ipv6: restrict mld_qrv to 255
ipv4: restrict igmp_qrv to 255
net: restrict message_cost and message_burst to non-negative values
Documentation/networking/ip-sysctl.rst | 4 ++
.../net_cachelines/netns_ipv4_sysctl.rst | 2 +-
include/linux/jiffies.h | 2 +
include/net/ipv6.h | 2 +-
include/net/netns/ipv4.h | 2 +-
include/net/netns/ipv6.h | 2 +-
kernel/time/jiffies.c | 40 +++++++++++++++++++
net/core/sysctl_net_core.c | 6 ++-
net/ipv4/route.c | 10 +++--
net/ipv4/sysctl_net_ipv4.c | 4 +-
net/ipv6/mcast.c | 2 +-
net/ipv6/route.c | 7 +++-
net/ipv6/sysctl_net_ipv6.c | 4 +-
13 files changed, 70 insertions(+), 17 deletions(-)
--
2.43.0
next reply other threads:[~2026-11-01 6:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 6:11 Jiayuan Chen [this message]
2026-11-01 6:11 ` [PATCH net v3 1/5] ipv6: restrict gc_elasticity to 31 Jiayuan Chen
2026-11-02 1:25 ` Hangbin Liu
2026-11-01 6:12 ` [PATCH net v3 2/5] ipv4: fix shift-out-of-bounds in ip_rt_send_redirect() Jiayuan Chen
2026-11-01 6:12 ` [PATCH net v3 3/5] ipv6: restrict mld_qrv to 255 Jiayuan Chen
2026-11-01 10:23 ` Nikolay Aleksandrov
2026-11-02 1:31 ` Hangbin Liu
2026-11-01 6:12 ` [PATCH net v3 4/5] ipv4: restrict igmp_qrv " Jiayuan Chen
2026-11-02 1:29 ` Hangbin Liu
2026-11-01 6:12 ` [PATCH net v3 5/5] net: restrict message_cost and message_burst to non-negative values Jiayuan Chen
2026-11-02 1:55 ` Hangbin Liu
2026-11-02 2:23 ` Jiayuan Chen
2026-11-02 3:32 ` Hangbin Liu
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=20261101061331.286404-1-jiayuan.chen@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=bronzed_45_vested@icloud.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=fbl@redhat.com \
--cc=fmancera@suse.de \
--cc=gerd.rausch@oracle.com \
--cc=hannes@stressinduktion.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=joel.granados@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maoyi.xie@ntu.edu.sg \
--cc=netdev@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=pabeni@redhat.com \
--cc=paulmck@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=pmladek@suse.com \
--cc=razor@blackwall.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=willemb@google.com \
--cc=zhanxusheng1024@gmail.com \
/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.