Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7236277yba; Thu, 2 May 2019 06:39:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNNUf2BZaChu4zcs4SO3ox7P9s7POJRxm4PCn/OZjXWV10HIzn4NJNbbAwnEkxht0+JTix X-Received: by 2002:aa7:810e:: with SMTP id b14mr4368280pfi.112.1556804378316; Thu, 02 May 2019 06:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556804378; cv=none; d=google.com; s=arc-20160816; b=LWT9h3x+eElNV+HZSbeFAInEdRxnu1NxF4VCNh25hGLRjJVAldjpp4aYoa1CYCHLhi SuSAMHRQKWcO8X4ud8giVsBZoFRkbt5pRCMqHmY+H0H+kcEc3RHMOzWJza8OwZPykEcN z6lRBPU8uoD51uZyqehcQnqhlx+UHUKu5AaFgpY5urmZTGvc6DAWGra856cqRIJQegCv YSL8SH2LQpa3tYjg8oneHv9cwmclM8XbmrmpdR/0T2z07nGj+TSuPC92pTbtRRJOcoqi llycDb/BppAijmgOQvbtC58fsyM0hNZ+9rqaQRU2Kqalo069eDmBRspKr34MqVLUzDJE 1avQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=B+xPVEmnEjMU0Ad3Renee6pFrgDbiQQsdeLUcI8AfYs=; b=05m/p/S75EkfaLReBIpXUJCWWBk/aaa99F9ALpzDdoz8xxXkiy6t7xNsoZ4bDU5oXx QNJ/eVH2SRLDTN3PV8wlA5gf5pdqkHqssShRInWr1ytY6jKqx13n6vzohrbN07bWgGE8 63XJvdkUXj2XNxcYI0ZILj5HrdA7giuIn7rpA/FQZXLF4HQF17i0zlnARszi02UU4Z+B WquCS3g13Zu4dC6/WqB9HPef7eROpE5Uu0uqmND91AKcoTQLZDUpIs0QOV/n7RhFg9YF KZjOyjWVdAUZLYWb9FcxsRGkD+p2Bgmc0wMF9SNOoCZiI5ZwtUQjtmIMAhbwj9jv5Sxi 1NwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JdqOpQtY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si18407522pgi.549.2019.05.02.06.39.22; Thu, 02 May 2019 06:39:38 -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=@gmail.com header.s=20161025 header.b=JdqOpQtY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbfEBNh3 (ORCPT + 99 others); Thu, 2 May 2019 09:37:29 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:41566 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfEBNh3 (ORCPT ); Thu, 2 May 2019 09:37:29 -0400 Received: by mail-io1-f67.google.com with SMTP id r10so2128851ioc.8; Thu, 02 May 2019 06:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=B+xPVEmnEjMU0Ad3Renee6pFrgDbiQQsdeLUcI8AfYs=; b=JdqOpQtYfXbIRepTKwf+lZ8T0Wuwp+vOqh4A0y22ptz76WoNHikdXWKCSf8bBXzSZt ZEDQW7VJKDDKMeqNj7YNE78rGYuRKHIGq87YRLsL2xGKSZDXEG6hkTOFFUPFse2+jJNF GdreRmIw6hpnczFm58PFhDvyzWsuxw22EPdzXMHhccl8uPtsR8yviGYPQCnwQYr7CzEp GNe6wFphuK2lv3WZcw9AwKvWElzZAerQLm0J5F/dcWvVprYM/b2S7zqOfZcgTpa5yT5U u5ixzZbpVMROC58XjyeUXNtlZ9f10uunpqlMGwEJYeMD/e+y+8QEaLWwZa6qYUhoP1gR T/iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B+xPVEmnEjMU0Ad3Renee6pFrgDbiQQsdeLUcI8AfYs=; b=SAr6dyKFeL950m+lCyYna9svVEI4rhf/S55nWOiY3cfR6ED6g4aK9oT8D+aiO0JUeC Jns/rHpvKfxArXpTDuNUrww2OGshmGighk+nShLLWBfWHPWn7i5GrzS/JFl/xexXAxP7 uXjHTgVBoEXaPdqd2aUefI6uqniKss9SKRrBze6UDXQVxmA3J0f4OtvpZ4aIms9/WG7y TN5tY+/XLJ7EhwpJM49Ip3bciQ7x0i5tZnt0phStx8rbFfzaWtncyY89C2Y3H9HmeJjp cu5VviJsSueTqmfjmwQHogENtCw/TLdSQZTnV+f88wKX8ULBD1gdULXvxDAQmerJrHhb ojxA== X-Gm-Message-State: APjAAAVxqb/mdUBX8quHhB8CeImc8jWA/GEtJbOGXL/0dIBMYsvEVXDq 7jW3+EBSYkQT6Qk/zJDTds812E8Z X-Received: by 2002:a6b:2cc6:: with SMTP id s189mr947957ios.303.1556804248595; Thu, 02 May 2019 06:37:28 -0700 (PDT) Received: from ?IPv6:2601:282:800:fd80:7d41:7f77:8419:85e7? ([2601:282:800:fd80:7d41:7f77:8419:85e7]) by smtp.googlemail.com with ESMTPSA id i24sm7463608ioh.60.2019.05.02.06.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 06:37:27 -0700 (PDT) Subject: Re: [PATCH net-next 2/3] netlink: set bad attribute also on maxtype check To: Michal Kubecek , "David S. Miller" Cc: netdev@vger.kernel.org, Johannes Berg , linux-kernel@vger.kernel.org References: From: David Ahern Message-ID: Date: Thu, 2 May 2019 07:37:26 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/2/19 6:48 AM, Michal Kubecek wrote: > The check that attribute type is within 0...maxtype range in > __nla_validate_parse() sets only error message but not bad_attr in extack. > Set also bad_attr to tell userspace which attribute failed validation. > > Signed-off-by: Michal Kubecek > --- > lib/nlattr.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Reviewed-by: David Ahern