Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2791209lqt; Tue, 23 Apr 2024 01:22:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfFIhXgiQ2PmpOYWj9K4nRqUHR6VaI1pHyXSV/wFy4BNKegxpE6edMJvMDFW5vMmFdhe5bRM0PZzOteudAB+sQUgJQPne0stBXfrt7jw== X-Google-Smtp-Source: AGHT+IFvAe5tCvR2hKfcjNv92/6MoAt2klylIZOC5vVYZwjZABRESbzJ+TJYm56WoS7GW3IVI/0j X-Received: by 2002:ae9:f009:0:b0:78e:bd36:6dbd with SMTP id l9-20020ae9f009000000b0078ebd366dbdmr11891709qkg.34.1713860548604; Tue, 23 Apr 2024 01:22:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713860548; cv=pass; d=google.com; s=arc-20160816; b=tZ6WmZ3AT29c/SCZ0XkM3uVK/545/+L/784RVWMRg0i2VixbA9rMHwP75YfOFhMzRH R8EirWJCKv5HJPFAU/TLIy2kaDxE30v2idsfCfmwCND/yBYTUAZUbgHyTJPomaeW2gu2 SxmvPgFXWN4dF4JnQ8R4WjfADkbNyVyWKrArWMxL/lSnb0oji8laTSLFzcXuFLr0kHw+ 0WHFpjUik8kC+h8iUbDzQUEXh6Lil/Dw3AHFmkTqFcSecSFeE4vHdezZwL1FAlVpJort nv3RTIQ9Wx+vFUiLX5BRVs9ssbvjWKxw9v+dU0lVxt/byi3XkL7OHDnDj90Ma9FTg8ap jM8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=9NcmxJHYCh8V4GKL81XvutCiY2ffNa04Tbdop6aGqp0=; fh=VMT1zhh5TdCzVW4WOkCTD64YoVs6fdICDULVwYjy/wU=; b=jX9I1bhUjcsQEBEk09OuVoAYRywya1TAbdPVQLzoR7Q3CqAzaebxAiFvZ3eeXcX5DW m1PdRD2zA1OPZ4zYmTt3s3qPwjbgsJAEMuY+K7rHuOzeXBDnKQ/ewkj+X9b8BbgzGqZK t+HVdTkZIuDAH2rbAEv0LHiw5CjF2qjbjRLQavgdhL+qO1AY8yZTmXQaHEI+qhyouLnn tSqs3Za7SQFXQ7/iNvoQhBN9HaIWGhCHAeByJSgOQ3TF9//w07dp5dPCA3c0pice4CCE 0AOtTRyqCBkpdkr0W1DOP901gYIOGi1jNJDUXuVj/JTGV2+Nx/DDQaczq+zZ4UdjwBHh S5gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=XZeV3YWG; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-154656-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154656-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id xx14-20020a05620a5d8e00b0078f13d7a8b3si11572246qkn.423.2024.04.23.01.22.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154656-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=XZeV3YWG; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-154656-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154656-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6E8B41C235FC for ; Tue, 23 Apr 2024 08:05:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB07263099; Tue, 23 Apr 2024 08:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="XZeV3YWG" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 E1BF34CDF9; Tue, 23 Apr 2024 08:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713859392; cv=none; b=Ya6viw0K7g6ysUOfZ3po53vCmIny7S2m1AkK0LNU477Oql7Y6/ZUNMRrQ4+xFXaelaACVXfzMSWhsBV56GYMFAfXh1X16j8X7cfVT9L9npKIyEZddFAIcLnTnTLDGvZy9Pa4PcfGGam6qd0bxUTcwUKAAlo5E3ezRgDhV2CqXMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713859392; c=relaxed/simple; bh=O54mll2lZcxHuSuV6IhzlmRJxXGkXc6uykp5lefHyQg=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=gaxnNLFRfa/rRu26DvoPCR2gJF6S5ZUu/9IgdTh7KdXGeiC3VFOFtfiXrB7uipyMy8TyuUUdaaC+RFczQ5hOcUaKzTz728DcUJFUzSVQROsI6t5ufNga4BE7zBC7H1MvXZiy2dKr1NF0gjhNvfOdAUjmPrRktT4jX7dKbgDnvUs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=XZeV3YWG; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=O54mll2lZcxHuSuV6IhzlmRJxXGkXc6uykp5lefHyQg=; h=From:Subject:Date:To:Cc:From; b=XZeV3YWGKdzXDyt2gGdiSBu+tAR9ehmxCo0/cgGTgNF4l9KeVxXCrFY2tRLq1+ykl c6TDhFBKGpJkh/D8HY03220W94T6e0r+dDxGxBkrr0k1umozRGS6gkzuySz0B7Xa/g 8yXILGrDVWsr+D5Q4C7df89uD11g1JxsYDcXWzP0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v3 00/11] sysctl: treewide: constify ctl_table argument of sysctl handlers Date: Tue, 23 Apr 2024 09:54:35 +0200 Message-Id: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIADtpJ2YC/3XOwQ7CIAwG4FdZOIuB4oR48j2Mh411QrIwQxFdl r27bCcT9fg3/b92ZoTRI7FTNbOI2ZMfQwlqVzHrmnBD7ruSGQhQEuDIaSKbBm7HQImXjW7AyI1 RbY1to9EIVqr3iL1/bezlWrLzlMY4bVeyXKcreBBK1r/BLLngUgE0VttWqO78RE9E1j3cPmBiq 5rhQwL1R4IilbdaqU0vNegvaVmWN33FrUoHAQAA To: Luis Chamberlain , Joel Granados , Kees Cook Cc: Eric Dumazet , Dave Chinner , linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-xfs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, kexec@lists.infradead.org, linux-hardening@vger.kernel.org, bridge@lists.linux.dev, lvs-devel@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-sctp@vger.kernel.org, linux-nfs@vger.kernel.org, apparmor@lists.ubuntu.com, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=7199; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=O54mll2lZcxHuSuV6IhzlmRJxXGkXc6uykp5lefHyQg=; b=SEVrV4QL0aRQf4sZAyD6Lh+KIYjBicAEwKhtJ0PUAXQvKQVj+Lo8XxYFfez7YZFSvNW40HQoh r7IOwglEOGsCcMSO1z8xH6fte/UGc8Ay9QjWTKXdmQpGpMwPGKciBsV X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= * Patch 1 is a bugfix for the stack_erasing sysctl handler * Patches 2-10 change various helper functions throughout the kernel to be able to handle 'const ctl_table'. * Patch 11 changes the signatures of all proc handlers through the tree. Some other signatures are also adapted, for details see the commit message. Only patch 1 changes any code at all. The series was compile-tested on top of next-20230423 for i386, x86_64, arm, arm64, riscv, loongarch, s390 and m68k. The series was split from my larger series sysctl-const series [0]. It only focusses on the proc_handlers but is an important step to be able to move all static definitions of ctl_table into .rodata. [0] https://lore.kernel.org/lkml/20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net/ Signed-off-by: Thomas Weißschuh --- Changes in v3: - Rebase on current -next - Cc affected mailing lists again to gather feedback - Link to v2: https://lore.kernel.org/r/20240323-sysctl-const-handler-v2-0-e80b178f1727@weissschuh.net Changes in v2: - Reduce recipient list - Fix source formatting - Rebase onto next-20240322 - Link to v1: https://lore.kernel.org/r/20240315-sysctl-const-handler-v1-0-1322ac7cb03d@weissschuh.net --- Thomas Weißschuh (11): stackleak: don't modify ctl_table argument cgroup: bpf: constify ctl_table arguments and fields hugetlb: constify ctl_table arguments of utility functions utsname: constify ctl_table arguments of utility function neighbour: constify ctl_table arguments of utility function ipv4/sysctl: constify ctl_table arguments of utility functions ipv6/addrconf: constify ctl_table arguments of utility functions ipv6/ndisc: constify ctl_table arguments of utility function ipvs: constify ctl_table arguments of utility functions sysctl: constify ctl_table arguments of utility function sysctl: treewide: constify the ctl_table argument of handlers arch/arm64/kernel/armv8_deprecated.c | 2 +- arch/arm64/kernel/fpsimd.c | 2 +- arch/s390/appldata/appldata_base.c | 10 ++-- arch/s390/kernel/debug.c | 2 +- arch/s390/kernel/topology.c | 2 +- arch/s390/mm/cmm.c | 6 +-- arch/x86/kernel/itmt.c | 2 +- drivers/cdrom/cdrom.c | 4 +- drivers/char/random.c | 6 +-- drivers/macintosh/mac_hid.c | 2 +- drivers/net/vrf.c | 2 +- drivers/parport/procfs.c | 12 ++--- drivers/perf/arm_pmuv3.c | 4 +- drivers/perf/riscv_pmu_sbi.c | 2 +- fs/coredump.c | 2 +- fs/dcache.c | 4 +- fs/drop_caches.c | 2 +- fs/exec.c | 4 +- fs/file_table.c | 4 +- fs/fs-writeback.c | 2 +- fs/inode.c | 4 +- fs/pipe.c | 2 +- fs/quota/dquot.c | 2 +- fs/xfs/xfs_sysctl.c | 6 +-- include/linux/filter.h | 2 +- include/linux/ftrace.h | 4 +- include/linux/mm.h | 8 +-- include/linux/perf_event.h | 6 +-- include/linux/security.h | 2 +- include/linux/sysctl.h | 36 ++++++------- include/linux/vmstat.h | 6 +-- include/linux/writeback.h | 2 +- include/net/ndisc.h | 2 +- include/net/neighbour.h | 6 +-- include/net/netfilter/nf_hooks_lwtunnel.h | 2 +- ipc/ipc_sysctl.c | 8 +-- kernel/bpf/syscall.c | 4 +- kernel/delayacct.c | 4 +- kernel/events/callchain.c | 2 +- kernel/events/core.c | 4 +- kernel/fork.c | 2 +- kernel/hung_task.c | 6 +-- kernel/kexec_core.c | 2 +- kernel/kprobes.c | 2 +- kernel/latencytop.c | 4 +- kernel/pid_namespace.c | 2 +- kernel/pid_sysctl.h | 2 +- kernel/printk/internal.h | 2 +- kernel/printk/printk.c | 2 +- kernel/printk/sysctl.c | 5 +- kernel/sched/core.c | 8 +-- kernel/sched/rt.c | 16 +++--- kernel/sched/topology.c | 2 +- kernel/seccomp.c | 10 ++-- kernel/stackleak.c | 9 ++-- kernel/sysctl.c | 89 ++++++++++++++++--------------- kernel/time/timer.c | 2 +- kernel/trace/ftrace.c | 2 +- kernel/trace/trace.c | 2 +- kernel/trace/trace_events_user.c | 2 +- kernel/trace/trace_stack.c | 2 +- kernel/umh.c | 2 +- kernel/utsname_sysctl.c | 4 +- kernel/watchdog.c | 12 ++--- mm/compaction.c | 6 +-- mm/hugetlb.c | 12 ++--- mm/page-writeback.c | 18 +++---- mm/page_alloc.c | 14 ++--- mm/util.c | 12 ++--- mm/vmstat.c | 4 +- net/bridge/br_netfilter_hooks.c | 2 +- net/core/neighbour.c | 20 +++---- net/core/sysctl_net_core.c | 20 +++---- net/ipv4/devinet.c | 6 +-- net/ipv4/route.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 38 ++++++------- net/ipv6/addrconf.c | 27 +++++----- net/ipv6/ndisc.c | 4 +- net/ipv6/route.c | 2 +- net/ipv6/sysctl_net_ipv6.c | 4 +- net/mpls/af_mpls.c | 4 +- net/netfilter/ipvs/ip_vs_ctl.c | 19 +++---- net/netfilter/nf_conntrack_standalone.c | 2 +- net/netfilter/nf_hooks_lwtunnel.c | 2 +- net/netfilter/nf_log.c | 2 +- net/phonet/sysctl.c | 2 +- net/rds/tcp.c | 4 +- net/sctp/sysctl.c | 32 +++++------ net/sunrpc/sysctl.c | 6 +-- net/sunrpc/xprtrdma/svc_rdma.c | 2 +- security/apparmor/lsm.c | 2 +- security/min_addr.c | 2 +- security/yama/yama_lsm.c | 2 +- 93 files changed, 329 insertions(+), 322 deletions(-) --- base-commit: a59668a9397e7245b26e9be85d23f242ff757ae8 change-id: 20231226-sysctl-const-handler-883b5eba7e80 Best regards, -- Thomas Weißschuh