Message ID | 20210818214021.2476230-3-keescook@chromium.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=AujH=NJ=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B013C4320E for <linux-mm@archiver.kernel.org>; Wed, 18 Aug 2021 21:40:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 06A5061106 for <linux-mm@archiver.kernel.org>; Wed, 18 Aug 2021 21:40:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 06A5061106 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0CB6A6B006C; Wed, 18 Aug 2021 17:40:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 052D98D0003; Wed, 18 Aug 2021 17:40:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0E0A6B0071; Wed, 18 Aug 2021 17:40:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id BB51D8D0003 for <linux-mm@kvack.org>; Wed, 18 Aug 2021 17:40:39 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6796680790E7 for <linux-mm@kvack.org>; Wed, 18 Aug 2021 21:40:39 +0000 (UTC) X-FDA: 78489520998.04.42DC7AE Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf04.hostedemail.com (Postfix) with ESMTP id 2636D5000307 for <linux-mm@kvack.org>; Wed, 18 Aug 2021 21:40:39 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id 17so3731947pgp.4 for <linux-mm@kvack.org>; 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=Va2NmN9YktqkYsuk7QuGGVAZluT5dX89i9mG99WC1ZvfHofFiaNEp8cndTjL0rnPyH fGLcqWbBcE2IFGFncM22pl4mKctdLJBXSnxpW0WUj61wj9uFrERiDfig2ADbd+vkhhH/ MHVVLkF4RyS+Xw67QPkPzJqp0ZMQWeB+JVjtPqK4zIWGjkUmdfQbbh2zv8sof3v6ZnaA vkFoErOk1XwWDhctl394VnKi5ieNVJVyn9q2pWr//lFw+o+mrTe5PiTHtRfDOPXpaQGK ScSMS0aG1AylHy7aYltbLsdtLcC1dnZYcES1PmDPWPiZDKr5DjZO6GfyMEkQCwn3IVnS dynQ== X-Gm-Message-State: AOAM531jBnHSa/3NBTMVxpY110mJfuqHkuFSPYY9b+/TmT611x2NwUsI 48MwJYRVJp+wq6uyf5Dbk29soQ== X-Google-Smtp-Source: ABdhPJz4r38rCjQXBAdz5RKupPpOX5AXF2/LNIdBOa/52R9ZgKDp5P005icezNJ91KF+IbpL+Yvx7Q== 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 <keescook@chromium.org> To: linux-kernel@vger.kernel.org Cc: Kees Cook <keescook@chromium.org>, Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>, Dwaipayan Ray <dwaipayanray1@gmail.com>, Lukas Bulwahn <lukas.bulwahn@gmail.com>, Miguel Ojeda <ojeda@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Andrew Morton <akpm@linux-foundation.org>, Vlastimil Babka <vbabka@suse.cz>, Daniel Micay <danielmicay@gmail.com>, Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Michal Marek <michal.lkml@markovi.net>, 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 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=IVcXEnYG; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf04.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.181 as permitted sender) smtp.mailfrom=keescook@chromium.org X-Stat-Signature: so1x5nf63a3d51urhzy9au6r8ibunezu X-Rspamd-Queue-Id: 2636D5000307 X-Rspamd-Server: rspam05 X-HE-Tag: 1629322839-324542 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Add __alloc_size() for better bounds checking
|
expand
|
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__};
Make sure checkpatch.pl doesn't get confused about finding the __alloc_size attribute on functions. Suggested-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)