Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp982760rwb; Fri, 18 Nov 2022 10:52:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gduDGZEyKjIw+LG8//Bv69L3iir3VHp6YZf6an8YgGB1v0QryggUSQtZgx0zTS59CbF2k X-Received: by 2002:a17:906:d782:b0:78d:422b:8156 with SMTP id pj2-20020a170906d78200b0078d422b8156mr7056020ejb.589.1668797575398; Fri, 18 Nov 2022 10:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668797575; cv=none; d=google.com; s=arc-20160816; b=l2f000u4INPBe0K306le1ravsBD5c43vQCphEFY0xc2QpLzBdYRs6I9afb3SO9OBdp ZKU+ATg8C9ECgepvrqnSvOC1O0DpVtzshiWuw73vQNZ7bObNejrUs3fY/LkVMYZiwmYX R9188jCbbjnxIUSw07f5h2A4QGxlCOm+ym/iiHIDX3FppE9d69FhqzUazChO+4p+G+zM BeZiHGyttCA/senslEtttWzqnf9GUq6GADWWMy6v7nQLoCsyBkhiOOtp6HpdKQQX5xBm fdRv0yhkC1duIsR3nWBDow6Z2Twi27i/To2D3u8AzVhtUCtqjrHgKjsLUiUB5va58CZT rf8w== 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=AGuGWp5XCDdHJkP/ZVzcY0JNFnAf0r/m3zS2HVfgluM=; b=bJELjMozDIht25Xh3GvGvrjBRPUG0585EtBprfo/+y4ZbVrVz+B+z1pKV29VKKg+S8 nT59wrqhILMBjv/aMrxNygH8VuyYJtT6pS4IwUrlK6HlOGm8fm3CI7/DgDjo2Hs662v0 Vq5bSnzYMfinnhWa0I40HiujA9rnDSbfCeOzpSTNKZ2qx6DA515HM6NFESr1qLpyQRkG gUJOjLMvijhwsxghGMWlWAxrzmcuYQ7hYdQSI0+FKgg4Lsiw6SJkhJX9b2MFPySzoaoK hDepsqHNGfGFlZMnmleqnmR8IkbovYeC93Zkbh03AwhuIa5VBp9LQwfiH5JwRuRQ6xmI siCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EF20HVvg; 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 sc30-20020a1709078a1e00b0078dffe01cbesi3475897ejc.4.2022.11.18.10.52.32; Fri, 18 Nov 2022 10:52:55 -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=@chromium.org header.s=google header.b=EF20HVvg; 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 S242186AbiKRRGm (ORCPT + 90 others); Fri, 18 Nov 2022 12:06:42 -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-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: X-Spam-Status: No, score=-2.1 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=unavailable 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, 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