Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp16367pxb; Wed, 18 Aug 2021 14:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbq+T/ztQ2IrcA8Ou5mCUkTYjW4qv25EjR9wswoNobCcj2ZQhlTAAtIzEXZeT+0mM/1hoI X-Received: by 2002:a5d:97cc:: with SMTP id k12mr8733950ios.4.1629322953551; Wed, 18 Aug 2021 14:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629322953; cv=none; d=google.com; s=arc-20160816; b=G3Karnkqiv3OhG4TJDqvheqyoksvOcrKdhKjnQ5LwJzOALo2rYeL7WptDde3ELIHmk 20NwCiWZ+3o77w6aYOCYfU9Hgxrz/GGlpLnS8J4AnhWN5tC+YU6qYZYgauINZln9UQ2W b9h7mxSR/0GZhbDqWFXy4aTgEuvI7iFGni1tFOQT9fkgmQMmOrW/z7ZvoXm5o2/sMuvB CJ/MVnX4cuDclAsu2rIcSsUOUSrdwUhQa1gvUIPWcKgBIB9+UZCiPJ1Ncl04ssse+fCf 8qMvmL+8mlN6hDtbWD+7Ug5eyNZG7SKH+f1zv7LxCGvpDGdj8xqEJdYNzmgHZrssdA+S CjQg== 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:date:subject:cc:to:from :dkim-signature; bh=j9DqXIvxCIM/uJCCeVoynzfDym6qm3dtyLAT5E0EvZQ=; b=xY2b2Ct8eRKIpeNpXvpJ5CY/yQajAWaLfFzHLIT1JBAfMx3Bx/OPa0zkBS+3flxw9J 7qkQOmmemtmPONkQIT7J2YVAbx7hrJkkZMKj24bJIWwqF8UmAdRLFAc3XOd+1N0bMaLg bYqG5YHHPaJsu2Y/LpWoDJ1im07t9xOWKB7rri0Hu1NR69hI94C3uiwCuPdLNAOqqDdh r+OHzbOw11f1aZNSnme8iGOEUn6EFrdUGs96CRw6i51S96oMYdl+0/iMVuqfuQ/UdqPi +Np99p6EaBPsYHn00SpbXGovMgQz77sOMbNMzukmobJaMFvOwQ4/4jJsSWqOy+esi98K NBTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IVcXEnYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si1143322iln.136.2021.08.18.14.42.22; Wed, 18 Aug 2021 14:42:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IVcXEnYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234266AbhHRVlT (ORCPT + 99 others); Wed, 18 Aug 2021 17:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234079AbhHRVlN (ORCPT ); Wed, 18 Aug 2021 17:41:13 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4638C061764 for ; Wed, 18 Aug 2021 14:40:38 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id r2so3737407pgl.10 for ; Wed, 18 Aug 2021 14:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j9DqXIvxCIM/uJCCeVoynzfDym6qm3dtyLAT5E0EvZQ=; b=IVcXEnYGIgkxp08bXfmT4Z/QM2rlhkGqHMb4AimQ1lPm8+B8jgH7qoE/Y1k6f6RIB0 f1loyx5+TOZGqY4BAB479NEA0Wdx5Wwah4KXeOk3PuftyMLStwSpM0LpD0If6gUUc2td ekGdIHDc0xSjaMo9BoL1YSg6vAPozzOgdXG4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j9DqXIvxCIM/uJCCeVoynzfDym6qm3dtyLAT5E0EvZQ=; b=SipkrsqlQoFTDSMDaUh19u4/SSUvKoKaLnmab27vdzCqLfXTlaQejjiVsk0UEFpTDO 2mLtrY6OI1pG00aGGLu6da5A657xgEuwZjzRKDk6GemIiIRO+2tQgVpeP5gJKNq8Z3uW 6tdu//EXcEgsHB8MKAU37VeNitjtO0jXMksZWjyxc2TNbuv5MixK1zOmIRFvVntdengW eDy4AoPU2mUiz9DoXkm4lkpIkQFdJTDjc9BS5r0vYe55wscQxH6YmgHqj3ql/93d3Cpw ReCOA7Mb7D8oBsUvS+mT4cWvisDSekkXfIzSOMKI+bZhs+uUDVVY8m/QiHXCGAuVBz5n Y95A== X-Gm-Message-State: AOAM533erz5gw4alWANuTJ1LLz16LhV3/m+eeisI44y9KaTQd/qbd8gd RGqGsQAleSmI2LeOq5pVPgkXrg== X-Received: by 2002:aa7:87d1:0:b029:3e0:e44b:6429 with SMTP id i17-20020aa787d10000b02903e0e44b6429mr11485358pfo.81.1629322838217; Wed, 18 Aug 2021 14:40:38 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v20sm846721pgi.39.2021.08.18.14.40.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 14:40:36 -0700 (PDT) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , Joe Perches , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Daniel Micay , Dennis Zhou , Tejun Heo , Masahiro Yamada , Michal Marek , clang-built-linux@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v2 2/7] checkpatch: Add __alloc_size() to known $Attribute Date: Wed, 18 Aug 2021 14:40:16 -0700 Message-Id: <20210818214021.2476230-3-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818214021.2476230-1-keescook@chromium.org> References: <20210818214021.2476230-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=912; h=from:subject; bh=6Teat8DBaEMMX6uWXJym8AvRSHRT+DxfYZVALLaAHjA=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBhHX5DBAWPRR5j7mh8AUY9CepoJIBrtuPXzvvnwNso swpVkhiJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYR1+QwAKCRCJcvTf3G3AJh7KD/ 96JnKMQjuQw7QtjrbSbFxElQz16CfGElDpaJ1vmSZyt5B94MVj1bxxm20gR7QAEGbHyBPNyae7HA80 /eGzg2PywQcfB6x4/I0U1vis5JgM8dvYpANANpoi0nYzP/cgkM+ZI7evoAF46FggzG2+O3idTnEgzr DpYQ9H3D3JyEL/TqDbNFh5DgovOyydTKuMWa6ME5T91vVKPrw0ObE03YKzBPehWKbdW+AEzAANor1b cGwSAKuVy32QNt3mPR/IsRkGWSAV0+Kni+8BgmXt/8TTLhxuEAUp5KpQc3061OiwSbbniWGU6TNZTI ajGROJBqm4tAGaBQL2rqL+nMCFm+Hh92wBwgxrJLDur7oiuOii9ZnNgIDx7k+GgFqEYf1HSp0TglqQ M4nuT/MvfO0c/1/F3hGvEQHp4Rp/KOpGTu6z0kJ3RePjPVqMySTot3hJ1JwIIDJha2OlSOXczxBN+E A4P3QaN/sEpO0KRIjbAZeyCCukgg/Ca2QlCCDxETAq2aKCdq6NQJbNwHvTYLJrOqqNAzGBwr++Rt+w 5IqUpM7ekMoEWy10JxkE63eElBxOtaboQ9rYmcAM8Rpg48Y42Dw+WY+QKeIcl/Jwphs5jMUEmACxC1 jYYU0zHh/C+ep7ngW3J3xPyoGZJeNxIzQ1vWRqLiIj4Ua4u/JbSYyCobzvNQ== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure checkpatch.pl doesn't get confused about finding the __alloc_size attribute on functions. Suggested-by: Joe Perches Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Kees Cook --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a65753c05a69..e4b0def605c3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -489,7 +489,8 @@ our $Attribute = qr{ ____cacheline_aligned| ____cacheline_aligned_in_smp| ____cacheline_internodealigned_in_smp| - __weak + __weak| + __alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) }x; our $Modifier; our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__}; -- 2.30.2