From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 508AFC4321E for ; Tue, 29 Nov 2022 13:51:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D460F6B0074; Tue, 29 Nov 2022 08:51:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCF2D6B0078; Tue, 29 Nov 2022 08:51:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B49206B007B; Tue, 29 Nov 2022 08:51:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9FA626B0074 for ; Tue, 29 Nov 2022 08:51:29 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 227E380EC6 for ; Tue, 29 Nov 2022 12:33:38 +0000 (UTC) X-FDA: 80186420916.12.18B070D Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by imf20.hostedemail.com (Postfix) with ESMTP id 954191C000F for ; Tue, 29 Nov 2022 12:33:37 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 571E25C00BC; Tue, 29 Nov 2022 07:33:35 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Tue, 29 Nov 2022 07:33:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1669725215; x=1669811615; bh=IqZipqd0Jq L5tnglRr5e29BfFvwlHJufO9Ma0d1pQ0E=; b=eHpcM6SZLoo4/CPogT3l+vk4mD 6RQvCq32VDsRJ+RrliP3bJ/vEjyVomm3xgMNMNjA0eDKPjJ1JmlQ4JQo8BukXEL9 h358hsP8VJOH9aAszO25g8chHvG2mUZbZhyqY6h+qeomtcWAWL+6qJL691CnFAGe HhxQm1LcSF/Q8cqyhD8mpB8BiQTrNjDfbIEQ4BBEPTlUEfJExg5/hqVm3VcCBCDR ae6Q2S6iDzGBRtaB7ljYLh/8r8+WXxJLxqfF7WWa5sEsv8qPUWfuvUNskdNa6QiA rcLu4ddclbeWBN/aWsW/K6/V+ihYVpBjMhhXMU8bjtbA9M2uOe1GJUSssaTQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669725215; x=1669811615; bh=IqZipqd0JqL5tnglRr5e29BfFvwl HJufO9Ma0d1pQ0E=; b=HkCxwtOsOLvnCGcKAxedQxQ7kUYyjzjIEvch79MlAP5I WtFDVLIsaJ16v0yvGZBUVmyv6axgav4MS77qa2k1fx2OCOFg+fQMr25J9z0bNA/Y bskE4Xo+lnxTz/N8+2itEvXCstSvhL5KX5DlhohADAVzjbz4wFtgvbRURgHSYvNk mvlvt4Y6KGrPsNm7DBxk6UO02+nG11YfQiGvrGl+di6A+JJOKiwr41PnT9z/YhWJ Wz10XTOW57VG6VRIbgNJy18+fCTpZHNPEJFkpP3tRZBbSG0ApFO6r6KwYAfFeJH7 Fimdg+0BsEoat3qlESRAM+Qdpe6eEe4/TiDee5SdPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtddtgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeeigfeiieeiheejjeeiudekleevvddvffetieehteeikeeigeeiffdttdeftdeg gfenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9B4EAB60086; Tue, 29 Nov 2022 07:33:33 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <63ced4a4-33b9-4c03-8d7a-987ceb1fc2c7@app.fastmail.com> In-Reply-To: References: <20221101222520.never.109-kees@kernel.org> Date: Tue, 29 Nov 2022 13:33:03 +0100 From: "Arnd Bergmann" To: "Conor.Dooley" , "Kees Cook" Cc: "Vlastimil Babka" , "David Gow" , "Christoph Lameter" , "Pekka Enberg" , "David Rientjes" , "Joonsoo Kim" , "Roman Gushchin" , "Hyeonggon Yoo" <42.hyeyoo@gmail.com>, "Rasmus Villemoes" , "Guenter Roeck" , "Andy Shevchenko" , "Paolo Abeni" , "Geert Uytterhoeven" , "Nathan Chancellor" , "Nick Desaulniers" , "Tom Rix" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 0/6] slab: Provide full coverage for __alloc_size attribute Content-Type: text/plain ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm1 header.b=eHpcM6SZ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=HkCxwtOs; spf=pass (imf20.hostedemail.com: domain of arnd@arndb.de designates 66.111.4.26 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669725217; a=rsa-sha256; cv=none; b=lRk4U6Fl0UoECiycwy2Gv883zvT+5kT6u5CL/c1VYxQ3CHGMTPzimUhrVsyjwT3zTSlF/k thYKX2NNL9aWOG3BFx9PXGDh6GK5qDwwf3JiuD8+B50nt6Kq423YVZH3gQFn8so7sULwP9 V805TQAWkryYZPRE+YSMhpOiRMmnm5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669725217; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IqZipqd0JqL5tnglRr5e29BfFvwlHJufO9Ma0d1pQ0E=; b=lEhas7Ig4wr6DLwhiz5PQLI0xSKKIS0OBPSpvurWZDf5j7fVmrqLEHK7DIQNbTaHYDptCg uG++x2KSxh+KrDe+mc9vXR02sVkHFHntuBo7v/J/kIIjlW9so1Of2BUP5UluR7xwVH8qIW WTV+jD+b9cOSsCUm2Nz4tdu60vfu508= Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm1 header.b=eHpcM6SZ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=HkCxwtOs; spf=pass (imf20.hostedemail.com: domain of arnd@arndb.de designates 66.111.4.26 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 954191C000F X-Stat-Signature: th346orgnhmbdy76h13p34t53b81ebw5 X-Rspam-User: X-HE-Tag: 1669725217-818871 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: On Tue, Nov 29, 2022, at 13:24, Conor Dooley wrote: > On Tue, Nov 01, 2022 at 03:33:08PM -0700, Kees Cook wrote: >> Hi, >> >> This is a series to work around a deficiency in GCC (>=11) and Clang >> (<16) where the __alloc_size attribute does not apply to inlines. :( >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96503 >> >> This manifests as reduced overflow detection coverage for many allocation >> sites under CONFIG_FORTIFY_SOURCE=y, where the allocation size was >> not actually being propagated to __builtin_dynamic_object_size(). In >> addition to working around the issue, expand use of __alloc_size (and >> __realloc_size) to more places and provide KUnit tests to validate all >> the covered allocator APIs. > > Hello Kees! > > It would appear that one of the macros you've added here is doing Bad > Things^TM to allmodconfig on RISC-V since the 22nd: > > ../lib/fortify_kunit.c: In function 'alloc_size_kmalloc_const_test': > ../lib/fortify_kunit.c:140:1: error: the frame size of 2384 bytes is > larger than 2048 bytes [-Werror=frame-larger-than=] > 140 | } > \ > | ^ > ../lib/fortify_kunit.c:209:1: note: in expansion of macro > 'DEFINE_ALLOC_SIZE_TEST_PAIR' > 209 | DEFINE_ALLOC_SIZE_TEST_PAIR(kmalloc) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > CONFIG_GCC_VERSION=110100 > CONFIG_AS_VERSION=23700 > CONFIG_LD_VERSION=23700 > > The report came out of my CI (which I should have passed on sooner) so > I do not have anything other than stderr - I can get you anything else > you'd like/need though if you LMK. There is generally a conflict between kunit and the structleak gcc plugin, I think the Makefile needs a line like CFLAGS_fortify_kunit.o += $(DISABLE_STRUCTLEAK_PLUGIN) Arnd