Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7231685yba; Thu, 2 May 2019 06:35:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoCe1R6DAdHWG8/z2kTgRZuM5yfMsBSGRWwvmeIxJZjkyqAqDiITrdZkjnlGSf/k3T2J+7 X-Received: by 2002:a63:131d:: with SMTP id i29mr4020147pgl.399.1556804103699; Thu, 02 May 2019 06:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556804103; cv=none; d=google.com; s=arc-20160816; b=eaOo0gmgXmjZ6PTosq5MPgU6k3MbEK+BqZBgskXbxcnh1PkIT4lSxs8b3sKMQeYnlR zATG4JF/nuXNSdBkjST2l3WJMJZ0RecRcNwLj9c8TSkifT2gUDN64vynXSDcLzy4ZyEZ VSNRv6PCXAup8uy0BGoT3I/E4w6dPwYCwZmlfKiunF92beRjAYpVKOOO+JdChT7KQo4J 9bYhG+p+qQBE68jKtnBk0GGkdWcbi7CDX6rIuprPsiu2+LeIy2keVGVWayApsPYaKQKZ hoAwzteDCuMAnM2GqgUB1vHhCbAzkpyPjnNSqmz8jm+hQcCN4NVIjDAC+86DH0/aNmPz AukA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xyvS44aJZYB7CxAVADGlNIeQ8leSwrcjv5q3rRbVGVA=; b=Hd5M7CIGt5jPEG9mjv8o2ZU0GhdTM1/2MKGhK4+Q7jQAqOJzdNIqblZy74Llu8xKBm 5pabl5TWDnDlTZ3fzV62Ji82P71qDgGHArCy46YV6cpMYP1jTIQ2vhX3/QxC7bKHBOqY Y0WmU1rtkSanb5XYfTQRsZRixIb6hJTU38T5gVC6QpcH73hiI9EjCAHW/NapwXqPNUja gIWRjOGMgAtkDdl84kvK3xoqN+HSwRSyPu2VdegTmk6H3pM31XGgr9M7kqCt8lxZC+Km etTAZxVpgJtGgj26lU7UXhP36Hrvi/nDb9q7ZysG23HbDmy+wKYEAADnBZ0vTJ4KUVuE 97oQ== 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 k8si17118130pll.318.2019.05.02.06.34.47; Thu, 02 May 2019 06:35:03 -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 S1726356AbfEBNcd (ORCPT + 99 others); Thu, 2 May 2019 09:32:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:42500 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726267AbfEBNcd (ORCPT ); Thu, 2 May 2019 09:32:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CEB8CADEA; Thu, 2 May 2019 13:32:31 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 48508E0117; Thu, 2 May 2019 15:32:31 +0200 (CEST) Date: Thu, 2 May 2019 15:32:31 +0200 From: Michal Kubecek To: Johannes Berg Cc: "David S. Miller" , "netdev@vger.kernel.org" , David Ahern , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next 1/3] genetlink: do not validate dump requests if there is no policy Message-ID: <20190502133231.GF21672@unicorn.suse.cz> References: <0a54a4db49c20e76a998ea3e4548b22637fbad34.1556798793.git.mkubecek@suse.cz> <031933f3fc4b26e284912771b480c87483574bea.camel@sipsolutions.net> <20190502131023.GD21672@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 03:13:00PM +0200, Johannes Berg wrote: > On Thu, 2019-05-02 at 15:10 +0200, Michal Kubecek wrote: > > On Thu, May 02, 2019 at 02:51:33PM +0200, Johannes Berg wrote: > > > On Thu, 2019-05-02 at 12:48 +0000, Michal Kubecek wrote: > > > > Unlike do requests, dump genetlink requests now perform strict validation > > > > by default even if the genetlink family does not set policy and maxtype > > > > because it does validation and parsing on its own (e.g. because it wants to > > > > allow different message format for different commands). While the null > > > > policy will be ignored, maxtype (which would be zero) is still checked so > > > > that any attribute will fail validation. > > > > > > > > The solution is to only call __nla_validate() from genl_family_rcv_msg() > > > > if family->maxtype is set. > > > > > > D'oh. Which family was it that you found this on? I checked only ones > > > with policy I guess. > > > > It was with my ethtool netlink series (still work in progress). > > Then you should probably *have* a policy to get all the other goodies > like automatic policy export (once I repost those patches) Wouldn't it mean effecitvely ending up with only one command (in genetlink sense) and having to distinguish actual commands with atributes? Even if I wanted to have just "get" and "set" command, common policy wouldn't allow me to say which attributes are allowed for each of them. Michal