Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5500477rdb; Wed, 13 Dec 2023 10:18:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4/XadDhFhnaud7XH1Jw4eYn2PVSaF+Ym3iimvacVP5FVDULG2rDcrpOP5kzPHdU7vyJdU X-Received: by 2002:a05:6a00:1d26:b0:6ce:5bf5:60f8 with SMTP id a38-20020a056a001d2600b006ce5bf560f8mr4307899pfx.58.1702491502248; Wed, 13 Dec 2023 10:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702491502; cv=none; d=google.com; s=arc-20160816; b=o87OvYVUJjimu1N/YzhmnZ/pthePYllm2bWSDJS+IwukWhIcFLFADpavn3P+B7EEvO rv3r5FMB1g1CE7a5AvkRqkAMl1dFjNJVYofLJyv9L+Y9O8bTwMLYdw46Iie7BJA/tFZT qjW7NZX9Q3AbDVXk7aIjpEYkQK0QoaPr37urJwv0QGrmYK++B0oqcMAJzsVjIsRGrKxZ dK25iNE4jgRGKWvqZkxACN+N+I8lrlyTFyvhbmtuYdqv3xWKfMgTadaUpJKtwK1aTiZ5 mZ1xDywtXbyuchx/YDiXzOO10Cqp7glpxglnow4on/GUD4snu7OLkl0owG/B2YcvfaRC Z20A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:cc:to:from; bh=jIhFYFiKtVeg7iWDg3f3eyYF/BV0mxgPOWkvFU3IRN0=; fh=49Nlx4Vt2F4aGhNzIFlOC8gBCKqHUyUTrViq67SlTpM=; b=p/3RZs3xiRWZKwf5uE/7DKuLKE/e0iSbfTLeuxbnOX6NpMYEwKceIYlIIjf4SHDhsm 6MiNOtF92oDhY9ijAw+4/3AFDYQ+oZV91+g783+7P3MZ7OP+UZwX9WAMhLkn66AwRS+K c7PDNkmbeL9rifVm8r0NwS+uSRpjieE2mahOlTKRRRjDliBvSroTCaDypo5iePUS9MKN JNGXEcONNyAC/g5dfDPvpcjapaKGymdgMfzKyuiPrj3KYe7yUsWJQi+ivtTqF9JRhjxQ 4N5zHvxz80jAA9dgD8sbLuI21fP7Bgujl4ru2cHhVK97wB1uevLWbndsF6doh2iC5hPE 6jAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q5-20020a655245000000b005c602ff4068si9492114pgp.438.2023.12.13.10.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0F62C802DD0C; Wed, 13 Dec 2023 10:18:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441962AbjLMSSH convert rfc822-to-8bit (ORCPT + 99 others); Wed, 13 Dec 2023 13:18:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233481AbjLMSSG (ORCPT ); Wed, 13 Dec 2023 13:18:06 -0500 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C435AF; Wed, 13 Dec 2023 10:18:12 -0800 (PST) Received: from in01.mta.xmission.com ([166.70.13.51]:55092) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1rDToA-000YZK-3k; Wed, 13 Dec 2023 11:18:10 -0700 Received: from ip68-227-168-167.om.om.cox.net ([68.227.168.167]:53124 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1rDTo9-007oxM-1R; Wed, 13 Dec 2023 11:18:09 -0700 From: "Eric W. Biederman" To: Luis Chamberlain Cc: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , Joel Granados , Kees Cook , "Gustavo A. R. Silva" , Iurii Zaikin , Greg Kroah-Hartman , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> <20231207104357.kndqvzkhxqkwkkjo@localhost> <20231208095926.aavsjrtqbb5rygmb@localhost> <8509a36b-ac23-4fcd-b797-f8915662d5e1@t-8ch.de> Date: Wed, 13 Dec 2023 12:18:00 -0600 In-Reply-To: (Luis Chamberlain's message of "Tue, 12 Dec 2023 23:47:28 -0800") Message-ID: <87v8927yqv.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1rDTo9-007oxM-1R;;;mid=<87v8927yqv.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.168.167;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX19i6qfGdObJtlqwV73cM5HlVuthNRxr54M= X-SA-Exim-Connect-IP: 68.227.168.167 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Luis Chamberlain X-Spam-Relay-Country: X-Spam-Timing: total 472 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (2.4%), b_tie_ro: 10 (2.1%), parse: 1.41 (0.3%), extract_message_metadata: 26 (5.5%), get_uri_detail_list: 2.4 (0.5%), tests_pri_-2000: 39 (8.3%), tests_pri_-1000: 4.2 (0.9%), tests_pri_-950: 1.79 (0.4%), tests_pri_-900: 1.50 (0.3%), tests_pri_-90: 133 (28.2%), check_bayes: 132 (27.9%), b_tokenize: 12 (2.6%), b_tok_get_all: 9 (2.0%), b_comp_prob: 4.2 (0.9%), b_tok_touch_all: 102 (21.6%), b_finish: 0.96 (0.2%), tests_pri_0: 238 (50.4%), check_dkim_signature: 0.50 (0.1%), check_dkim_adsp: 2.8 (0.6%), poll_dns_idle: 1.21 (0.3%), tests_pri_10: 2.3 (0.5%), tests_pri_500: 9 (1.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) 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 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 10:18:17 -0800 (PST) Luis Chamberlain writes: > On Mon, Dec 11, 2023 at 12:25:10PM +0100, Thomas Weißschuh wrote: >> Before sending it I'd like to get feedback on the internal rework of the >> is_empty detection from you and/or Luis. >> >> https://git.sr.ht/~t-8ch/linux/commit/ea27507070f3c47be6febebe451bbb88f6ea707e >> or the attached patch. > > Please send as a new patch as RFC and please ensure on the To field is > first "Eric W. Biederman" with a bit more > elaborate commit log as suggested from my review below. If there are > any hidden things me and Joel could probably miss I'm sure Eric will > be easily able to spot it. > >> From ea27507070f3c47be6febebe451bbb88f6ea707e Mon Sep 17 00:00:00 2001 >> From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= >> Date: Sun, 3 Dec 2023 21:56:46 +0100 >> Subject: [PATCH] sysctl: move permanently empty flag to ctl_dir >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=UTF-8 >> Content-Transfer-Encoding: 8bit >> >> Simplify the logic by always keeping the permanently_empty flag on the >> ctl_dir. >> The previous logic kept the flag in the leaf ctl_table and from there >> transferred it to the ctl_table from the directory. >> >> This also removes the need to have a mutable ctl_table and will allow >> the constification of those structs. > Please elaborate a bit more on this here in your next RFC. > It's a pretty aggressive cleanup, specially with the new hipster guard() > call but I'd love Eric's eyeballs on a proper v2. I will look at a v2 time permitting. My sense is that changing the locking probably make sense as a separate patch. Eric