Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1888833lqb; Mon, 27 May 2024 00:15:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7BXE1TaRs7ZOk8QWmxeL4oQIewYldZKVaR8yN7AQmQ1wy7NshGIxXvXprZX9s7I5O0a0FRgazAcmBLTTlPRMUtF5e/AxqizCgfvMyhA== X-Google-Smtp-Source: AGHT+IGHxFk1YGHdKHhwHuBinL2z5xhscZ2Zyj3D3Y4N1MBQzjAwAXG9CKSb5uTXonzfhIQDd/fk X-Received: by 2002:a05:6214:310b:b0:6ad:74ff:baa7 with SMTP id 6a1803df08f44-6ad74ffbb86mr57951636d6.24.1716794136609; Mon, 27 May 2024 00:15:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716794136; cv=pass; d=google.com; s=arc-20160816; b=YDyLAxLxG/N0uzBw9ufw4Q9tzQMuhn0WLthLJfQM/G/IO6QnTMUhTjbMN9MGT1Hkzs 0Ut5dn9kgebvfswtK/uP2gFthX1N9NFu/f8XMAIPrdhNCCIf+qqlWbVVNEWOe5zjN8XT Jqpy/ZjPgyjNf2o3p4iMzBEkAfmJWG9zmNWBxYJI1AsPERjvsh86COMX9h4lW43X5Lfm ObXX/w1iIIPRpyzsbAc6LbPqfS3itOjCa+41jY2T+G4+Eb81cvovqGAlygsSp+JVlRbG CrDLjr7NGMgaGLWh9v3LR4jFPv0JNseFfLoEAirvzekU0mM61iJQtRottrOf1lzrud50 qNJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=SRLX4O6F2vJC5vzs06vjyX9BbI9jbKHvHebBkNNhvQ0=; fh=txlaYCDHmrfIoY/JO+HTwblZYW4748rdhzqi8TbQ5Qc=; b=qVneAXql00Lztg1iimsPvor5m1XmVq4akCVdIdjXyaHIEw+Hu/w/W9RhFXG5E7QkvO UoINlmyQcLk/CYc4d1IIJ1mzSJReEzJIKpuZnCAtBXLmm3kqXER+5E9xwfN762K0wrCV hAecaH05KmXZfJwzUpylBbQ5dIt5E9zzl5GRb7mIFwCAOsPh0iEsePTreNWJnqpIoSqV PqMiaR6HogwfJGzlB6BeTyztaBymgc4vHE3tF+TMngkXL8AQ2YVZK1PCJn9jMB08PoKn bL5x0akZXW9Er7rrVjKrYMNUS1nxWd/dr78BQ9ALfYMZ1q9Hpymp3tzSIckyGuwzHiz6 4Nmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="m/B0+aLC"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="m/B0+aLC"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=DkP7wgtL; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-190122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190122-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac11331896si76061186d6.321.2024.05.27.00.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 00:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="m/B0+aLC"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="m/B0+aLC"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=DkP7wgtL; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-190122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190122-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4B31B1C20D43 for ; Mon, 27 May 2024 07:15:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6C3D17BA9; Mon, 27 May 2024 07:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="m/B0+aLC"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="DkP7wgtL"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="m/B0+aLC"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="DkP7wgtL" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C40A63211 for ; Mon, 27 May 2024 07:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716794129; cv=none; b=qIE1+QAujPh+I9lfmliXU4QpEJM6a2U8UQxDbnqLR5LPLuJZo2+6LmOwZqkR1eg/WcKCBGpP0f69PE1a+4MdvpxVRZuc5MzXiQ/z1XdFnjnwaSPmHWlZcf4ox4PCAHDumgjLYgupuk+I5kutd8qKVYJTSxRzwwDbPK5yUCD06PY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716794129; c=relaxed/simple; bh=31SogpfLU9tsVxMjAC/sIc93Lj31gmT1v1N913PkGHc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JA/Z2DQ4TttSqMnqpK5Itva/FgeTNoj1BsIixX9zlOmMxCRhSyc8s/ETE/CprEWCU7tpcSscYIxpennwx8hs0eF2May3/Hhuq3nCqlU1Xa6JYd7VrJwJhTP/wZUU4CYerNbaOqPeBelM9QU/BU9nX1CKhuaJ2p63sbTLuKi6XMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=m/B0+aLC; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=DkP7wgtL; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=m/B0+aLC; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=DkP7wgtL; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D690421CEA; Mon, 27 May 2024 07:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1716794125; 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:autocrypt:autocrypt; bh=SRLX4O6F2vJC5vzs06vjyX9BbI9jbKHvHebBkNNhvQ0=; b=m/B0+aLC4pRrVtXuGeJkOFb8TE4lMqcoe/AsgvxX9e6wOmjZBj5u3j73GWAw83t1xtPuDu 8G2g/6byKpOG3D4vfhK7bFEgEiFN75fliaJSs4SYzdZmGDE6Pi7YI/Nj0evHglDWce09l6 Pbiyga9vBxM2Kkwi5NDo8f6DuPqkqDo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1716794125; 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:autocrypt:autocrypt; bh=SRLX4O6F2vJC5vzs06vjyX9BbI9jbKHvHebBkNNhvQ0=; b=DkP7wgtLY1Tc3RoaIr0EAR2+h3toWfPg+uh7xGYUTDk6DrjOBGBJXTjpF1QBUtaBJFSvUd ON7zm5WUYNti2PBQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1716794125; 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:autocrypt:autocrypt; bh=SRLX4O6F2vJC5vzs06vjyX9BbI9jbKHvHebBkNNhvQ0=; b=m/B0+aLC4pRrVtXuGeJkOFb8TE4lMqcoe/AsgvxX9e6wOmjZBj5u3j73GWAw83t1xtPuDu 8G2g/6byKpOG3D4vfhK7bFEgEiFN75fliaJSs4SYzdZmGDE6Pi7YI/Nj0evHglDWce09l6 Pbiyga9vBxM2Kkwi5NDo8f6DuPqkqDo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1716794125; 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:autocrypt:autocrypt; bh=SRLX4O6F2vJC5vzs06vjyX9BbI9jbKHvHebBkNNhvQ0=; b=DkP7wgtLY1Tc3RoaIr0EAR2+h3toWfPg+uh7xGYUTDk6DrjOBGBJXTjpF1QBUtaBJFSvUd ON7zm5WUYNti2PBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C351913A6B; Mon, 27 May 2024 07:15:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id T21cLw0zVGZBGwAAD6G6ig (envelope-from ); Mon, 27 May 2024 07:15:25 +0000 Message-ID: Date: Mon, 27 May 2024 09:15:25 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm, slab: don't wrap internal functions with alloc_hooks() To: Kees Cook Cc: Christoph Lameter , David Rientjes , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kent Overstreet , Suren Baghdasaryan References: <20240522095037.13958-1-vbabka@suse.cz> <202405241625.9FF3B5E@keescook> Content-Language: en-US From: Vlastimil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ysjQQeobXBDDE31t5SBg++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: <202405241625.9FF3B5E@keescook> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Level: X-Spamd-Result: default: False [-2.79 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linux.com,google.com,linux-foundation.org,linux.dev,gmail.com,kvack.org,vger.kernel.org]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-Spam-Score: -2.79 X-Spam-Flag: NO On 5/25/24 1:26 AM, Kees Cook wrote: > On Wed, May 22, 2024 at 11:50:37AM +0200, Vlastimil Babka wrote: >> The functions __kmalloc_noprof(), kmalloc_large_noprof(), >> kmalloc_trace_noprof() and their _node variants are all internal to the >> implementations of kmalloc_noprof() and kmalloc_node_noprof() and are >> only declared in the "public" slab.h and exported so that those >> implementations can be static inline and distinguish the build-time >> constant size variants. The only other users for some of the internal >> functions are slub_kunit and fortify_kunit tests which make very >> short-lived allocations. > > If it's only internal, I'm happy to drop it from fortify_kunit. Yeah, looks like you already have static and dynamic size parameter variants of the tests so testing kmalloc() will call __kmalloc_noprof() in the dynamic case (ditto _node variant) and is the best way to exercise that. So So in v2 I will drop those from fortify_kunit instead of adjusting names. > -Kees >