Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3955964rwb; Mon, 21 Nov 2022 01:43:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7RY7hLHmXVGG6mDow4ZVne7uOlAqH65EGToPRe8S2l7vjWZXZoLNbHNHYm7sQLnrO0Cric X-Received: by 2002:a17:90b:8d:b0:218:c14b:4e6e with SMTP id bb13-20020a17090b008d00b00218c14b4e6emr1004489pjb.171.1669023805019; Mon, 21 Nov 2022 01:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669023805; cv=none; d=google.com; s=arc-20160816; b=ziurLlHM28/h/5biCLuOIpJ3Ddw7JThAmTJJMCdc/MDiuelV5PEYWBcbGujFSFqILE l9jKnTqcY6D39wLkBNb8jn0PL3b8YZlXgE+V3KEMmoNEruf0j5x83R4rIKdv1/+6Ed2D 9YtpcNJ0Cjqgkt0vBt6idesgDDbD9KT0+sDhog3OFoyFjf3xgC4QRRHskxcDu9HI8/hD KmDSj484hMNTtMDvDyshsat/oFr4FiiXObIbEwEEhqRzcTOmyB32R+VI1mgJ8uTMLRrK pellk0gRK8IEuBFbtHMHQcvT6EN2fWkYH1h9g6cI0cuKO5JZnPfvBeztFeALMUg8mkdq 9sZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=/Y4IZoLVRj8AR5tjsHCss9N1teSmj9vglLERjZaMD7Q=; b=UyGkJoU5D1bHikiedqY7qYOyQx61vULo5wNVKMzSeIDtb9iikwQy1VvodXd1nQhY7C CcywtNMtt8m0Ac9zOV6ZTxHxf2500vydKxjIoOWCQJm5b809dVB/3xbxRRM7S+5847sg nD/UT2SiyNT6Dvm8RNzp8IJA9mq3gTxuhbk5PnuAifNYZH1ndg0PKpB8Ro/m4DQ9i9qA jQxUMbP0hLibniQeteQfWbG3pbCM04ER89dDVf5rgvH4ypyEjyECRgrCb4cki3lA4Crn ETzlnJa2EE2+g8yy+w1xTvnOlgXpXBCmpMpiRWYwl38Cisjg1+/GLi7QR38qmYJYdc8M ljWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=EJiKnqNX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=IwpqJHx8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a170902740800b0017f577878edsi10336137pll.368.2022.11.21.01.43.13; Mon, 21 Nov 2022 01:43: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=@suse.cz header.s=susede2_rsa header.b=EJiKnqNX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=IwpqJHx8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiKUJ2h (ORCPT + 91 others); Mon, 21 Nov 2022 04:28:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbiKUJ2g (ORCPT ); Mon, 21 Nov 2022 04:28:36 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AFC624976; Mon, 21 Nov 2022 01:28:35 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 01EB31F37E; Mon, 21 Nov 2022 09:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669022914; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Y4IZoLVRj8AR5tjsHCss9N1teSmj9vglLERjZaMD7Q=; b=EJiKnqNXde2PecbphzNFPeQZKzd248pytCyissxmjveo7tle57utcAOW/oe0nlWO4jEtCc BO3l8hsNfvcWBKqctp7dnofsoYBgcXdGgi6TmmrFr2ePWNcxtt795C4RsJM6WZep9EeMQv 8wSf3qXbTrLCXeOwx5CY+RnYJ11FaCY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669022914; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Y4IZoLVRj8AR5tjsHCss9N1teSmj9vglLERjZaMD7Q=; b=IwpqJHx8hRMgXiZAtVPlkONVoki455HtEg9cap4PP2aW7TFlYErq0jdY974Mkf59JI7FVm VMbq3j1UFverlZCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C63ED1377F; Mon, 21 Nov 2022 09:28:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HLOfL8FEe2OgbAAAMHmgww (envelope-from ); Mon, 21 Nov 2022 09:28:33 +0000 Message-ID: Date: Mon, 21 Nov 2022 10:28:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 2/2] slab: Remove special-casing of const 0 size allocations Content-Language: en-US To: Kees Cook 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 References: <20221118034713.gonna.754-kees@kernel.org> <20221118035200.1269184-2-keescook@chromium.org> <202211180906.3030FDDB4@keescook> From: Vlastimil Babka In-Reply-To: <202211180906.3030FDDB4@keescook> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL 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 11/18/22 18:06, Kees Cook wrote: > 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! Great, pushed to slab/for-6.2/alloc_size