Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1885790rdb; Thu, 7 Dec 2023 11:20:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IH13kc2zZbt/nIEZN5rK5HtS0PGzHa4rMaObQJAEXP0djWRvMijJim0oikPeEy3lL5NVUDk X-Received: by 2002:a05:6e02:1093:b0:35d:59a2:6912 with SMTP id r19-20020a056e02109300b0035d59a26912mr2856858ilj.63.1701976802284; Thu, 07 Dec 2023 11:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701976802; cv=none; d=google.com; s=arc-20160816; b=lYHIh+nyLy1kBMcDTuTZmF7v76pkF8124e9K+aesH0VKMaKUbFz5VCGp1gpuUR8yVr 5VaREuf8InBw8zWSqMcyg5mF2BMamvVEtFVbjXB4juhA1gWNqnd/pNlmElAAzaXvwJ2s CyElsm9v31S0gVP68v60YN9EJcAPr8jmUJfQYXcwXa5fNcxnpg3Iogd+ogcYEO/CT9Kr YW80tlFO648n+nUZYMGBLA3TWa9l1dedexKJCu3KYagX/0pHbe+X3fhBhkVBN2PzfUxn O82fsLDDoX+ZcxI5EAuINQiM5Kb5j8jVj5NexeOUVk+ZhfK1jxUYoAp6/NVga+eTJ6lQ vqNQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QfADYtpnXwLHDnyURQ0N/1aiZYI39JT6YKdVGyMmIas=; fh=OdhmpsWDQsjlyU1lesDxzPSAQG2y81xEh5+BX1VSlxw=; b=YIhZAn8RJBBfdLveT7L0CbJsxYOnZ3lvoiTDIh9BeU0IV6lFVCCP2fojE12bXgoxNg DOdovORvRbv/I65K46A6AhPNCzsupfZuE38+DNv+5eljGF4mXZudVKpkJuhgYejbShuZ 2Az/ENXubLLcz3R8GAvnCR9gfAKBrDefNANqAAqLPAEmbWSzPisxbMpz02eiCPFtCJir GMa8Q2kG11bZzn+E3p9B3QsLP01QSD05mv5kxUM1sdTT0JfZYmwVMUG6AuQDcL+v7ExL BYbwDcIAA72PWClZz1TwDUuAzKP5ZS6LpEhkxR/v8L8c4O84N9bsc2gjRGtQD6nVZoU1 9aeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=dxjkUD26; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f23-20020a631017000000b005bdbcdc9e3dsi174357pgl.142.2023.12.07.11.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 11:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=dxjkUD26; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BB3E78080D72; Thu, 7 Dec 2023 11:19:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjLGTTm (ORCPT + 99 others); Thu, 7 Dec 2023 14:19:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjLGTTl (ORCPT ); Thu, 7 Dec 2023 14:19:41 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D5DA9; Thu, 7 Dec 2023 11:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1701976784; bh=8EhX5dFEoQVo4ra/hauFi9FL5y3h3LfWv35aPkeCC9k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dxjkUD26Nj6K/4ciJrCrVr2UOWn52vU+Fs4HJzgCi+NnOQJo/XEm4ZcNXd6KKxMmJ lxVBEzoyhC58LUoNs38SgEqduBnSJuKhtVuVHYMrkI4kV2WtgEHiS2t85YfBXeiGEQ sy4GqrNlgZKtQDGu63+OGmMNEkrMqWvdquQsz7xo= Date: Thu, 7 Dec 2023 20:19:43 +0100 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Joel Granados Cc: Kees Cook , "Gustavo A. R. Silva" , Luis Chamberlain , Iurii Zaikin , Greg Kroah-Hartman , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables Message-ID: References: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> <20231207104357.kndqvzkhxqkwkkjo@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231207104357.kndqvzkhxqkwkkjo@localhost> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 11:19:58 -0800 (PST) On 2023-12-07 11:43:57+0100, Joel Granados wrote: > Hey Thomas > > You have a couple of test bot issues for your 12/18 patch. Can you > please address those for your next version. I have these fixed locally, I assumed Luis would also pick them up directly until I have a proper v2, properly should have communicated that. > On Mon, Dec 04, 2023 at 08:52:13AM +0100, Thomas Weißschuh wrote: > > Problem description: > > > > The kernel contains a lot of struct ctl_table throught the tree. > > These are very often 'static' definitions. > > It would be good to make the tables unmodifiable by marking them "const" > Here I would remove "It would be good to". Just state it: "Make the > tables unmodifiable...." Ack. > > > to avoid accidental or malicious modifications. > > This is in line with a general effort to move as much data as possible > > into .rodata. (See for example[0] and [1]) > If you could find more examples, it would make a better case. I'll look for some. So far my constifications went in without them :-) > > > > Unfortunately the tables can not be made const right now because the > > core registration functions expect mutable tables. > > > > This is for two main reasons: > > > > 1) sysctl_{set,clear}_perm_empty_ctl_header in the sysctl core modify > > the table. > > 2) The table is passed to the handler function as a non-const pointer. > > > > This series migrates the core and all handlers. > awesome! > > > > > Structure of the series: > > > > Patch 1-3: Cleanup patches > > Patch 4-7: Non-logic preparation patches > > Patch 8: Preparation patch changing a bit of logic > > Patch 9-12: Treewide changes to handler function signature > > Patch 13-14: Adaption of the sysctl core implementation > > Patch 15: Adaption of the sysctl core interface > > Patch 16: New entry for checkpatch > > Patch 17-18: Constification of existing "struct ctl_table"s > > > > Tested by booting and with the sysctl selftests on x86. > > > > Note: > > > > This is intentionally sent only to a small number of people as I'd like > > to get some more sysctl core-maintainer feedback before sending this to > > essentially everybody. > When you do send it to the broader audience, you should chunk up your big > patches (12/18 and 11/18) and this is why: > 1. To avoid mail rejections from lists: > You have to tell a lot of people about the changes in one mail. That > will make mail header too big for some lists and it will be rejected. > This happened to me with [3] > 2. Avoid being rejected for the wrong reasons :) > Maintainers are busy ppl and sending them a set with so many files > may elicit a rejection on the grounds that it involves too many > subsystems at the same time. > I suggest you chunk it up with directories in mind. Something similar to > what I did for [4] where I divided stuff that when for fs/*, kernel/*, > net/*, arch/* and drivers/*. That will complicate your patch a tad > because you have to ensure that the tree can be compiled/run for every > commit. But it will pay off once you push it to the broader public. This will break bisections. All function signatures need to be switched in one step. I would strongly like to avoid introducing broken commits. The fact that these big commits have no functional changes at all makes me hope it can work.