From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7A4A3211 for ; Fri, 18 Feb 2022 13:14:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B61C340E9; Fri, 18 Feb 2022 13:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645190048; bh=tYfeunHQUCJoMBW4KCGOeDi3CMtMJKFVuq09f4Qy3/c=; h=From:To:Cc:Subject:Date:From; b=vBbXWXZfhyx61GlN+4nIkKHAofV3Tmyr7SoPL/JEr5O8aDuGGFkaqtwjsuHp/aWJd NyVHxUGohJ8znulkcU6/mgN478hdbs6CnYqpPVU4HyjCX7mZdBjeSEtJOQLoG+JX8i tfgZ0yR1aFtzmkQnXpRV3CxMiyI7vkizA2SIxd24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable , Kees Cook , Daniel Micay , Nick Desaulniers , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Nathan Chancellor , linux-mm@kvack.org, llvm@lists.linux.dev Subject: [PATCH] slab: remove __alloc_size attribute from __kmalloc_track_caller Date: Fri, 18 Feb 2022 14:13:58 +0100 Message-Id: <20220218131358.3032912-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1953; h=from:subject; bh=tYfeunHQUCJoMBW4KCGOeDi3CMtMJKFVuq09f4Qy3/c=; b=owGbwMvMwCRo6H6F97bub03G02pJDEn8s6c4O30y6vORX/ORQXjx0QO+yZ+7OfqrVN2bJEW4TmtN 7uPpiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIlYJDIsaL/7pkRd/rig6sTwLMFXHx PEKo9OYpifbbZwheqTPMfejscylVHLrm1gNdQFAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Commit c37495d6254c ("slab: add __alloc_size attributes for better bounds checking") added __alloc_size attributes to a bunch of kmalloc function prototypes. Unfortunately the change to __kmalloc_track_caller seems to cause clang to generate broken code and the first time this is called when booting, the box will crash. While the compiler problems are being reworked and attempted to be solved, let's just drop the attribute to solve the issue now. Once it is resolved it can be added back. Fixes: c37495d6254c ("slab: add __alloc_size attributes for better bounds checking") Cc: stable Cc: Kees Cook Cc: Daniel Micay Cc: Nick Desaulniers Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: Vlastimil Babka Cc: Nathan Chancellor Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Greg Kroah-Hartman --- include/linux/slab.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 37bde99b74af..5b6193fd8bd9 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -660,8 +660,7 @@ static inline __alloc_size(1, 2) void *kcalloc(size_t n, size_t size, gfp_t flag * allocator where we care about the real place the memory allocation * request comes from. */ -extern void *__kmalloc_track_caller(size_t size, gfp_t flags, unsigned long caller) - __alloc_size(1); +extern void *__kmalloc_track_caller(size_t size, gfp_t flags, unsigned long caller); #define kmalloc_track_caller(size, flags) \ __kmalloc_track_caller(size, flags, _RET_IP_) -- 2.35.1