Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2233068ybp; Thu, 10 Oct 2019 04:27:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsreaPaKurOLRm6dlxuVQNSUpi8f5uAvUIrMmgcUv2pVUTBYXacgE/1HHG6MVHeOe/v4Lf X-Received: by 2002:aa7:d842:: with SMTP id f2mr7646849eds.27.1570706849956; Thu, 10 Oct 2019 04:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570706849; cv=none; d=google.com; s=arc-20160816; b=CBRZKaz2HxriVV4YHID/dmtsD95Nqci3ph3StyQP2VKOvkruqzpprTr/7qREhlma9V NSEkERYBXi8VHApMDj4mM/JYEwKJ2zK06A30lE7JHbCk615DkoMAehyADJm70wYhqtdd j26JI52XYifsnyhGObPZ+HE45lwcXcwncFrMYaBLD254uL6EVyxLCEWSPg+9feTtyKv1 OSvpxulFdUt5V5DBaUUXymFxavBTJfzbnQf3E6D5ycvVP91sAvWXvM0tmUKGsvULd2MC J+vjA3dnM1xInQ77CC6TpXK8cp1kxr6NygH8qR4Np0ASQ+iZPvJTikkgL2NE7xGn6mXB zeiw== 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:dkim-signature; bh=OYpDDuL7BYuuwlHxQgZR0G54AZSewtaA2OCEr7V/XNs=; b=GVOvmNvjsrvACmKRCY9LfY2KzBIX4OqT2w2gwvAYJwOo91wigbolV98by74cdC4yAN xPbTFjizLypcsoL7zTyXZOn0SIq7E53TMqAY6bq06Rc0YPLPj8oI/xITdAhAnLhsRvOh KTcp4jYWwNl35ptfMKH9/CTRk43j3DS/IYXP5i5rEBHeXYmvxMg9PDO0aAzIHA8bVmJ9 1o1gTspbXc4XMGFZ+tTUBvOjbzuEAxEUhr32kc3ikWnZfDtNv2psSn+mSVLsHhsLSiqM yqHi9438mwZBq5DoStzSJdkX+morBrk8JIHxjBtHko5bMrhOcrM7FRycfK1tt3MKnzck xIUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=oWfC2NQL; 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 z54si3574972edd.337.2019.10.10.04.27.06; Thu, 10 Oct 2019 04:27:29 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=oWfC2NQL; 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 S1727523AbfJJL05 (ORCPT + 99 others); Thu, 10 Oct 2019 07:26:57 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37596 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbfJJL05 (ORCPT ); Thu, 10 Oct 2019 07:26:57 -0400 Received: by mail-wm1-f68.google.com with SMTP id f22so6379004wmc.2 for ; Thu, 10 Oct 2019 04:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OYpDDuL7BYuuwlHxQgZR0G54AZSewtaA2OCEr7V/XNs=; b=oWfC2NQLiLTJO+/rnLDDJMp6qooPWYRbjPraT9E4RsPT47AsjFw5x3BODvrlkI0vnZ A3DcOU77YQQWKUBFLgiA8TpaFXjS3Fm8gTdi7zEiwTvxg87lKBYjc/hC7A60NJiqFQ/Q I6NX5JbRH2wGosPdJ6N3cGWLLWncK27mnBWwjVkCpJQSbZ0iBoittiahoFEuP189FTMp 4GSYkK6xcOaYoD0jnlI9VldVsCsy1SOf6ALk5iX2OLoLgj3D/fI1qwauFkOn27WV92jl tyZ+GqqBBWWTxwIcxgXfA5JM025CskvH5lO7rNrytqLRR59IBm8EeC2WkqMxtHZdwHfJ 9ELA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OYpDDuL7BYuuwlHxQgZR0G54AZSewtaA2OCEr7V/XNs=; b=SVf/G6in8x/kVvj+XmFpJTKZmnhlbRARO69jbNW1XUPVAiqTuKHzklddwgeqg7uulJ +fq+ICHBFMYbAxI+u05VtcHUVfKflw32N+iWBlDNUgnZqvUUHGYmcAb9mk0gJQA6RHT6 GtWRJSxQygwqWYV3mkj1qrVoLPwOa43Yo6vvfgV/mAQ7Ad9KrK93dN7NRBJ0QnO43hzF 1NGjMS/OBzhaRLfniRFsRQxUpE/nPPEFL+0/ByQoSC3cePnSJYZb2SD/Xb3OPxsIiD5J 5MT+SwOaefvw0OymQfkzFr5qojr+yT52onlrFEeHqDzbr/Y70WedKC3tV4GqsL3AL0Z5 06tg== X-Gm-Message-State: APjAAAWwHiDWnAQhSfTmVm252ZSIpyb5wYkYLde691dlk7l6cMvRerlg 2ClbIUlPonAro/R7fSoyryXkrw== X-Received: by 2002:a7b:ce12:: with SMTP id m18mr510289wmc.108.1570706815333; Thu, 10 Oct 2019 04:26:55 -0700 (PDT) Received: from localhost ([85.163.43.78]) by smtp.gmail.com with ESMTPSA id v7sm5343827wrr.4.2019.10.10.04.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 04:26:54 -0700 (PDT) Date: Thu, 10 Oct 2019 13:26:54 +0200 From: Jiri Pirko 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 v2] genetlink: do not parse attributes for families with zero maxattr Message-ID: <20191010112654.GH2223@nanopsycho> References: <20191010103402.36408E378C@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010103402.36408E378C@unicorn.suse.cz> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Oct 10, 2019 at 12:34:02PM CEST, mkubecek@suse.cz 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_doit() if family->maxattr is zero. Do the >same also in genl_family_rcv_msg_doit(). > >Fixes: c10e6cf85e7d ("net: genetlink: push attrbuf allocation and parsing to a separate function") >Signed-off-by: Michal Kubecek Acked-by: Jiri Pirko Thanks!