From: Thomas Graf <tgraf@suug.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
"David S. Miller" <davem@davemloft.net>,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] bridge: make buffer larger in br_setlink()
Date: Fri, 7 Dec 2012 09:31:07 +0000 [thread overview]
Message-ID: <20121207093107.GA2996@casper.infradead.org> (raw)
In-Reply-To: <20121207061854.GB18220@elgon.mountain>
On 12/07/12 at 09:18am, Dan Carpenter wrote:
> __IFLA_BRPORT_MAX is one larger than IFLA_BRPORT_MAX. We pass
> IFLA_BRPORT_MAX to nla_parse_nested() so we need IFLA_BRPORT_MAX + 1
> elements. Also Smatch complains that we read past the end of the array
> when in br_set_port_flag() when it's called with IFLA_BRPORT_FAST_LEAVE.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Only needed in linux-next.
>
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index 850b7d1..cfc5cfe 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -239,7 +239,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh)
> struct ifinfomsg *ifm;
> struct nlattr *protinfo;
> struct net_bridge_port *p;
> - struct nlattr *tb[IFLA_BRPORT_MAX];
> + struct nlattr *tb[__IFLA_BRPORT_MAX];
> int err;
>
> ifm = nlmsg_data(nlh);
I know it's nitpicking but could you use IFLA_BRPORT_MAX+1 for
consistency?
next prev parent reply other threads:[~2012-12-07 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 6:18 [patch] bridge: make buffer larger in br_setlink() Dan Carpenter
2012-12-07 9:31 ` Thomas Graf [this message]
2012-12-07 11:10 ` [patch v2] " Dan Carpenter
2012-12-07 16:07 ` walter harms
2012-12-07 18:53 ` Dan Carpenter
2012-12-07 19:15 ` walter harms
2012-12-07 17:08 ` Stephen Hemminger
2012-12-07 19:40 ` David Miller
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=20121207093107.GA2996@casper.infradead.org \
--to=tgraf@suug.ch \
--cc=bridge@lists.linux-foundation.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).