Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2862368ybp; Sat, 12 Oct 2019 19:14:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqEybq8VBylkJHXf5GoPFUoQdpFI7GYbmIWtEykcP7JfZ5E87WFhNoIvUSvUKZpF64ISRH X-Received: by 2002:aa7:ce8e:: with SMTP id y14mr21235395edv.5.1570932873558; Sat, 12 Oct 2019 19:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570932873; cv=none; d=google.com; s=arc-20160816; b=pEI5rMgZivcjhMoUwFbggJyautFcrWVsDkl1pdAtqvJZo4zKzq6LJto5myPO4Edias F3AiWIH+t2qsuh5HYfQFuNWXRo1jA18H3vcGGQM05iKv6T68BOogZmFyUk0WfxNND2sj ygb2L7LCXt1j48Q4Bueud1RSKCDAVvVg+vzNwQwgKfEPUG1eByG49zq+lI33qKAU8yOH In/3spC1lp93JdscSVuJTfxsVK/jwQgVMHkWdUofdhmjCIYvmZARcMlPOv46MVIHvbAz IEq5CtEw+sch2jZ6pqYyaN916f/Sjkd7/J3nYy7Ks1OuFTIMiifMod4sJHgkf+B+k1ct XMGw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=QTAzFNmpx1YvoYEHeuEsjumliid7dPHjEDtyaf8FlAg=; b=gnqL9mz3On7J45KFtS1XzBq66Z7FvKq3bJxUb1bJNbWSReo8+XU/St5rCk2xhUtLor WUeVHS9ZSFhMNGzauOhx5jN61dIhWrQI+yRY8nzcyg9Dyp4y25n+fknZHwcgNiPYPYR2 OvvALkjut8rTPsgspqxOzXCfKPHbEfNZ8VHGgpLXbIHXiw96D0nJfeA1K72AToHxjPs7 H6LgTbuIaKMSyMg+UvhRXT5woXo2DZzc+fMtbgfwHu3B3emyzdNZKkaTElypzg95qwCX VeazkAF3NEh3w7sB+b2IY3NyNPiVJtt+38bv1or3blP5BotRkkSrgbzh5A3y/b9S8LWH LRQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=ZrWMMva2; 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 qo6si8447738ejb.386.2019.10.12.19.13.30; Sat, 12 Oct 2019 19:14:33 -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; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=ZrWMMva2; 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 S1727909AbfJMCIW (ORCPT + 99 others); Sat, 12 Oct 2019 22:08:22 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39992 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfJMCIW (ORCPT ); Sat, 12 Oct 2019 22:08:22 -0400 Received: by mail-pg1-f193.google.com with SMTP id d26so8009381pgl.7 for ; Sat, 12 Oct 2019 19:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=QTAzFNmpx1YvoYEHeuEsjumliid7dPHjEDtyaf8FlAg=; b=ZrWMMva2TInUCPqkTXG31JgGwakKG4WRbvC7Mqqt8wmKPsIRh57PWNgWjidfk8oZz3 48/RPggeuY62tvbuOilNnCvmYcXDXiUKYUWEobHZ0fdNalWdlUa77pXgfe41yXnJniZm ambmMwd6DArfOS3jD9UOVTgqiXhziE+1GTwAviP8Dn4euk7MF5HySL8JUhQ2cp9165Zz mnyt9OG/ihtZlOCLpSM2STS4A+kQL5IoNwtvqyoBsgMo8hdWKbsAUYcu9brbHElHwB+P yR7MZNcnVu0HqVOIJHNgxYOQu4gjWMqlbJRONuPCW+IyJi6tJQrzl3ElGqlED2Bfh0xB tD+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=QTAzFNmpx1YvoYEHeuEsjumliid7dPHjEDtyaf8FlAg=; b=kcEiz1zCvu/G7ABby8PW04lT98/U8zmGkx+RxDg788ZEpaWgB82TzyXECc59ns03Jp rFXhF+kms0OjW02/6rM1wQgnQ76A2UFVODS1q/BtpArVxj0oZuFFBXF+GJbK/NbnWApp kpd/PdVMXuKb3+jzYia8dfvqCiP8NwTyb+NNdIYclavSpcOlFBtfxE4y7OdX1SPBG/C0 KIiH8SmuIjvtEI3ZFSOlJfEST2PX18oPcqcKGN5ubItBSjiQtRA25QItWKP21TREgRzY 5oiLj9M/CXemnUzKI20/ELFBAMHdaYGOjfXUx2FMEjt6ZDjNQyFjjADAZsgDSSI10NGJ rIKQ== X-Gm-Message-State: APjAAAVr9aBji6EiVWzpmTKXg37XovJoFvHBDQ73EGaL/P3QWvXUcwcl 6DtBJDUqmFXKmYEafruaVie0bicsUP0= X-Received: by 2002:a63:7a54:: with SMTP id j20mr5371710pgn.355.1570932501088; Sat, 12 Oct 2019 19:08:21 -0700 (PDT) Received: from cakuba.netronome.com ([2601:646:8e00:e18::2]) by smtp.gmail.com with ESMTPSA id i132sm12983087pgd.47.2019.10.12.19.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2019 19:08:20 -0700 (PDT) Date: Sat, 12 Oct 2019 19:08:18 -0700 From: Jakub Kicinski To: Michal Kubecek Cc: "David S. Miller" , Jiri Pirko , Johannes Berg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v3] genetlink: do not parse attributes for families with zero maxattr Message-ID: <20191012190818.30fa47b3@cakuba.netronome.com> In-Reply-To: <20191011084544.91E73E378C@unicorn.suse.cz> References: <20191011084544.91E73E378C@unicorn.suse.cz> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 11 Oct 2019 09:40:09 +0200, Michal Kubecek wrote: > Commit c10e6cf85e7d ("net: genetlink: push attrbuf allocation and parsing > to a separate function") moved attribute buffer allocation and attribute > parsing from genl_family_rcv_msg_doit() into a separate function > genl_family_rcv_msg_attrs_parse() which, unlike the previous code, calls > __nlmsg_parse() even if family->maxattr is 0 (i.e. the family does its own > parsing). The parser error is ignored and does not propagate out of > genl_family_rcv_msg_attrs_parse() but an error message ("Unknown attribute > type") is set in extack and if further processing generates no error or > warning, it stays there and is interpreted as a warning by userspace. > > Dumpit requests are not affected as genl_family_rcv_msg_dumpit() bypasses > the call of genl_family_rcv_msg_attrs_parse() if family->maxattr is zero. > Move this logic inside genl_family_rcv_msg_attrs_parse() so that we don't > have to handle it in each caller. > > v3: put the check inside genl_family_rcv_msg_attrs_parse() > v2: adjust also argument of genl_family_rcv_msg_attrs_free() > > Fixes: c10e6cf85e7d ("net: genetlink: push attrbuf allocation and parsing to a separate function") > Signed-off-by: Michal Kubecek Acked-by: Jakub Kicinski