From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net v2] rtnetlink: Disallow FDB configuration for non-Ethernet device Date: Mon, 29 Oct 2018 20:53:29 -0700 (PDT) Message-ID: <20181029.205329.2193085560727068930.davem@davemloft.net> References: <20181029203622.20608-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, vyasevich@gmail.com, dsahern@gmail.com To: idosch@mellanox.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:45474 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbeJ3MpN (ORCPT ); Tue, 30 Oct 2018 08:45:13 -0400 In-Reply-To: <20181029203622.20608-1-idosch@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Ido Schimmel Date: Mon, 29 Oct 2018 20:36:43 +0000 > When an FDB entry is configured, the address is validated to have the > length of an Ethernet address, but the device for which the address is > configured can be of any type. > > The above can result in the use of uninitialized memory when the address > is later compared against existing addresses since 'dev->addr_len' is > used and it may be greater than ETH_ALEN, as with ip6tnl devices. > > Fix this by making sure that FDB entries are only configured for > Ethernet devices. ... > v2: > * Make error message more specific (David) > > Fixes: 090096bf3db1 ("net: generic fdb support for drivers without ndo_fdb_") > Signed-off-by: Ido Schimmel > Reported-and-tested-by: syzbot+3a288d5f5530b901310e@syzkaller.appspotmail.com > Reported-and-tested-by: syzbot+d53ab4e92a1db04110ff@syzkaller.appspotmail.com > Cc: Vlad Yasevich > Cc: David Ahern Applied and queued up for -stable, thanks.