Linux s390 Architecture development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Artem Lytkin" <iprintercanon@gmail.com>
Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH net-next v2 2/2] net: bridge: fail link info that does not fit the IFLA_AF_SPEC nest
Date: Sun, 13 Sep 2026 13:50:47 +0000	[thread overview]
Message-ID: <20260913135048.4529C1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260912135022.1701-3-iprintercanon@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] br_info_notify() propagates -E2BIG to rtnl_set_sk_err(), bypassing NETLINK_NO_ENOBUFS and breaking listeners.
--

commit 9b1aaa64ff49b7a437b098d6d662cc77e1219f4b
Author: Artem Lytkin <iprintercanon@gmail.com>

net: bridge: fail link info that does not fit the IFLA_AF_SPEC nest

br_fill_ifinfo() puts all of a port's VLAN, tunnel and MST entries into
one nest, and nla_len is a u16, so a large enough port produces a nest
whose length wraps and userspace reads garbage.

Cancel the message and return -E2BIG with an extack pointing at
RTM_GETVLAN instead. The dump retries the port with an empty skb and
the error goes to userspace; notifications reach rtnl_set_sk_err() and
listeners resync. Not -EMSGSIZE, since no bigger buffer would help.

> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index 855a46aec3a89..53676df9e4d11 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
[ ... ]
> @@ -654,7 +660,8 @@ void br_info_notify(int event, const struct net_bridge *br,
>  	if (skb == NULL)
>  		goto errout;
>  
> -	err = br_fill_ifinfo(skb, port, 0, 0, event, 0, filter, dev, false);
> +	err = br_fill_ifinfo(skb, port, 0, 0, event, 0, filter, dev, false,
> +			     NULL);
>  	if (err < 0) {
>  		/* -EMSGSIZE implies BUG in br_nlmsg_size() */
>  		WARN_ON(err == -EMSGSIZE);

[Severity: High]
The commit message states "notifications reach rtnl_set_sk_err() and
listeners resync." Could this approach introduce a regression where -E2BIG
is broadcasted to netlink listeners instead of being filtered?

When br_fill_ifinfo() returns -E2BIG due to adding many VLANs to a bridge
port, br_info_notify() will jump to the errout label and pass the error to
rtnl_set_sk_err():

errout:
	rtnl_set_sk_err(net, RTNLGRP_LINK, err);

Passing -E2BIG here bypasses the NETLINK_NO_ENOBUFS socket option which
only filters ENOBUFS. Will this unhandled E2BIG error cause network
management daemons to crash or drop connections?

Might this lead to a system-wide denial of service if unprivileged users
trigger this path?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260912135022.1701-1-iprintercanon@gmail.com?part=2

      reply	other threads:[~2026-09-13 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 13:50 [PATCH net-next v2 0/2] bridge: report an oversized IFLA_AF_SPEC nest instead of truncating Artem Lytkin
2026-09-12 13:50 ` [PATCH net-next v2 1/2] rtnetlink: pass extack to ndo_bridge_getlink() Artem Lytkin
2026-09-13 13:50   ` sashiko-bot
2026-09-12 13:50 ` [PATCH net-next v2 2/2] net: bridge: fail link info that does not fit the IFLA_AF_SPEC nest Artem Lytkin
2026-09-13 13:50   ` sashiko-bot [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=20260913135048.4529C1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iprintercanon@gmail.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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