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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7C6AC4332F for ; Fri, 18 Nov 2022 17:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241857AbiKRRGn (ORCPT ); Fri, 18 Nov 2022 12:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242432AbiKRRGf (ORCPT ); Fri, 18 Nov 2022 12:06:35 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312262528F for ; Fri, 18 Nov 2022 09:06:32 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id 6so5505592pgm.6 for ; Fri, 18 Nov 2022 09:06:32 -0800 (PST) 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:message-id:reply-to; bh=AGuGWp5XCDdHJkP/ZVzcY0JNFnAf0r/m3zS2HVfgluM=; b=EF20HVvgV91jn4cZ3X3NrdTFvw1O1FGOatUDshSJu6yJPlh+xkrX/7AsdG9iutTwh3 D2kSGxbYUBU3Nh7zBm54rQsCM21o1p1wb4g3y5FQ1cE6jG8zwnQ7sCpAp65yXz/8dAOJ DgZXfwYSGezpi9JmZc+1nFbRmCINaF3Upd3UA= 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 :message-id:reply-to; bh=AGuGWp5XCDdHJkP/ZVzcY0JNFnAf0r/m3zS2HVfgluM=; b=2IFIj5Iy5q4KlOi5a+Z4FYEbuBP48HKJT0U6Xvnmf/6mwH4Q0N7zfT0aU4GHxKtuTY FiuyFnwc/Lx3dd3r/nCOiGETQRCUlcdm5uoi0kdGJbgEbWYvMEpLifk4J3zI4DdG0SW5 n8o+vODKKrMEUqtQZY4t7t0+FsfYTjDkJhQf1twXwoXD81hpWTbqNwWU/T0loKoPeUA1 7pCdpnFVo9uXBjzyUyp99ETgXnEQu1HTSV1k1WrYdjcdiZoLW3AlRiNTZrNm4y5HjrpS 0XzkTHQR60ljI7iHkneMzoqgEbmkKuxhTZ86/+JvJbZsLp71uKtE6a4bN9cWywMXAD5u aEDQ== X-Gm-Message-State: ANoB5plK06YZ1hNDLkaI7z6gEodR3oJ15ac4gPuHAhxMsJ1O4qPtIXiF OD3b2AMgZkLDkxiOtpt4qf1sTw== X-Google-Smtp-Source: AA0mqf66Th+JaUaR6SALYWcOu+b5KEs15JPlRbwXz1ZO7OP5vyoVUmI5BCievEOVALjrQFn4+48xbw== X-Received: by 2002:a63:3d8:0:b0:476:eee6:d394 with SMTP id 207-20020a6303d8000000b00476eee6d394mr7387317pgd.228.1668791191672; Fri, 18 Nov 2022 09:06:31 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 19-20020a621513000000b0056c0b98617esm3435797pfv.0.2022.11.18.09.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 09:06:31 -0800 (PST) Date: Fri, 18 Nov 2022 09:06:30 -0800 From: Kees Cook To: Vlastimil Babka Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 2/2] slab: Remove special-casing of const 0 size allocations Message-ID: <202211180906.3030FDDB4@keescook> References: <20221118034713.gonna.754-kees@kernel.org> <20221118035200.1269184-2-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 18, 2022 at 12:34:01PM +0100, Vlastimil Babka wrote: > On 11/18/22 04:51, Kees Cook wrote: > > Passing a constant-0 size allocation into kmalloc() or kmalloc_node() > > does not need to be a fast-path operation, so the static return value > > can be removed entirely. This is in preparation for making sure that > > all paths through the inlines result in a full extern function call, > > So with the kmalloc_trace() already solved, we could now say it's not "in > preparation", but simply "makes sure", right? I can correct that while > picking this patch. Yeah, good point. I missed this when updating the commit logs. Thanks! -- Kees Cook