Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7209232yba; Thu, 2 May 2019 06:14:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV7iGSVSC2z9+ES2qGD8rWKsqfJVEvJ4eD2azae2F7yc0E00Tq/ftBfyW2GiQ8YNJ83Xlh X-Received: by 2002:a63:1e5b:: with SMTP id p27mr3798346pgm.213.1556802863995; Thu, 02 May 2019 06:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556802863; cv=none; d=google.com; s=arc-20160816; b=QmXn/CBaOEQ4Rn0xQBaUHt7kbspg6i9AQqldbC3fhrSN+FFOE7mtir7ExEdz9SVpI5 /mG3BpwhCeXOVVi/Yd4zMOLdoG9HQ9udfCPym+OHSG28qrxEZLAOl3sOdlk7ZahZEjw/ Exzllsv/h81PC6UWpTYxitQR4dzMZtopGfaGPpWWg7UQ5dbj4j0NP9fxcQIpwY2vt4rb WUQBMUyr0QRgF+MWoksMLi1qBj2BKYyQ8rJdgoyteJQYlc6KOTB7n5nUQ3dMsuabsMg7 VlCqL8/y8IcKZC2J8ja3wvBltmlXVvozWl2hsNix7j/8V9ISmdO95l9sIw6nbBwIsz/f HBvQ== 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:date:cc:to:from:subject:message-id; bh=reOZzwKZMOPJrmOyLmwdgaNpzp5uZLz+VqHv6nXjvu8=; b=PrL59NaMrGZqGgB/K66/hUoUoLzwL6pQp+aeL768txtsWMPUwUJB2Yo8fOd4rPYUHU XQkV4fgNE56VjSXlhw8HoYfb9Dt6OqNQOtMSyrOQ8+qQHl9jwUCFuE3TgziJXZhl6Yt1 C5Vhe5HiLM5XiErYKpzKf8dvxJS6F7hZlN5l/NX1vtqV/gepZtGmUgTvaJ/xY21AaoK5 Tg8x09DS9dAIPBaZGpyxZefr1ZUZsOyelyIiYV2O+dspP12QoW4QUW/JCy8ftR8KHKZc 6LHx71tUd/tzuX43Zl/u7pmmLKjfHe5RYcR4izbED2txy2WmcC5RWUQ1VwbJUihYUfj5 lfGQ== 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 i7si43245127pgl.261.2019.05.02.06.14.08; Thu, 02 May 2019 06:14:23 -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 S1726514AbfEBNNJ (ORCPT + 99 others); Thu, 2 May 2019 09:13:09 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:56028 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfEBNNJ (ORCPT ); Thu, 2 May 2019 09:13:09 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hMBWI-0002Bu-CD; Thu, 02 May 2019 15:13:02 +0200 Message-ID: Subject: Re: [PATCH net-next 1/3] genetlink: do not validate dump requests if there is no policy From: Johannes Berg To: Michal Kubecek Cc: "David S. Miller" , "netdev@vger.kernel.org" , David Ahern , "linux-kernel@vger.kernel.org" Date: Thu, 02 May 2019 15:13:00 +0200 In-Reply-To: <20190502131023.GD21672@unicorn.suse.cz> References: <0a54a4db49c20e76a998ea3e4548b22637fbad34.1556798793.git.mkubecek@suse.cz> <031933f3fc4b26e284912771b480c87483574bea.camel@sipsolutions.net> <20190502131023.GD21672@unicorn.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) johannes