From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v2 net-next] rtnetlink: fix rtnl_fdb_dump() for ndmsg header Date: Thu, 4 Oct 2018 14:34:28 -0600 Message-ID: <64c1aa20-7e9a-68d5-5c1f-5ab059fc6c9e@gmail.com> References: <20181002014640.688-1-mfo@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net To: Mauricio Faria de Oliveira , netdev@vger.kernel.org Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:44552 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJED31 (ORCPT ); Thu, 4 Oct 2018 23:29:27 -0400 Received: by mail-pg1-f196.google.com with SMTP id g2-v6so3666295pgu.11 for ; Thu, 04 Oct 2018 13:34:31 -0700 (PDT) In-Reply-To: <20181002014640.688-1-mfo@canonical.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/1/18 7:46 PM, Mauricio Faria de Oliveira wrote: > Currently, rtnl_fdb_dump() assumes the family header is 'struct ifinfomsg', > which is not always true -- 'struct ndmsg' is used by iproute2 ('ip neigh'). > > The problem is, the function bails out early if nlmsg_parse() fails, which > does occur for iproute2 usage of 'struct ndmsg' because the payload length > is shorter than the family header alone (as 'struct ifinfomsg' is assumed). > > This breaks backward compatibility with userspace -- nothing is sent back. > ... > > Fixes: 0ff50e83b512 ("net: rtnetlink: bail out from rtnl_fdb_dump() on parse error") > Fixes: 5e6d24358799 ("bridge: netlink dump interface at par with brctl") > Reported-by: Aidan Obley > Signed-off-by: Mauricio Faria de Oliveira > > --- > v2: Change logic to check msg size for ndmsg with optional attribute. > Thanks: David Ahern > > net/core/rtnetlink.c | 29 ++++++++++++++++++++--------- > 1 file changed, 20 insertions(+), 9 deletions(-) > Seems reasonable for 4.19 and back Reviewed-by: David Ahern