Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1534146pxb; Fri, 18 Feb 2022 09:41:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0HHNGHmRxHxQ//5w5GLz6T3I5BNjXsqAn6pFbmcJYannSVYUUN/vcgyJuiuoCArLMglG8 X-Received: by 2002:a05:6402:4309:b0:40f:8bf7:18cd with SMTP id m9-20020a056402430900b0040f8bf718cdmr9372725edc.79.1645206085233; Fri, 18 Feb 2022 09:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645206085; cv=none; d=google.com; s=arc-20160816; b=QgAkGHMPCQcVsOVXmqhR1JsDMkgFdGZNdM6cDyhkV2AawcfNt/5CBBYXwwUK5IjT2q AdrnMM9Lm4PuBSYtcjXPrR7/qy9UkyK4YNi7szT60WWPKaB0nA0/MaFbr47QMpQKbCvW ysaGpahnm6ZTWcda7fPFJdr0Kt4xPRi5N6YJ1ogyNrOw/eSgkg+UYYu+zzi7b5wa2k9y e5x9hbJModxfGH0N5/FSFmZThWFmpHKtnr23N5TKDqNUfP6euXInucm8wiSLWz1GsblB EvSBn1zcG28vkjbZAMsCPV66EXeRL9Xdre7YZv82VeVTCkI3zMmEYmCAGRkmeIBPRSNY sZSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9CKMthUXCokgWPQMB0IqyzdQ/Xmbb9rlJivmagQi36I=; b=Sz19PgrnLYtxRNF5bj/461kBLNaOjdmjhGYZxnn35+QLpSS5f9N2Yk5HBdDfBBPsJT 7zHeIi/3V8harFx5YuTnA6DRsqYXyUvt6heZTwRDziy6BeAmBLciR1FPV0sCETEOcsD7 gOyQmZyYhNQ56f+sezgnk3Q2JRgCBHI8u7h1x2HMW3IlWa+NC6HFVcYIQrTROArcJQpQ Rhdfg3QcPyDzquin5o0qhTZrdXM0dzDIrwsKKyDgKFxROHgwn+3BNASf+pAhyjfwj5sr Nj3T/7JE9jnU6+vEq2MUwb03ML9vVyS/WafpXr8VSiYTa5jfXzjG4Ae1mJTogQ0WMEDD o0Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cydyiGcM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10si6611866eda.379.2022.02.18.09.41.02; Fri, 18 Feb 2022 09:41:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cydyiGcM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234920AbiBRRUX (ORCPT + 99 others); Fri, 18 Feb 2022 12:20:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233532AbiBRRUV (ORCPT ); Fri, 18 Feb 2022 12:20:21 -0500 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEDED1074CB for ; Fri, 18 Feb 2022 09:20:04 -0800 (PST) Received: by mail-oo1-xc32.google.com with SMTP id y15-20020a4a650f000000b0031c19e9fe9dso1298486ooc.12 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=6LMGWrbl1q3qH/mPzx9VSmFbr/TKH6YEP+uGEKaKosKQ2nU9yh0H/9U4UJ4wpZyGDt 8YarktiGMEMhsY5oigB29HTAfWI7lQr0yNE4TdkBuVUZacqV+0c7Yb+v3pzH2CwLZh3E eqGf89uYlunlNFHCl2lBUsSJkgx7RmDjcT6wO2+dmgytQEQ3EpEYAAol4heuZ4p8NhEx bih84XG8IZuxa1MdthXGiA6r90S0BNqvNWIiVqNcHGzR3uv3IbFVzNr2ZctneDwgAzIe UgMf0AumnuJLHl+N0y1k+WjxXKZM5F3RZaAps4zRu/3DwXf5NNUpFrHL4KYxY15smZ8t 3RFw== X-Gm-Message-State: AOAM533GfrfLNMlgfXY4v/N9wm9W/5EcfncZfuZgUrLXMgdhcEr7JWFO zyiEQV+hRGwXn8XyL6WjdTF5zszgF4hrB0oHnseAyg== 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-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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