Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2547938rdb; Sun, 3 Dec 2023 23:53:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEddxdQxHzQu+WrC7/lEMNQiEwcM6ZKF8iC7xbd6Sb8ZvmvVTNkbHNOfz/Y+QXfufYC14Ul X-Received: by 2002:a05:6a20:1601:b0:18f:97c:615f with SMTP id l1-20020a056a20160100b0018f097c615fmr5338577pzj.92.1701676402224; Sun, 03 Dec 2023 23:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701676402; cv=none; d=google.com; s=arc-20160816; b=jTdknlaz166JHj6gECtCu02xpn+ehMxn7VatQ23hgSGqPzq5miAM3x3IWw7XeJwlqN Y3c0ZDDCihaCVlOrD5BocS4STz1eaWrbHmiCnvuB52GaKMX6mxm+lU2Mj1ZDotp9vUy2 wiIy6pIkEx2ttuB2x56c0BigbLURxbOyBL/wbj3dt3uRuWnkawYPdsdqk7AgZsnyf7nI 2C/XPtlTZx4+cBNYQYTz2I9aMFtxvR2EJ5jDI2UOvGG6dBEwA8Y6GJS5bCKD6Fl8ZbSz /k6BBOL3DUn2+gsNNN4Rod1yfFQrMq0LssNgdE1NcPpISRmZwimW9uOgnNvVKZ4qURvI qr6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=nKo3btV0tbTFyZPPyDD3QPkNCtC1Kc3GW4A5fmj/ILA=; fh=1v5zqbO9sIGUc9bsdyhYE0zxdK1knZz2xnJYWUWMFKo=; b=XBR1mldysjb6XiY3PMFdu+E6BceQun6Atz5vpZl7fG7IMMPS99mTHkiO/d5SCAWRxo hyZm5c15hehThiEsla4JpRmrlmJGRzaO7/Mue12WJ3xN7JlOlSBhrqIG6tBYqx1HUMAb hJ1FRWVIPdDMOuJfBUCYCfRVjevc694k9M+P2ADt7La0Ph+WX83B0S8Bx6E61U6gLJ22 zrX0zopDvtO7OBOOPzQaO+qkwPTscemfr6Gapd2U8y+DMhVQ45HgBQLA20anZ/FonSXG Y/z0hCG7fULZ0OyM6Njb+YJbec+TfdWSM7k6vR427EizxkMMQqPqCdgl8we5DQLB2+AI ytnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=NpAknuE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x28-20020a634a1c000000b00585a5e9a965si7339648pga.161.2023.12.03.23.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 23:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=NpAknuE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3499C80597A4; Sun, 3 Dec 2023 23:53:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343563AbjLDHxC (ORCPT + 99 others); Mon, 4 Dec 2023 02:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234730AbjLDHwq (ORCPT ); Mon, 4 Dec 2023 02:52:46 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0A7198; Sun, 3 Dec 2023 23:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1701676352; bh=v0MXLGIsisRjyz+2q8S4lNJCjp7Kc1OsT9OWJgMTDC0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NpAknuE+SwTyR4zjPUm2h6dHi5u3Il/bBsvGZ3mlpPxjGYT2t7M7Y6Un/IYoB0iMK ReELEAwm3nZ5LEAMS3pGHH6hUh0PA0DFKWC8yDLs/wr4zGuRlSqCiFv1jPLY3p3kgC VDAFEp/kkHjLix6w3AIf0+hmrAH5OnqMB4G+JvZQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 04 Dec 2023 08:52:22 +0100 Subject: [PATCH v2 09/18] sysctl: treewide: constify ctl_table_root::set_ownership MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231204-const-sysctl-v2-9-7a5060b11447@weissschuh.net> References: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> In-Reply-To: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> To: Kees Cook , "Gustavo A. R. Silva" , Luis Chamberlain , Iurii Zaikin , Greg Kroah-Hartman , Joel Granados Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701676350; l=1372; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=v0MXLGIsisRjyz+2q8S4lNJCjp7Kc1OsT9OWJgMTDC0=; b=36piJllEmuNADES2V+irUyjSXbQwWiVHfuHvaVtX4ZUFuaW3bGFv0NxakonPgvNZa1veydxZy r6beTa7NJ3SCdG+Ab8rKNLOvH7rjBf1WSb68bEFxJ4QKHESQJbBmCiq X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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 howler.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 (howler.vger.email [0.0.0.0]); Sun, 03 Dec 2023 23:53:19 -0800 (PST) In a future commit the sysctl core will only use "const struct ctl_table". As a preparation for that adapt the set_ownership callbacks. Signed-off-by: Thomas Weißschuh --- include/linux/sysctl.h | 2 +- net/sysctl_net.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 26a38161c28f..800154e1ff88 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -205,7 +205,7 @@ struct ctl_table_root { struct ctl_table_set default_set; struct ctl_table_set *(*lookup)(struct ctl_table_root *root); void (*set_ownership)(struct ctl_table_header *head, - struct ctl_table *table, + const struct ctl_table *table, kuid_t *uid, kgid_t *gid); int (*permissions)(struct ctl_table_header *head, struct ctl_table *table); }; diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 051ed5f6fc93..1310ef8f0958 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c @@ -54,7 +54,7 @@ static int net_ctl_permissions(struct ctl_table_header *head, } static void net_ctl_set_ownership(struct ctl_table_header *head, - struct ctl_table *table, + const struct ctl_table *table, kuid_t *uid, kgid_t *gid) { struct net *net = container_of(head->set, struct net, sysctls); -- 2.43.0