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 F2F5DC433EF for ; Fri, 18 Feb 2022 17:20:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37E096B0074; Fri, 18 Feb 2022 12:20:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 32D9A6B0075; Fri, 18 Feb 2022 12:20:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CF726B0078; Fri, 18 Feb 2022 12:20:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 09FEF6B0074 for ; Fri, 18 Feb 2022 12:20:06 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B59D7180FE112 for ; Fri, 18 Feb 2022 17:20:05 +0000 (UTC) X-FDA: 79156563570.16.0B64010 Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by imf14.hostedemail.com (Postfix) with ESMTP id 2E98410000A for ; Fri, 18 Feb 2022 17:20:05 +0000 (UTC) Received: by mail-oo1-f52.google.com with SMTP id r41-20020a4a966c000000b0031bf85a4124so4325691ooi.0 for ; Fri, 18 Feb 2022 09:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9CKMthUXCokgWPQMB0IqyzdQ/Xmbb9rlJivmagQi36I=; b=cydyiGcMci/xbRpUq63u1Hv+UdC/Vor48jhWgM7lnEFrIn3NnvwrUKdNfQL/0Fw3sF BPu6GRfWcYeuJIW0u0sEfSq/qHLjsHrf0Lr1QlWxT9DHzJ4CtDczMy2Ih6PCgNjqFMoe 0Jwiw76Ky/0w+VPlCcij25Qcmzrr4WJfMVppv7iJxRlseur+qiVYeMkBO/y1cvuQqCll qntNTuHAjURsYJVdD8NLvjqIb56sxiqWTxTy/6IZzvOt/MtWGDXvw8lTBJ9E4rMIIT+/ o7qHHhgWo8AD24vQQnBiC2Ygm1AUVGrIgmhYLjtfUtM431V/1dc62FN14QHkSBMze8GV /99g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9CKMthUXCokgWPQMB0IqyzdQ/Xmbb9rlJivmagQi36I=; b=IGsBB8/sxVhw6DM9+68vinA7MM52mEb7SMOhRQY/RHqAuyawxCUE34KRlkD2XO1ztG GXFuQVQE0TAjwl+XzMsgSyYf2IuL9CwtXmsmPvEcXbvyafVhGK/gLZitm7uFt9ar1/eM 9a1z8iQjzmzaMu/03ux7S5WGP2f9Q3ionPaEP9d/3rwLtaXkKULdQHFohZiSlF9NX/kP Tf1YZaWMOSK01vEXVnmuACKtn8Q4QRPy55z7aqSGm7HrSIb+bJ/xCdKfVzekA2+HIX8I ANqlEYc7OgIWxcBvXCSNN+k22AFMK7EUIy88KQm1LT1GW4u0pdEmbkvDX15s2tm8zJj4 I4fA== X-Gm-Message-State: AOAM531XIFGlwARcu9C8b4TcVYJoZ201SB3YKih0WyCGpydtyAQobGRJ RP67dcJh36JUoLlZssIH7+TjmXsm2audD0coblqVcQ== X-Google-Smtp-Source: ABdhPJy4WTc78tZjJuxIgpcdJcD0ARkv52fe0fcQtgKg4EF2No3CqEz35B6g2+kkVmHNmdLz8XExDdjk1pj92tWB4lE= X-Received: by 2002:a05:6870:12d1:b0:ce:c0c9:6e0 with SMTP id 17-20020a05687012d100b000cec0c906e0mr4581469oam.306.1645204802484; Fri, 18 Feb 2022 09:20:02 -0800 (PST) MIME-Version: 1.0 References: <20220218131358.3032912-1-gregkh@linuxfoundation.org> In-Reply-To: <20220218131358.3032912-1-gregkh@linuxfoundation.org> From: Nick Desaulniers Date: Fri, 18 Feb 2022 09:19:51 -0800 Message-ID: Subject: Re: [PATCH] slab: remove __alloc_size attribute from __kmalloc_track_caller To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable , Kees Cook , Daniel Micay , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Nathan Chancellor , linux-mm@kvack.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2E98410000A X-Stat-Signature: ctwic9qofykd36hmwrfi94bceufefd9t Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=cydyiGcM; spf=pass (imf14.hostedemail.com: domain of ndesaulniers@google.com designates 209.85.161.52 as permitted sender) smtp.mailfrom=ndesaulniers@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1645204805-334262 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 Fri, Feb 18, 2022 at 5:14 AM Greg Kroah-Hartman wrote: > > 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. Sorry about the mess; we'll get it cleaned up! Acked-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/1599 > > 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 > -- Thanks, ~Nick Desaulniers