Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4741559rwo; Tue, 25 Jul 2023 10:12:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlEHG2a0OVpw2F88ghnfUAMDuwSx7Ihx2aLcW29BOdL83IdnzugnG/oxabaTV8fzUDo0pxgT X-Received: by 2002:a05:6a21:3299:b0:130:d84b:eb91 with SMTP id yt25-20020a056a21329900b00130d84beb91mr14648897pzb.49.1690305134310; Tue, 25 Jul 2023 10:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690305134; cv=none; d=google.com; s=arc-20160816; b=RYhgpft9aw5+iRJt0Ti/LwMIPncQJ5S6mvl7k8P0iuAv8nAlfPcTolqlOz0X8s5VOi vXwRYngLcI2U7/o1fJ+GUcv4m8xGWjIwfOoEmlFW++n6ADBVU3gTB/NLvR46asWFNDLz JHkQSS9VEn04UgR9FPV8O2TKrNQmGE/FoDJp9bUHeMcjX/2as3oIcV2So1udJviXE+bW TwKMtk+/nnQa4Mmtcq5nLU0H44rpCRyIZ9fAB2uA6ENAuZBnw6vFxiQAfIqrBb/MJNgw JBfdd6hxPY81Wh+xE9ejN0viz1ftVy71MAY8vEdW3qBPqlHpVlfPpXdWaIMb5dVYxCfS glpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=yXsjY06VwFrIXJpZhP/VpMMYIOCaWt9Qypvfd2vH5dE=; fh=J/2qujd2hkWwwbRN8EpHs6tpZWloiDGcVBjWKT82AGk=; b=a6IcSyqmlfl4OaOetNCvuFvQF+60CPPOHZyUTXKydSa4+rJARhG4qgw2pR41/bB5q0 KIKWio3ELcxmaJfZFL0ujlZA3mOhkbcH354f4qysgnZCH+pNydt3/KlNQSSkJYGjYj2F 9aHygxXskA1wzbqhdPdT5HKx06aRTgh90pvWe4A3axMCLiFriXOs56RBH1W0EfYUFPqq puUJGcnbLAli7wEFDFqp4QgesUhSO/G+TbReaV7ssHo+dTC0uk9FTNFL6pgeWepAni8D yKe5fLJamNDE5i/Z2Ixo5kMtg3bKCF352/LQ1Y9YamR8+cdSoGfumPo+IMMfhCQjEg22 R1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SxH+OGq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cv6-20020a056a0044c600b00653c0edfd34si11648284pfb.139.2023.07.25.10.12.00; Tue, 25 Jul 2023 10:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SxH+OGq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232253AbjGYQyA (ORCPT + 99 others); Tue, 25 Jul 2023 12:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjGYQx6 (ORCPT ); Tue, 25 Jul 2023 12:53:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC6F526B9 for ; Tue, 25 Jul 2023 09:53:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA87061821 for ; Tue, 25 Jul 2023 16:53:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5B8FC433C8; Tue, 25 Jul 2023 16:53:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690304009; bh=IxAEg/zFNLeaSOZ2+I4D9yyaJpFMEaswtXPaBzxnKgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SxH+OGq4T9EJ5mb76lXK+oW2BxdhHd7R3WW97C3AISLcrhGM+/cY0HhzoDLq99fnR pqWDGfjsnv8PloQmggBJAcbzdordfUmLHnkgmXKBBfRAP/elOmTlMf17KHF5uCZlSk YN7ACW+2ggKI5Cvv4kxqEMhIqelM6jJYzC0EaBxvdZly6Xd52r1ZqFeBTiC+l351ao 9Tbt+epizrET4rBKIrKL29eZed29GvBaq2ZXiJyrxO7RpTDFpkzd+ztPU+zJksn2lE baNiQvt2HO1/JIJ9gLCDCMDZarJRm6gFWd0/JCCPwT8oDbt+6LDYn5kY0mLce97t88 rrm+EMRUjvb1A== Date: Tue, 25 Jul 2023 09:53:27 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: Lin Ma , jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, richardcochran@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] i40e: Add length check for IFLA_AF_SPEC parsing Message-ID: <20230725095327.385616f1@kernel.org> In-Reply-To: <20230725054046.GK11388@unreal> References: <20230723075042.3709043-1-linma@zju.edu.cn> <20230724174435.GA11388@unreal> <20230724142155.13c83625@kernel.org> <20230725054046.GK11388@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Jul 2023 08:40:46 +0300 Leon Romanovsky wrote: > > Empty attributes are valid, we can't do that. > > Maybe Lin can add special version of nla_for_each_nested() which will > skip these empty NLAs, for code which don't allow empty attributes. It's way too arbitrary. Empty attrs are 100% legit, they are called NLA_FLAG in policy parlance. They are basically a boolean.