From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arend van Spriel Subject: Re: [RFC v2 2/2] netlink: add ethernet address policy types Date: Wed, 12 Sep 2018 10:49:58 +0200 Message-ID: <5B98D336.4090107@broadcom.com> References: <20180912083610.20857-1-johannes@sipsolutions.net> <20180912083610.20857-2-johannes@sipsolutions.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Michal Kubecek , Johannes Berg To: Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Return-path: Received: from mail-qt0-f182.google.com ([209.85.216.182]:37948 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726624AbeILNxe (ORCPT ); Wed, 12 Sep 2018 09:53:34 -0400 Received: by mail-qt0-f182.google.com with SMTP id x7-v6so1032126qtk.5 for ; Wed, 12 Sep 2018 01:50:02 -0700 (PDT) In-Reply-To: <20180912083610.20857-2-johannes@sipsolutions.net> Sender: netdev-owner@vger.kernel.org List-ID: On 9/12/2018 10:36 AM, Johannes Berg wrote: > From: Johannes Berg > > Commonly, ethernet addresses are just using a policy of > { .len = ETH_ALEN } > which leaves userspace free to send more data than it should, > which may hide bugs. > > Introduce NLA_ETH_ADDR which checks for exact size, and rejects > the attribute if the length isn't ETH_ALEN. > > Also add NLA_ETH_ADDR_COMPAT which can be used in place of the > policy above, but will, in addition, warn on an address that's > too long. Not sure if this is correctly described here. It seems longer addresses are not rejected, but only result in a warning message. I guess the problem is in the reference to the "policy above" ;-) Regards, Arend