Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4605805img; Tue, 26 Mar 2019 12:47:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzx78MxPI/9EklN0TPC/D0NFYAfRX1PtPgpxi7qPmNbExQASfRAnvNUK+a98gyO9SSsmtXB X-Received: by 2002:a63:2f44:: with SMTP id v65mr30285721pgv.141.1553629663950; Tue, 26 Mar 2019 12:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553629663; cv=none; d=google.com; s=arc-20160816; b=NO9QbbmikkJvg/QHzMnqaiE8jSPGD0vGy3ZOKlh3dZDzIjsRB2S7dot/NWcrBkEj6h yczTae1vEY6qSElU+WPRkMkIxkpM46xP05uPNDUt77FZMrCAA3h36AvclrTsT4CPQz33 1PA2aApg697Ktcx1G/Ip265gu4di9P2fpd13IV/FIuUr2p9nOO54ProxHCuXoZzhDOri xtH6QqsDncB+5qMpF1tYc0ScOmNMdW+4pmZ0KN7MU21qsYp5M+2uyjT1xpwlS7xaHnrQ WyKkTNuOdpo+maiM49iUP4G6KHYyMXnd/Q1h1hzA3h39doFgip95lOrZTmGy9a1vBMVq CLVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=e441Jxl/qzcX7nUs6hWG2ihCedAU5vxDLFOtPXqglrs=; b=t1iMuw80Ihk2qNsDR0l+jCwCoLHex3bMEuIGOqOqz0NFSf98sUSTqrm35OTX/0x79+ tkQtuCyuOnhMHuNBcnArjsrEHqar1I7XqRHLDqIfmEVovR6xtP84DaY48uAiopUnfPyX 0e6bfkHujDyTDYlPQIY3pXGzkqmomZ1RrFlDBs1/eWVbXOosxBOfoYPIlNgyAmeINST8 /K2+EZza6bq4jxyYF5ZQnTqAI2gZFZrXv+wzG1+63ByRPBGCaFRgeU4fXlmdfv+zMa/h web9bYl/TXZXSIj7ux8mnhbyemuCdviJujluRjljI8iTHzYnqU45hGHa6d4zsPaAwpdi d2NA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si16645122pfj.111.2019.03.26.12.47.27; Tue, 26 Mar 2019 12:47:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732247AbfCZTqw (ORCPT + 99 others); Tue, 26 Mar 2019 15:46:52 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:49680 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbfCZTqw (ORCPT ); Tue, 26 Mar 2019 15:46:52 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2570514C652C3; Tue, 26 Mar 2019 12:46:51 -0700 (PDT) Date: Tue, 26 Mar 2019 12:46:46 -0700 (PDT) Message-Id: <20190326.124646.505432518345625779.davem@davemloft.net> To: mkubecek@suse.cz Cc: netdev@vger.kernel.org, jakub.kicinski@netronome.com, jiri@resnulli.us, andrew@lunn.ch, f.fainelli@gmail.com, linville@tuxdriver.com, stephen@networkplumber.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 01/22] rtnetlink: provide permanent hardware address in RTM_NEWLINK From: David Miller In-Reply-To: <16ffb1fbfa8f54de587ac52f4ff95e5034c590b4.1553532199.git.mkubecek@suse.cz> References: <16ffb1fbfa8f54de587ac52f4ff95e5034c590b4.1553532199.git.mkubecek@suse.cz> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 26 Mar 2019 12:46:51 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Kubecek Date: Mon, 25 Mar 2019 18:07:57 +0100 (CET) > @@ -1683,6 +1684,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, > nla_put_s32(skb, IFLA_NEW_IFINDEX, new_ifindex) < 0) > goto nla_put_failure; > > + if (nla_put(skb, IFLA_PERM_ADDRESS, dev->addr_len, dev->perm_addr)) > + goto nla_put_failure; > > rcu_read_lock(); > if (rtnl_fill_link_af(skb, dev, ext_filter_mask)) I guess, as Jiri says, we really do have to check if the driver actually set this before pushing the attribute out to userspace. But seriously, you chould just check for dev_addr_len zeros. All zeros is not a valid link address on any link type.