Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1823944rwb; Thu, 29 Sep 2022 02:47:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LtzEULJK6XBEhm5AZiYK5ABQjht2j9UuYE+rmzs1gss0pCThTTGwvbXUAkCdBxc22uTG/ X-Received: by 2002:a63:af03:0:b0:434:305b:d25d with SMTP id w3-20020a63af03000000b00434305bd25dmr2175638pge.214.1664444826527; Thu, 29 Sep 2022 02:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664444826; cv=none; d=google.com; s=arc-20160816; b=NdKNUggbNcb1UulKfOrbF5JszaxcZ7fCzLhrRB98DctCD4OfSTmiaYbW9l9cz4Zrcw uq08unGxrDuHCYozBUe5zxT7l0Ikm6+ZvAJN0yHxSzO1h2XXShtrM6PuMsvkms1ok0s/ 6S4EwNLhk8iODi7RP7TGkgdAxDTX6IkZl/pvh9g18F0QfRLw0mkv+Kx2tkAHlQvSv7sn GdWwzQpqZg/p74qBcZ9fBMjpntHEQq2TmTDzEXYP904AbIEmvF+p9NvZQfTwvQEWm9Dm Vk4sJotiJyEje6SqizljiIC0eRbtJPMYnzNb2phL1tqqG4AICdLkgCJNwxMr81ADWU08 phcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BHx1zCDSdTBNp89joh9T11xCS+o76HH+zzILWZ9znzM=; b=XRveQYj8WMJ+10GJHJibjlfYtnvoy36DNmLJ7QFN0z/pfLJDuuOCpFFgfRys8gguVb 9rmSODQiubNUgAqmskw4OYiSGJYSQDDcBYZL4lXlvhE+ONdtJeyWJghVkF0+/P/I5MqY x7kG2MqkHSbmyFTyfSYzmy+AE41CFScaqzWZE9KGe6Ms13ibUwivMp0Rr6ZR5OEB5HBk mLjU78M08o7eaMojhVLW2hMEonyra8DGlXtAORjmrUJh1bdsFmuSswfxo5Af659TUB5X 3P8tDJlxsqh3aFntWqndWd6JTOeh+h16q/iwa/TyhFwvnGjrpS81fLNEIioQ8XSgzmR8 IHwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cspSs7H3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i194-20020a636dcb000000b0043cab865857si8386299pgc.250.2022.09.29.02.46.55; Thu, 29 Sep 2022 02:47:06 -0700 (PDT) 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=@chromium.org header.s=google header.b=cspSs7H3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234890AbiI2JlN (ORCPT + 99 others); Thu, 29 Sep 2022 05:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbiI2JlL (ORCPT ); Thu, 29 Sep 2022 05:41:11 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DFBF63F28 for ; Thu, 29 Sep 2022 02:41:09 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d10so959828pfh.6 for ; Thu, 29 Sep 2022 02:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=BHx1zCDSdTBNp89joh9T11xCS+o76HH+zzILWZ9znzM=; b=cspSs7H3LyUUSs9vPwD5J2NT3ZdlPiwG8IHc50VADMxkebb+9p3OuMrwi7FBjgRBeX VuNTP4/zfWvJ6R4UK2p9BjXml4R0tE+X+qvG7jBzyNaXkYIVKy2wpWPsBHvfHXtMtw4Y 0Wjz+oNIijRd1Y6NUhEv5/0vYUzDo+wZ4+3Lw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=BHx1zCDSdTBNp89joh9T11xCS+o76HH+zzILWZ9znzM=; b=jx9smwMfr0rDroAwt2Cgik8ZlGEy1BjvhnvT8aoor7gd5Nv2/ekynHsCrygj5rcCae ZOMW+rutfLm1nFXQbhq325bArmS7xNV/euGAEEfvKWZuQXJOLb8UFpmusw7lhoIvVyP0 x4wYGyr4Uc+UtGF5PV+MCErcI2F3frbR8KYikFYLl8qMO4vvnXDf0Y6rf+dqCZi01QBd Mreu4ZROce49O5TdTXp+cvzJ4DjTcylUWACtdFlfP1LNASrIyBRfSIijWllMGSKUdTxC IGzUdB43WpXxTaHj890aNT41CRh85ibtwUcnRUx14alBcmfEuY3X6ld8bRevCEy5HM1e yQBw== X-Gm-Message-State: ACrzQf1yLyv6ALZMSr22bRdPOihqADLSlX3t1qaxduaGDsoyhIUcXDNF ehOHKoO888pYTJXKroYxC+nWmg== X-Received: by 2002:a63:91ca:0:b0:436:64db:c902 with SMTP id l193-20020a6391ca000000b0043664dbc902mr2134275pge.87.1664444468572; Thu, 29 Sep 2022 02:41:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o2-20020aa79782000000b00537d60286c9sm5588429pfp.113.2022.09.29.02.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 02:41:07 -0700 (PDT) Date: Thu, 29 Sep 2022 02:41:06 -0700 From: Kees Cook To: Vlastimil Babka Cc: Miguel Ojeda , Nick Desaulniers , Andrew Morton , Yonghong Song , Hao Luo , Marco Elver , Geert Uytterhoeven , Alexei Starovoitov , Kumar Kartikeya Dwivedi , Rasmus Villemoes , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] compiler_types.h: Test for __alloc_size__ again Message-ID: <202209290240.A2C342CF30@keescook> References: <20220929081642.1932200-1-keescook@chromium.org> <0eb638e3-b9ac-6dec-6881-b885c7874b45@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0eb638e3-b9ac-6dec-6881-b885c7874b45@suse.cz> X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Thu, Sep 29, 2022 at 11:14:47AM +0200, Vlastimil Babka wrote: > On 9/29/22 10:16, Kees Cook wrote: > > While the "alloc_size" attribute is available on all GCC versions, I > > forgot that it gets disabled explicitly by the kernel in GCC < 9.1 due > > to misbehaviors. Add a note to the compiler_attributes.h entry for it, > > and restore the #ifdef in compiler_types.h. > > > > Cc: Vlastimil Babka > > Cc: Miguel Ojeda > > Cc: Nick Desaulniers > > Cc: Andrew Morton > > Cc: Yonghong Song > > Cc: Hao Luo > > Cc: Marco Elver > > Reported-by: Geert Uytterhoeven > > Link: https://lore.kernel.org/lkml/CAMuHMdXK+UN1YVZm9DenuXAM8hZRUZJwp=SXsueP7sWiVU3a9A@mail.gmail.com > > Fixes: 63caa04ec60583b1 ("slab: Remove __malloc attribute from realloc functions") > > Signed-off-by: Kees Cook > > Thanks, I decided to late squash it so we don't needlessly cause issues for > people doing bisections with gcc-8 later. Sounds good to me; thanks! -- Kees Cook