]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - net/core/rtnetlink.c
UBUNTU: Start new release
[mirror_ubuntu-zesty-kernel.git] / net / core / rtnetlink.c
index 18b5aae99becf81c3aa55820d49332067a1c4fe7..d64d8d14bb2e5f0871ff5f313f3858fd7a372dca 100644 (file)
@@ -1059,7 +1059,7 @@ static int rtnl_phys_port_name_fill(struct sk_buff *skb, struct net_device *dev)
                return err;
        }
 
-       if (nla_put(skb, IFLA_PHYS_PORT_NAME, strlen(name), name))
+       if (nla_put_string(skb, IFLA_PHYS_PORT_NAME, name))
                return -EMSGSIZE;
 
        return 0;
@@ -3898,6 +3898,9 @@ static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh)
        u32 filter_mask;
        int err;
 
+       if (nlmsg_len(nlh) < sizeof(*ifsm))
+               return -EINVAL;
+
        ifsm = nlmsg_data(nlh);
        if (ifsm->ifindex > 0)
                dev = __dev_get_by_index(net, ifsm->ifindex);
@@ -3947,6 +3950,9 @@ static int rtnl_stats_dump(struct sk_buff *skb, struct netlink_callback *cb)
 
        cb->seq = net->dev_base_seq;
 
+       if (nlmsg_len(cb->nlh) < sizeof(*ifsm))
+               return -EINVAL;
+
        ifsm = nlmsg_data(cb->nlh);
        filter_mask = ifsm->filter_mask;
        if (!filter_mask)