On 10/7/18 4:53 AM, Christian Brauner wrote:
>> @@ -2076,6 +2077,21 @@ static int inet_netconf_dump_devconf(struct sk_buff
>> *skb,
>> struct in_device *in_dev;
>> struct hlist_head *head;
>>
>> + if (cb->strict_check) {
>> + struct netlink_ext_ack *extack = cb->extack;
>> + struct netconfmsg *ncm;
>> +
>> + if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ncm))) {
>> + NL_SET_ERR_MSG(extack, "Invalid header");
>> + return -EINVAL;
>> + }
>> +
>> + if (nlh->nlmsg_len != nlmsg_msg_size(sizeof(*ncm))) {
>> + NL_SET_ERR_MSG(extack, "Invalid data after header");
>> + return -EINVAL;
>> + }
>
> Hm, I think this could just be one branch with !=
> But if you've done this to report back a more meaningful error message
> to userspace, fine. :)
Consistency with other dump handlers and better userspace error
messages. If netconf ever gets a filter the length check is removed in
favor of nlmsg_parse_strict