[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE4R7bDnQtgxyyP-Pfy3UVb-dJ0k+yYmpfuMKF6jEUNk=PC4NQ@mail.gmail.com>
Date: Thu, 27 Nov 2014 11:04:01 -1000
From: Scott Feldman <sfeldma@...il.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: Netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
"nhorman@...driver.com" <nhorman@...driver.com>,
Andy Gospodarek <andy@...yhouse.net>,
Thomas Graf <tgraf@...g.ch>,
"dborkman@...hat.com" <dborkman@...hat.com>,
"ogerlitz@...lanox.com" <ogerlitz@...lanox.com>,
"jesse@...ira.com" <jesse@...ira.com>,
"pshelar@...ira.com" <pshelar@...ira.com>,
"azhou@...ira.com" <azhou@...ira.com>,
"ben@...adent.org.uk" <ben@...adent.org.uk>,
"stephen@...workplumber.org" <stephen@...workplumber.org>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
"vyasevic@...hat.com" <vyasevic@...hat.com>,
Cong Wang <xiyou.wangcong@...il.com>,
"Fastabend, John R" <john.r.fastabend@...el.com>,
Eric Dumazet <edumazet@...gle.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Florian Fainelli <f.fainelli@...il.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
John Linville <linville@...driver.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
"ryazanov.s.a@...il.com" <ryazanov.s.a@...il.com>,
"buytenh@...tstofly.org" <buytenh@...tstofly.org>,
Aviad Raveh <aviadr@...lanox.com>,
"nbd@...nwrt.org" <nbd@...nwrt.org>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Neil Jerram <Neil.Jerram@...aswitch.com>,
"ronye@...lanox.com" <ronye@...lanox.com>,
"simon.horman@...ronome.com" <simon.horman@...ronome.com>,
"alexander.h.duyck@...hat.com" <alexander.h.duyck@...hat.com>,
"Ronciak, John" <john.ronciak@...el.com>,
"mleitner@...hat.com" <mleitner@...hat.com>,
Shrijeet Mukherjee <shrijeet@...il.com>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Benjamin LaHaise <bcrl@...ck.org>,
Hemal Shah <hemal@...adcom.com>
Subject: Re: [patch net-next v4 20/21] rocker: Add proper validation of
Netlink attributes
Signed-off-by: Scott Feldman <sfeldma@...il.com>
On Thu, Nov 27, 2014 at 12:40 AM, Jiri Pirko <jiri@...nulli.us> wrote:
> From: Thomas Graf <tgraf@...g.ch>
>
> Signed-off-by: Thomas Graf <tgraf@...g.ch>
> Signed-off-by: Jiri Pirko <jiri@...nulli.us>
> ---
> new in v4
> ---
> drivers/net/ethernet/rocker/rocker.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
> index 61cfdbf..30687bf 100644
> --- a/drivers/net/ethernet/rocker/rocker.c
> +++ b/drivers/net/ethernet/rocker/rocker.c
> @@ -3712,6 +3712,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
> if (afspec) {
> attr = nla_find_nested(afspec, IFLA_BRIDGE_MODE);
> if (attr) {
> + if (nla_len(attr) < sizeof(mode))
> + return -EINVAL;
> +
> mode = nla_get_u16(attr);
> if (mode != BRIDGE_MODE_SWDEV)
> return -EINVAL;
> @@ -3721,6 +3724,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
> if (protinfo) {
> attr = nla_find_nested(protinfo, IFLA_BRPORT_LEARNING);
> if (attr) {
> + if (nla_len(attr) < sizeof(u8))
> + return -EINVAL;
> +
> if (nla_get_u8(attr))
> rocker_port->brport_flags |= BR_LEARNING;
> else
> @@ -3731,6 +3737,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
> }
> attr = nla_find_nested(protinfo, IFLA_BRPORT_LEARNING_SYNC);
> if (attr) {
> + if (nla_len(attr) < sizeof(u8))
> + return -EINVAL;
> +
> if (nla_get_u8(attr))
> rocker_port->brport_flags |= BR_LEARNING_SYNC;
> else
> --
> 1.9.3
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists