Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp224283lqp; Mon, 10 Jun 2024 01:53:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVd70uIs7eg5F9dgBYf2gZsSfz9yQ5DHuf+GF6YPC+xnwO7qylaOpVA76g1P2jUbE8y+0rW5zsVpDkQOFGSO/s1a+YooFCzyr5gqUw7aA== X-Google-Smtp-Source: AGHT+IHFRMZnDgxzK9gZBItGOw5O1TO2eOEezlEmtLe1Y6jrafJ7Y+pfH3eciWTVmW3MG5GfvDRR X-Received: by 2002:a17:906:fca9:b0:a6e:ab8b:aff4 with SMTP id a640c23a62f3a-a6eab8bb0c7mr503216766b.13.1718009597705; Mon, 10 Jun 2024 01:53:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718009597; cv=pass; d=google.com; s=arc-20160816; b=BHIjMbrtXWkGnL/b6Sunb+p0l5OMdQF6m7/iKdZy+V7V82Gwbdy0ezdnuhSrU7o3Jc 4aYLergVjQEdz0mmx4LDb2qpXWghnIS399zjojFqa4Fcoja31O/myl+8a0VI6T/zKGVO 1Acb45q9sodWBEDChH7Kx0fW1UtoBY1h++2ajqiOHRZVs47MsCVHdsvkrtFElBEsuXDf wDF9zpWJ7c81bS/mSuMpNJy50gZ48kP8VwmvJjmw6EdKw0ewpHnbOav+YzYqn+bfQUG7 19MKUqMu82QaNJS82KtJCZYtWCAj42cdTfhKkJIvbpOCa+ZkZgglZx6dNod0E+IqF+xv BePQ== 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-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=aY5zE5Az+KjV5gUHZuSCo5Ka39W2XFAzS0RqdALIlAk=; fh=sNhYjEfIJ8Jtg13eXy+GXny7qT8y2n1hJA+46UKENuc=; b=RRg8jaJuj7rjPkLINrOg2AzSNBiQLyDOIzbEPiDElT1aNbefrkBqL4goYh8FyGtmRD tFlWmAWxcX4ecpdcReuK39HvIWx8i2ILyZeVLWIkDQHb5ul40DGzyeSPz9cV5mjLKouG IMYH8gfEqhNopkBuKQ38o3z8TRkxBwz7GopNG7CJ4kjKQLoQGgyPrE0GXCU/rZVTFm4j zW0VG58Yv3+QmaiiM0UAIZHHnUcJkGIngF4OWPgOyAKQ8AOL62HXboxjxGIZwb4Tqw3q VCg35IptWOBay5zTKzOYQ5qWcxxzGgT3iobjUiX8BjMOs8gMBlTDYH4KPNyDUZ1P2/1n j7bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SG3vJ4ZK; 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-kernel+bounces-207874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c5a7eb2a0si3262313a12.224.2024.06.10.01.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:53:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SG3vJ4ZK; 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-kernel+bounces-207874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207874-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3276B1F2245B for ; Mon, 10 Jun 2024 08:53:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 333775FBB1; Mon, 10 Jun 2024 08:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="SG3vJ4ZK" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 2B35941C69 for ; Mon, 10 Jun 2024 08:53:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009587; cv=none; b=P/4mtfLzUmLBXu/Ye1g9B9F2Cw09ZRWFhfk7JHwSm4GS6AUv63+oRL/LSzFmO8p+PCbAtM4PNB2/7aOn3PK+kJQgZfPjHR3fLB5RSWJT3gLgXwTGICOfLKGRUMUF2pckMEHejlsUc+UMp5fear7nd1XeWrWO0LzITFhNZEZWWD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009587; c=relaxed/simple; bh=jbKj2WaybwFmXo3hBH7Wln3dmWvh62gbab2vHQxJrzs=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:References; b=aWffdlQGtTtcZ7JGHqJcLL5WEdXFDua5mZF1F+1QMk4v9Ck8now0IYUWzIf3AOq7My14KcXyFsYYRGgNnc7pMrSvAvVBA3PKJvdRCzQAZxNftjAEYZHLw5tNf/5fbV4w+8U0MY96dy9J0FZIG4+9asPV37j25CA3RtbiUh52D6A= 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=SG3vJ4ZK; arc=none smtp.client-ip=210.118.77.12 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 mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240610085303euoutp02fa65fe76336e43366c3f6c26399a8f58~XmJ0SZahC0697406974euoutp02s for ; Mon, 10 Jun 2024 08:53:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240610085303euoutp02fa65fe76336e43366c3f6c26399a8f58~XmJ0SZahC0697406974euoutp02s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1718009583; bh=aY5zE5Az+KjV5gUHZuSCo5Ka39W2XFAzS0RqdALIlAk=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=SG3vJ4ZKEE/H1gTgIMqYz+vJIpFJRD9e7TNHQnCW0kiRY61SPkTV1JptRVeoqSZrr 3gL0ULXLQkOduELQ5EeT4MyORNfqRT4/bT6pHZcqHVGk7wq2b+aovpsPmiVSDeGX8X 4DMzKgp6Wdys0bJF4DIG3QgmqTP/wG1aZZS1Rh3Q= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240610085303eucas1p204b1b4d6e6f9f7bfd3ad8c96a5da3489~XmJ0HExp21436414364eucas1p2h; Mon, 10 Jun 2024 08:53:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 8F.4C.09624.EEEB6666; Mon, 10 Jun 2024 09:53:03 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240610085302eucas1p222933623970153fdbdb6fbed7a5db86d~XmJziayNX1088610886eucas1p2t; Mon, 10 Jun 2024 08:53:02 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240610085302eusmtrp260becb9d15af52921cd6aaffac59122a~XmJzhaE5M0762407624eusmtrp2c; Mon, 10 Jun 2024 08:53:02 +0000 (GMT) X-AuditID: cbfec7f2-bfbff70000002598-c3-6666beee020b Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B6.68.09010.EEEB6666; Mon, 10 Jun 2024 09:53:02 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240610085302eusmtip2690a2ce7f7c808332b11adedcbd7aa60~XmJzT7iK42235022350eusmtip21; Mon, 10 Jun 2024 08:53:02 +0000 (GMT) Received: from localhost (106.110.32.44) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 Jun 2024 09:53:01 +0100 Date: Mon, 10 Jun 2024 10:52:58 +0200 From: Joel Granados To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= CC: Kees Cook , Luis Chamberlain , Subject: Re: Current state of the sysctl constification effort Message-ID: <20240610085258.y6wextl4rk2tqflz@joelS2.panther.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42LZduzned33+9LSDP7GWqx7e57V4vKuOWwW v388Y7K4MeEpowOLx6ZVnWwenzfJefR3H2MPYI7isklJzcksSy3St0vgyvi7oIWlYJNIxfb1 exkbGGfxdzFyckgImEjMXXCMpYuRi0NIYAWjxJyFH5kgnC+MEqd2f2aHcD4zSlw60sMG03J1 412oxHJGiVlta9jgqpb9eMAM4WxmlLi5YCXQZA4OFgFViYknpEC62QR0JM6/ucMMYosI2Eis /AaygpODWSBdYlvra0YQW1jATmLPhuVgcV4BB4lrr+8wQtiCEidnPmGBqNeTuDF1ChvIeGYB aYnl/zggwvISzVtng43nBBq/rekjK8TRihJfF99jgbBrJdYeOwP2gITABQ6J6+2foT5zkVh1 ZCU7hC0s8er4FihbRuL/zvlMEA2TGSX2//sA1b0a6OPGr0wQVdYSLVeeQHU4SsxYuY8V5DoJ AT6JG28FIa7jk5i0bTozRJhXoqNNaAKjyiwkr81C8toshNdmIXltASPLKkbx1NLi3PTUYsO8 1HK94sTc4tK8dL3k/NxNjMCUcvrf8U87GOe++qh3iJGJg/EQowQHs5IIr1BGcpoQb0piZVVq UX58UWlOavEhRmkOFiVxXtUU+VQhgfTEktTs1NSC1CKYLBMHp1QDk+7BLd/U9s081bzPqSnL RYX3QcxPpkPTT009nZK3QKmv3nP+YouumjX2lnosYZ2X2rubdaOFV7Idm7wi8J/x+enNrFfL fRa9ZV1WVRkavbHxpu96tilLzIybp798cExP47knX4bWWuUbIpckv+UaTJu90/ulxt19c0sj PPXWCotZTyu89fv1TxXts/7LPViZN2U3yLpprBWpmhx3z27GXEs5L4kbMjk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+mrS94/+JrtuPuRpv12p8P7apJ3Prm2hOlUjQRfhovNQtmQ2z8P PFt6ND6lvHPxl9W/Db45frRzO3v9tuLmyDLlk7NPSv854J8kveBEaGWc6POaQpfJdzKFF0jq OyixFGckGmoxFxUnAgCyEtf3QAMAAA== X-CMS-MailID: 20240610085302eucas1p222933623970153fdbdb6fbed7a5db86d X-Msg-Generator: CA X-RootMTR: 20240531163128eucas1p20976d08e829373bfa8aa04fda1c7bec4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240531163128eucas1p20976d08e829373bfa8aa04fda1c7bec4 References: <7823ff95-1490-4c1b-b489-a9c05adad645@t-8ch.de> <202405310930.5E2728A@keescook> <20240605082625.6hwdc3haim66rr7v@joelS2.panther.com> <202406061143.27C12F44A3@keescook> <20240607093053.ig6cqrr3xdxhbbt5@joelS2.panther.com> On Fri, Jun 07, 2024 at 03:48:20PM +0200, Thomas Wei?schuh wrote: > On 2024-06-07 11:30:53+0000, Joel Granados wrote: > > On Thu, Jun 06, 2024 at 11:52:25AM -0700, Kees Cook wrote: > > > On Wed, Jun 05, 2024 at 10:26:25AM +0200, Joel Granados wrote: > > > > On Fri, May 31, 2024 at 09:31:24AM -0700, Kees Cook wrote: ... > > > > > > > 2. Is there a special way to send these treewide patches? Or is it just > > > > a regular PR with an explanation on why it is being done? > > > > > > I would do a regular PR with all the details for Linus to do the change > > > himself, but many times people send these as an explicit patch. For > > > example, include the full Coccinelle script, or the "sed" command > > > line, etc, and then detail any "by hand" changes that were needed on > > > top of that. > > @Thomas: have you sent the 11/11 patch on its own to the lists? I cant > > find it in my history. Please send it as a stand-alone patch, so It can > > go into sysctl just like the others. > > No, I didn't send it to the list on its own yet. > Do you want some changes or can I send it as-is? > (Plus the new motivational blurb) Please work on the commit message; no need to change the diff. Here is more specific feedback on how to change the message in [1] 1. Say what was done in the first sentence. Something similar to this: "Add the const qualifier to the proc_handler function signatures to make clear...." 2. Include the general constification motivation. Something similar to this: "This patch is a prerequisite to moving all static ctl_talbe structs into .rodata which will reduce the attack surface in sysctl by ensuring that proc_handler function pointers cannot be changed." 3. No need to mention that this is to avoid lengthy transition. Please remove it from the commit. You can add it to the cover letter or just leave it out altogether. Up to you. 4. Please leave the cocci script. But I would be more specific on the rest of the changes. Something like this: " The patch was mostly generated by coccinelle with the following script: @@ identifier func, ctl, write, buffer, lenp, ppos; @@ int func( - struct ctl_table *ctl, + const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { ... } In addition to the cocci changes: * Added a const qualifier to the ctl_table argument of the proc_handler typedef. * ... Change the others accordingly ... " Best -- Joel Granados