Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp437363lqo; Wed, 8 May 2024 04:41:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHzeZRg4/ZwsdlgU86EdiYrz86DKu3tV+mf0Kb935TszwgBreeR5p/ksFb1W7c9I+Ywecn8sKRH5plWsmYGJhpwY1mUgN7BCzIJ2TM+g== X-Google-Smtp-Source: AGHT+IHMgxssR6+DpBhwDSRhGChx4CWfAju+MIURQLM4OxX5cU6xflo8z183FNMn1oGwkIljWTjJ X-Received: by 2002:a17:90a:6587:b0:2b2:3376:b9e with SMTP id 98e67ed59e1d1-2b61639ffedmr2590582a91.9.1715168506883; Wed, 08 May 2024 04:41:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715168506; cv=pass; d=google.com; s=arc-20160816; b=H1P19yFIIvF8eSIdDMfhAEzIc02/nQYuKGj0WKjG+h47+ejdNSBENUTrRzL8lxrNY1 pIeRJViFJds6lCI2bgR54cKGvzH3+vV1ZVkYhI0MXmiFmIymSZQR3tEW50ksVfh9tTJa zIbmfKjAmJaMJsriox184+Jvi/I7TI3CLmG0UFPL0AzUXePwVZabY2IY1hWsQjFFTItt v1E1pN/az6KpLIKFdGMZGVyiou6BzH9X6iayhLd+JXdYXI4gV6JmdEPEQYxIyrqVmhWt x4/AsKEpZthITDsdgcAdziYOf+0UXZ0s7qNkI/WD4MxJVP68gY2yEm+qIYRXRbJFj4j2 DsdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id :subject:cc:to:from:date:dkim-signature:dkim-filter; bh=gtbGdnHi+Sywm4GJEWUqxx3nEyjlhODfQVe10fNojck=; fh=0D4ouHuCTnG65LgvB/a2oE1PeuIUlTB56NMzE3SEYGw=; b=tVzOwJNjL95lntDzRT/ZTaNoxgp8ExEqsVAm/69WWNKVuViTNeVZX9z5By5oqGb20J AWQycSFEBJhiHbJ+i4I/m4cO8FLGUFEycqjrdLpjJpBr+rqqAcLacse8r6Ez002DiMhh +sYFqqkWiIkjDP6IrV+Xu4UCe7MG8GK7TC7J2IlrRx90qmVwJrC96UEtqrOGLTwII1LE Yu/rogDGgwjNODwN8U0vHLNk5vTpMhaagrwjehjvqour+w+uYTsSMZts3RjPf5ou1voR lX/ZJx+4pNCnEIpOZCj2pxTAaZ172gF0FmyuTJiKiYZVHx/WUmDCcxrlz170U5a7n1L7 b9vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ARf9yryb; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-nfs+bounces-3200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3200-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5c30asi1190563a91.71.2024.05.08.04.41.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ARf9yryb; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-nfs+bounces-3200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3200-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 73E3A285952 for ; Wed, 8 May 2024 11:41:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A40C082D70; Wed, 8 May 2024 11:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ARf9yryb" X-Original-To: linux-nfs@vger.kernel.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D506882C6B; Wed, 8 May 2024 11:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715168450; cv=none; b=ffMMPGQL5nfF0JWtJTVQZvlSvCfmqeqkQGYucynwYstoNNB9w/EIUBMsxLhfDi7VcbAlf/ZH+84TvFFy4ULU2st2szICL17AYcxypGIMM39RznZ8RJXtHE3nVaX/V/nwRn9JGAijaOBEfrqYTD13jvGvu8iXd/3DaPh7cjrai+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715168450; c=relaxed/simple; bh=VYbyN92+PJMbs2AKtNDJEqVxdaaDoCupy0qED/4tmIk=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:References; b=MKRxFlfnBDCObZvqU/nzNrN8leRpvE1oyrPhS7OKzO3uUx8lklwbK/CEF/+mG7OFY2Sj3y0Qd50QaHVbMjPsu2fJ179JArJ/gOPB7LAVgF8EW2TqTyzEUXiaWWPu+l+ObEOCxFr3wR+hI/EpHNOUxE2RwlEBGkVQg4sntOp4rtc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=ARf9yryb; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240508114046euoutp01c37f593f2a27b20f7d0fd2731027a54b~NgJ1CqoWY2038520385euoutp01U; Wed, 8 May 2024 11:40:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240508114046euoutp01c37f593f2a27b20f7d0fd2731027a54b~NgJ1CqoWY2038520385euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1715168446; bh=gtbGdnHi+Sywm4GJEWUqxx3nEyjlhODfQVe10fNojck=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=ARf9yrybjupqwXRiQSE0Q+Tc1VlSDD++6M71TuY+w8UkpabWpt+Bd8asmIwK5/S1b p9DuAfcc4CfOwakhdbcNO5XJRUC3eEs2nIyv98AaKJUjgJCQxVPiTUPHlm8FXtoUrm DraRLqHwAMzxsVBDEVDoUEvhrhA8MTbEvMJRkiJc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240508114045eucas1p2008b107d5bc84df1055d3c8f6f665522~NgJ00-QmY1758717587eucas1p26; Wed, 8 May 2024 11:40:45 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id DE.2B.09875.DB46B366; Wed, 8 May 2024 12:40:45 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240508114044eucas1p1bafa4ded49711d101a6ec02ee4cb497d~NgJ0CfQx03085530855eucas1p1l; Wed, 8 May 2024 11:40:44 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240508114044eusmtrp12f636116d09000caf814157fd2f0936e~NgJ0BWWL81100011000eusmtrp10; Wed, 8 May 2024 11:40:44 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-36-663b64bda894 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 77.0C.09010.CB46B366; Wed, 8 May 2024 12:40:44 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240508114044eusmtip2fa7284d181f2b50d0064e9cbaa2aaf8d~NgJz0FG2t1990419904eusmtip2H; Wed, 8 May 2024 11:40:44 +0000 (GMT) Received: from localhost (106.110.32.44) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 May 2024 12:40:43 +0100 Date: Wed, 8 May 2024 13:40:38 +0200 From: Joel Granados To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= CC: Luis Chamberlain , Kees Cook , Eric Dumazet , Dave Chinner , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 00/11] sysctl: treewide: constify ctl_table argument of sysctl handlers Message-ID: <20240508114038.vnx2hchpxeimuqz2@joelS2.panther.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="t6g7ogcm2uwc3jep" Content-Disposition: inline In-Reply-To: <4cda5d2d-dd92-44ef-9e7b-7b780ec795ab@t-8ch.de> X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA2WSfUxTVxjGc+5XS7fipYiegGAoaNzcyocyTsSBRJ03/rEsBjMDy2wdF3RC q21RtuisgeH4UgQNFgwrVMBJC1hqBTajI1CkTMCprNsQAhTcBCNSOkZAWJuLm8n++z3PeZ43 75scPi56TPnzD8nVrFIuSxNTAsJinet591ZyTEp4lVaMTlt1JHK2d1LIos/H0MuWMzgyWwcB GrOO8NBP+eno+24Xhkyj/ST64VYXgSoa5gB60HqZQoOGJRL13ekm0cMb9QQabyskkMWZTaGi yiwcjekmSDRVMEKh9oZ7BGpdaOah+b/HMTQ/u0iirG+ncWQvGgPIqluFiuptBOppcpLbAply zX2CsVVBRmfKYEzXcinGNF3MY5qunGL+aNICpvdSJWD67UME82z+Lsb01UxSjNMUxJzLt/I+ EiYKtiazaYeOscqwWKng4PSFAexIuV9mdn+sBtz3yQNefEhvhjnTLjIPCPgi+iqAo84XOCdm 3EI3BTjhBNBZXUq9qvSU3Vt+qAXQUN5H/psa6phY7psAtLWNuWN8PkGHwmHjek+bot+BvZMD uIdX0lvhd385eR7G6Ys8WH5T6mFfWgrN1SXAw0J6G5wrHCE59oFdWgfB5TNh652bpGc8TgfA 2kW+x/Zyj/z5bDvBLRoMXfrBZT4JbebfMM9qkJ4SwJahYcrThfQOWDCygcv4wqedZh7Ha2B3 SQHB5UsAvL04xeNEHYA1p10Yl4qB2Q8dy414ONj7K+CGekP7Mx9uT29YbCnFOVsIv8kRcen1 sG5w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4QtLPHnWhcbRNFH RokXG9cxQzibGCX2TdwE5HBwsAioSDxcqwbSwCagI3H+zR1mEFtEwEZi5bfP7CA2s8BUdonZ 2xNAbGGBBIktSyczgti8Ag4SP3sfsULM7GSS2H73FFRCUOLkzCcsEM1lEpuXzmcF2cUsIC2x /B8HSJgTaP6lviMsEIcqSnxdfA/KrpX4/PcZ4wRG4VlIJs1CMmkWwiSIsI7Ezq132DCEtSWW LXzNDGHbSqxb955lASP7KkaR1NLi3PTcYiO94sTc4tK8dL3k/NxNjMCUt+3Yzy07GFe++qh3 iJGJg/EQowpQ56MNqy8wSrHk5eelKonwHm03TxPiTUmsrEotyo8vKs1JLT7EaAoMxInMUqLJ +cBknFcSb2hmYGpoYmZpYGppZqwkzutZ0JEoJJCeWJKanZpakFoE08fEwSnVwLRXjfWeXbv/ 21OMW8McPK51fmtbYLsovVerk2O1TEjn2fWSxz8eWOETlWmeVlS8tYVf+Nit5JO3/DZ8eZ1p wL9ll9gp72/TxZadjf8Q6X4wj72pTP3U0QuKj22vGZdy5t2+u39/zELOi0c+71pYJ3fzgkSf xoYtlaF1vi+uN2xeUSC5xfKMf59VVu+jrc63e8KbbRZwc0q+Ttgvs9qupyNmTjO/Wfzu6m3T 59doib3buXTm0yfX9k4Km7HwS+HHA1ukpEyileXTGEwnnZxq+/zqsvUGHNb/kzcxGW85cDaI 592LvTUOP1ymHSq8V8strvt6W9vL2k0iMsX7vk491H1GY0ZMh4vPk9il685ccExSYinOSDTU Yi4qTgQA//bFNQ4EAAA= X-CMS-MailID: 20240508114044eucas1p1bafa4ded49711d101a6ec02ee4cb497d X-Msg-Generator: CA X-RootMTR: 20240423075608eucas1p265e7c90f3efd6995cb240b3d2688b803 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240423075608eucas1p265e7c90f3efd6995cb240b3d2688b803 References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> <20240503090332.irkiwn73dgznjflz@joelS2.panther.com> <4cda5d2d-dd92-44ef-9e7b-7b780ec795ab@t-8ch.de> --t6g7ogcm2uwc3jep Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 03, 2024 at 04:09:40PM +0200, Thomas Wei=DFschuh wrote: > Hey Joel, >=20 =2E.. > > # Motivation > > As I read it, the motivation for these constification efforts are: > > 1. It provides increased safety: Having things in .rodata section reduc= es the > > attack surface. This is especially relevant for structures that have= function > > pointers (like ctl_table); having these in .rodata means that these = pointers > > always point to the "intended" function and cannot be changed. > > 2. Compiler optimizations: This was just a comment in the patchsets tha= t I have > > mentioned ([3,4,5]). Do you know what optimizations specifically? Do= es it > > have to do with enhancing locality for the data in .rodata? Do you h= ave other > > specific optimizations in mind? >=20 > I don't know about anything that would make it faster. > It's more about safety and transmission of intent to API users, > especially callback implementers. Noted. =2E.. > > # Show the move > > I created [8] because there is no easy way to validate which objects ma= de it > > into .rodata. I ran [8] for your Dec 2nd patcheset [7] and there are le= ss in > > .rodata than I expected (the results are in [9]) Why is that? Is it som= ething > > that has not been posted to the lists yet?=20 >=20 > Constifying the APIs only *allows* the actual table to be constified > themselves. > Then each table definition will have to be touched and "const" added. That is what I thought. thx for clarifying. >=20 > See patches 17 and 18 in [7] for two examples. >=20 > Some tables in net/ are already "const" as the static definitions are > never registered themselves but only their copies are. >=20 =2E.. best --=20 Joel Granados --t6g7ogcm2uwc3jep Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEErkcJVyXmMSXOyyeQupfNUreWQU8FAmY7ZLUACgkQupfNUreW QU8gUgv+JUZin5OAF3NMj7s3DmErLOcek/iw2Q4tXtrCSrstF9AEp1KJR4h7cMPe Nh/NrY7roszof3ADLw9QcvijqtC2/YxQqtu+PqVfRYn15Tv7/eFIYRElCTK3Xdxj xMkZb9Afo5tMvUqCXLuy7hsa5GxNrpk5wLv3OEQnaOQPriuI0fAdMxQEFZXtRFst ZNvVqOVbGzH5fZhv6YS21SHWAIbki2fKfu9etPSftEhi5TQ60KT0GfnNLhonPMES 3q2s+Ox+m8zkKdpI8YZK/KYO7u7qM2aEGCcKQejM4cdJs8Ii0VVQT5lwyEipveYM 5d+sAYm/dF/FfZ6ocaC7REDrCC2P3+IxskN73CNRhwkkiUBSzXu52QdTzaAUF09Z azXiYxq/FpInFPHbBRWHRoeLkknyIlNmKUvVW+H6EHoMxgio7Pn2ERgGo4on6m8Z DX/ExB4ksH+M9m8Mw5niW9tzCilWV1c6EvwQ+9FlNY0szADvScD0Ocv3M0FVfvcx BVIXt1UD =UpYq -----END PGP SIGNATURE----- --t6g7ogcm2uwc3jep--