Re: [PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking
From: Christian Brauner <christian@brauner.io>
Date: 2018-10-07 17:30:55
Attachments
- signature.asc [application/pgp-signature] 833 bytes
From: Christian Brauner <christian@brauner.io>
Date: 2018-10-07 17:30:55
On Fri, Oct 05, 2018 at 01:26:31PM -0600, David Ahern wrote:
On 10/5/18 11:54 AM, Christian Brauner wrote:quoted
quoted
+static int inet6_valid_dump_ifinfo(const struct nlmsghdr *nlh, + struct netlink_ext_ack *extack) +{ + struct ifinfomsg *ifm; + + if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) { + NL_SET_ERR_MSG(extack, "Invalid header"); + return -EINVAL; + } + + if (nlh->nlmsg_len > nlmsg_msg_size(sizeof(*ifm))) {Shouldn't ipv6 specific dump requests at least support IFA_TARGET_NETNSID?It does not today. The AF_UNSPEC GETLINK dumps it but the AF_INET6 does not. Some one can add it later if desired.
Weird, I thought I had sent a patch for that as well. Doesn't matter now I'll just send one once your branch lands. :) Thanks!