Thread (15 messages) 15 messages, 4 authors, 2014-11-29

Re: [PATCH 0/5 net] bridge: Fix missing Netlink message validations

From: John Fastabend <john.fastabend@gmail.com>
Date: 2014-11-29 17:51:56

On 11/26/2014 03:14 PM, Thomas Graf wrote:
On 11/26/14 at 09:25am, John Fastabend wrote:
quoted
quoted
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1687,8 +1687,11 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
                BUG();

        if (tb[IFLA_INET_CONF]) {
-               nla_for_each_nested(a, tb[IFLA_INET_CONF], rem)
+               nla_for_each_nested(a, tb[IFLA_INET_CONF], rem) {
+                       if (nla_len(a) < sizeof(u32))
+                               return -EINVAL;
                        ipv4_devconf_set(in_dev, nla_type(a), nla_get_u32(a));
+               }
Looked into this and found a validation function
inet_validate_link_af(). It's split to keep the updates atomic.
Ah great thanks.

-- 
John Fastabend         Intel Corporation
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help