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 51E80C433F5 for ; Sat, 19 Feb 2022 07:19:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFEFD6B0074; Sat, 19 Feb 2022 02:19:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAE9B6B0075; Sat, 19 Feb 2022 02:19:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C75AB6B0078; Sat, 19 Feb 2022 02:19:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id BB2096B0074 for ; Sat, 19 Feb 2022 02:19:14 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 79FAF181B2E2C for ; Sat, 19 Feb 2022 07:19:14 +0000 (UTC) X-FDA: 79158678228.28.C104608 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 5F4F340006 for ; Sat, 19 Feb 2022 07:19:13 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 686E060C9B; Sat, 19 Feb 2022 07:19:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9CCAC004E1; Sat, 19 Feb 2022 07:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645255151; bh=5N9q8YGpLg7pzimVDpcpfsBGpCNjJr17vwBuSaeLOzg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z3JZA0jkkKEqYPSuaw6XQokUqkc1pHcCOFjSe3Kzf8MHcYJHvrHCzic06q6mfeKNR lYNN0vIvNCGoRQ8agRIGhqhtIq8cKGpX5vBVKgmd12VTQNL3YuMjIn2byIcjnmIoaX vkI2LkzgzqIRBlITVjf5gJrNpIwkHLga5cTH6DnY= Date: Sat, 19 Feb 2022 08:19:02 +0100 From: Greg Kroah-Hartman To: Vlastimil Babka Cc: linux-kernel@vger.kernel.org, stable , Kees Cook , Daniel Micay , Nick Desaulniers , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Nathan Chancellor , linux-mm@kvack.org, llvm@lists.linux.dev Subject: Re: [PATCH] slab: remove __alloc_size attribute from __kmalloc_track_caller Message-ID: References: <20220218131358.3032912-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=Z3JZA0jk; spf=pass (imf07.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5F4F340006 X-Stat-Signature: yrjx97dkobqk1bh1fw35ikh97hfbiy3o X-HE-Tag: 1645255153-589569 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 07:54:14PM +0100, Vlastimil Babka wrote: > On 2/18/22 18:57, Greg Kroah-Hartman wrote: > > On Fri, Feb 18, 2022 at 06:14:55PM +0100, Vlastimil Babka wrote: > >> On 2/18/22 14:13, 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. > >> > >> Could we instead wrap it in some #ifdef that' only true for clang build? > >> That would make the workaround more precise and self-documented. Even > >> better if it can trigger using clang version range and once a fixed > >> clang version is here, it can be updated to stay true for older clangs. > > > > It's not doing all that much good like this, let's just remove it for > > now until it does actually provide a benifit and not just crash the box :) > > > > This is only 1 function, that is used in only a very small number of > > callers. I do not think it will be missed. > > Fair enough, added to the slab tree: > > https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git/log/?h=for-5.17/fixup5 > Thanks!