[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <218c664f-b79c-aca3-5665-eaf11d8c2be7@gmail.com>
Date: Mon, 4 Jun 2018 22:48:30 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Eric Dumazet <eric.dumazet@...il.com>,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCH net-next] net: metrics: add proper netlink validation
On 06/04/2018 04:46 PM, Eric Dumazet wrote:
> Before using nla_get_u32(), better make sure the attribute
> is of the proper size.
>
>
> Fixes: a919525ad832 ("net: Move fib_convert_metrics to metrics file")
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: syzbot <syzkaller@...glegroups.com>
> Cc: David Ahern <dsahern@...il.com>
> ---
> net/ipv4/fib_semantics.c | 2 ++
> net/ipv4/metrics.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index 6608db23f54b6afdac0455650b47d64b1b22b255..9a890be8a0265edb78da225a82e2cac120f2150f 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -717,6 +717,8 @@ bool fib_metrics_match(struct fib_config *cfg, struct fib_info *fi)
> nla_strlcpy(tmp, nla, sizeof(tmp));
> val = tcp_ca_get_key_by_name(fi->fib_net, tmp, &ecn_ca);
> } else {
> + if (nla_len(nla) != sizeof(u32)
Oh well, stupid typo.
> + return false;
> val = nla_get_u32(nla);
I will send a V2.
Powered by blists - more mailing lists