{"id":2221277,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2221277/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-um/patch/20260409052038.make.995-kees@kernel.org/","project":{"id":60,"url":"http://patchwork.ozlabs.org/api/1.2/projects/60/?format=json","name":"User-mode Linux Development","link_name":"linux-um","list_id":"linux-um.lists.infradead.org","list_email":"linux-um@lists.infradead.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260409052038.make.995-kees@kernel.org>","list_archive_url":null,"date":"2026-04-09T05:20:42","name":"[v3] gcov: Disable GCOV_PROFILE_ALL on 32-bit UML with Clang 20/21","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6a28edc704344c7a0a2bf51df7305fec211052fd","submitter":{"id":85255,"url":"http://patchwork.ozlabs.org/api/1.2/people/85255/?format=json","name":"Kees Cook","email":"kees@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-um/patch/20260409052038.make.995-kees@kernel.org/mbox/","series":[{"id":499235,"url":"http://patchwork.ozlabs.org/api/1.2/series/499235/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-um/list/?series=499235","date":"2026-04-09T05:20:42","name":"[v3] gcov: Disable GCOV_PROFILE_ALL on 32-bit UML with Clang 20/21","version":3,"mbox":"http://patchwork.ozlabs.org/series/499235/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221277/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221277/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tn1Dt/Qb;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=s6e803eG;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frpDd1ZS0z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 15:20:49 +1000 (AEST)","from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wAhos-00000009iTJ-3UTp;\n\tThu, 09 Apr 2026 05:20:46 +0000","from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wAhor-00000009iTD-2VUa\n\tfor linux-um@lists.infradead.org;\n\tThu, 09 Apr 2026 05:20:45 +0000","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 5CE04600CB;\n\tThu,  9 Apr 2026 05:20:44 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 09AEDC4CEF7;\n\tThu,  9 Apr 2026 05:20:44 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help\n\t:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:\n\tMIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type:\n\tContent-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:\n\tResent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;\n\tbh=LaM838BZ+jRYzrrooP9qVGSsfDal6qcqsPhEO0p4xtA=; b=tn1Dt/QbHD/Ap5g8EQelOysKUX\n\tUHirgHDrl/f19BtmutmKUQCs3DDWF/txI7iXHJVxANCHY3Ga53fRkX2UM9tAn2igIHMWxxRDSfYAg\n\t20/XZfMbSgLDQy3qx4Y+9qYiRuq2ivGeAxfkESgPm/WQpd8jtJJmyHg0itixvq+vEOHpWfrBgE+0M\n\t6Tb1/VdGnGfu+pNMVY7D4mfoomkV2rGOxaH6ijC5UUz9GNMf8H3AQfUDZYF+2vTr23GAamNA3pct0\n\tbjhBTFjWlFbJanrF8pAs3aOpjD7yjmWwFwnZTVjy1uiyM6ZFvgam8KyBfinfCa6bn73JEAnLtd6oj\n\tZbrX+NRA==;","v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775712044;\n\tbh=iSD8lx//1/eG9pu6VCuAmWIXKptBjif+THnfHLu57Wc=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=s6e803eGHZ7f5pAcGpSy62LjCUmp2EEphoJ7K+n5FnrTALwXBY/E9jYyD/AhavxA8\n\t f5o58JeRKyuX7aQ/9wxppGcImlZcsRRWBde6yOqJLcdzbqRnCPoKQ8BlkfW/QxYtot\n\t yrtETniNog8G+DzzuvH+5vNjISUWudoTFmtsTUfnDwYXTt16YzwUVIDTH6xtSpSvOL\n\t JggL868gL33D2gDQjZuWvbKC/siKN72J8GQ90txUl/fMy5NXDhKecgNwiB2kX4s7X0\n\t UDdDFDYuh6klvc4UrpNm4x/Xd2F6meVVbp+SIhQG2GhcWyYB0qB1R8oEK61HeqXrUc\n\t d8ClQdT2trLfQ=="],"From":"Kees Cook <kees@kernel.org>","To":"Richard Weinberger <richard@nod.at>","Cc":"Kees Cook <kees@kernel.org>,\n\tkernel test robot <lkp@intel.com>,\n\tNathan Chancellor <nathan@kernel.org>,\n\tAnton Ivanov <anton.ivanov@cambridgegreys.com>,\n\tJohannes Berg <johannes@sipsolutions.net>,\n\tPeter Oberparleiter <oberpar@linux.ibm.com>,\n\tNick Desaulniers <nick.desaulniers+lkml@gmail.com>,\n\tBill Wendling <morbo@google.com>,\n\tJustin Stitt <justinstitt@google.com>,\n\tllvm@lists.linux.dev,\n\tlinux-um@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-hardening@vger.kernel.org","Subject":"[PATCH v3] gcov: Disable GCOV_PROFILE_ALL on 32-bit UML with Clang\n 20/21","Date":"Wed,  8 Apr 2026 22:20:42 -0700","Message-Id":"<20260409052038.make.995-kees@kernel.org>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","X-Developer-Signature":"v=1; a=openpgp-sha256; l=2693; i=kees@kernel.org;\n h=from:subject:message-id; bh=iSD8lx//1/eG9pu6VCuAmWIXKptBjif+THnfHLu57Wc=;\n b=owGbwMvMwCVmps19z/KJym7G02pJDJnXzbXmbQrbJ+OnZaHhK/M/hX/p6mS3doXdIQ7ZSn/Fu\n BhNfAo7SlkYxLgYZMUUWYLs3ONcPN62h7vPVYSZw8oEMoSBi1MAJsLAwPA//tFOTYGCSH6Oy2cU\n n/Q92F/85+jv+R67uGc/ab7HyHA2meF/3C/pD2v1lq7b86Jo+9tr288HMlqtOfhTUTWRh0OBTU+\n XAwA=","X-Developer-Key":"i=kees@kernel.org; a=openpgp;\n fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026","Content-Transfer-Encoding":"8bit","X-BeenThere":"linux-um@lists.infradead.org","X-Mailman-Version":"2.1.34","Precedence":"list","List-Id":"<linux-um.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-um/>","List-Post":"<mailto:linux-um@lists.infradead.org>","List-Help":"<mailto:linux-um-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>","Sender":"\"linux-um\" <linux-um-bounces@lists.infradead.org>","Errors-To":"linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Clang 20 and 21 miscompute __builtin_object_size() when -fprofile-arcs\nis active on 32-bit UML targets, which passes incorrect object size\ncalculations for local variables through always_inline copy_to_user()\nand check_copy_size(), causing spurious compile-time errors:\n\n  include/linux/ucopysize.h:52:4: error: call to '__bad_copy_from' declared with 'error' attribute: copy source size is too small\n\nThe regression was introduced in LLVM commit 02b8ee281947 (\"[llvm]\nImprove llvm.objectsize computation by computing GEP, alloca and malloc\nparameters bound\"), which shipped in Clang 20. It was fixed in LLVM\nby commit 45b697e610fd (\"[MemoryBuiltins] Consider index type size\nwhen aggregating gep offsets\"), which was backported to the LLVM 22.x\nrelease branch.\n\nThe bug requires 32-bit UML + GCOV_PROFILE_ALL (which uses -fprofile-arcs),\nthough the exact trigger depends on optimizer decisions influenced by other\nenabled configs.\n\nPrevent the bad combination by disabling UML's ARCH_HAS_GCOV_PROFILE_ALL\non 32-bit when using Clang 20.x or 21.x.\n\nReported-by: kernel test robot <lkp@intel.com>\nCloses: https://lore.kernel.org/oe-kbuild-all/202604030531.O6FveVgn-lkp@intel.com/\nSuggested-by: Nathan Chancellor <nathan@kernel.org>\nAssisted-by: Claude:claude-opus-4-6[1m]\nSigned-off-by: Kees Cook <kees@kernel.org>\n---\n v3: disable via ARCH_HAS_GCOV_PROFILE_ALL instead (Nathan)\n v2: https://lore.kernel.org/lkml/20260408162607.it.347-kees@kernel.org/\n v1: https://lore.kernel.org/lkml/20260408005958.work.271-kees@kernel.org/\nCc: Richard Weinberger <richard@nod.at>\nCc: Anton Ivanov <anton.ivanov@cambridgegreys.com>\nCc: Johannes Berg <johannes@sipsolutions.net>\nCc: Peter Oberparleiter <oberpar@linux.ibm.com>\nCc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>\nCc: Bill Wendling <morbo@google.com>\nCc: Justin Stitt <justinstitt@google.com>\nCc: <llvm@lists.linux.dev>\nCc: <linux-um@lists.infradead.org>\n---\n arch/um/Kconfig | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/arch/um/Kconfig b/arch/um/Kconfig\nindex 098cda44db22..d9541d13d9eb 100644\n--- a/arch/um/Kconfig\n+++ b/arch/um/Kconfig\n@@ -11,7 +11,9 @@ config UML\n \tselect ARCH_HAS_CACHE_LINE_SIZE\n \tselect ARCH_HAS_CPU_FINALIZE_INIT\n \tselect ARCH_HAS_FORTIFY_SOURCE\n-\tselect ARCH_HAS_GCOV_PROFILE_ALL\n+\t# Clang 20 & 21 miscompute __builtin_object_size() under -fprofile-arcs\n+\t# on 32-bit, causing spurious compile-time errors in check_copy_size().\n+\tselect ARCH_HAS_GCOV_PROFILE_ALL if !(!64BIT && CLANG_VERSION >= 200000 && CLANG_VERSION < 220100)\n \tselect ARCH_HAS_KCOV\n \tselect ARCH_HAS_STRNCPY_FROM_USER\n \tselect ARCH_HAS_STRNLEN_USER\n","prefixes":["v3"]}