From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v2 net-next 11/23] rtnetlink: Update rtnl_stats_dump for strict data checking Date: Mon, 08 Oct 2018 11:02:58 -0700 (PDT) Message-ID: <20181008.110258.1157567575453794867.davem@davemloft.net> References: <20181008031644.15989-12-dsahern@kernel.org> <20181008101725.zjdsnwcyww7tmwnr@brauner.io> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: christian@brauner.io, dsahern@kernel.org, netdev@vger.kernel.org, jbenc@redhat.com, stephen@networkplumber.org To: dsahern@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:57540 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbeJIBPx (ORCPT ); Mon, 8 Oct 2018 21:15:53 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern Date: Mon, 8 Oct 2018 07:25:34 -0600 > On 10/8/18 4:17 AM, Christian Brauner wrote: >>> @@ -4696,13 +4697,32 @@ 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)) >>> + if (nlmsg_len(cb->nlh) < sizeof(*ifsm)) { >>> + NL_SET_ERR_MSG(extack, "Invalid header for stats dump"); >>> return -EINVAL; >>> + } >>> >>> ifsm = nlmsg_data(cb->nlh); >>> + >>> + /* only requests using NLM_F_DUMP_PROPER_HDR can pass data to >> >> That looks like an accidental leftover before we changed this to a >> socket option. :) >> > > ugh. thanks for noticing. David, I applied this series, please send me relative fixups at this point if necessary. Thanks.