From patchwork Tue Apr 23 07:54:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCDD6C4345F for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C4176B00C3; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 273D96B00C2; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 115A36B00C5; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E4C6E6B00C2 for ; Tue, 23 Apr 2024 03:56:06 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9304540D02 for ; Tue, 23 Apr 2024 07:56:06 +0000 (UTC) X-FDA: 82040038332.29.330878A Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf24.hostedemail.com (Postfix) with ESMTP id 7F11318000D for ; Tue, 23 Apr 2024 07:56:04 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=Z4eTOEAy; spf=pass (imf24.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858965; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=reLIALz4yrGPa2Maf42WE5W2xh6MNwrmYJFLiHtadB4=; b=Jm5/iaojfq5QEQZa5gqRNF001wOeSfzJmL3NgGWBh7hGD3FT3zosEB7tbDzwTs0EipD6GS uMb/8l4wMyAyue49jv6PtZGhjwT4i81O2wAAm++nLwb0nndhKC14B1LsG08qhlgRWZt8IQ wZhyECrM3e6eF5ZhNVGw5z5sD3RAG5g= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858965; a=rsa-sha256; cv=none; b=0iBclhePqGqCyyDWJ14sIvD+K8SIpHsFUbSWtU3qLW3Xy+6H4qjW6aLh4O+agR2wBB3xG0 tlBCJnlfOmi97Yl+NGOFCQURmycSN4O0CipNthjgoMd44sqCuPogUoWCBpRHzGzM5FWkNL hRFH1Vc5rcziCWDv3Wg6+Pf8Bifxxyw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=Z4eTOEAy; spf=pass (imf24.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=D/3OJwMoANYNDnHN43YEhKh/XOzsWgZJBxcvKVpFvHo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Z4eTOEAyeZGZRhMLErDlHrOzyIn7K/DlkM60MPZgILl0NsHakg85D489lgcJ2pyps w8ZjrPHlpbLbeknooUuGV8AX44PHoyXa1MFbZ8JyqpCmrdU3drnEDl22/6rS7GAbFk mLBVLjPqI1ce59ORnQdEOqbJ1Zk5A8F74faI2Ijw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:36 +0200 Subject: [PATCH v3 01/11] stackleak: don't modify ctl_table argument MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-1-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=1205; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=D/3OJwMoANYNDnHN43YEhKh/XOzsWgZJBxcvKVpFvHo=; b=1RhNomBbqj6XFaD6ZYOxEHBLV6bfBHp2WGUjkt4XBn/Ez17CpMDHBnau1hMCabUBp0fIJIUhv lq3ewsWLz9gCbCEhY4DcLZnRRhb9Y2u6rar0aoKgOs7QrHrAJv1mc4Z X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Stat-Signature: 6rq9xkdw33r3mdudxdco8nenq5446nwt X-Rspamd-Queue-Id: 7F11318000D X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713858964-35127 X-HE-Meta: U2FsdGVkX1+fTsT/goaCRPAwh15ZEchiyojVY3lhKlGlgUwSgJt1k9WXiy8PU1K7tAKTcidpdYAzTWgP4F1rDfQp7X5Tuh01a8Sr/xxRZMmaGSmGpHzyts0kiyMblynB1bAmAGbUsUE4+oNdUJ1KEO5P9i8+yb7vaavAlbAe27hWzvnaFFKeWxPU3mC5wqkHoRyyQywCIOa1i6ZyQ2BJz5iB4+zZ196VCKSX7MxYfs/hlpGUoZr1fVzPmQuRzr3e8s2tv7lC9zoMmbaok/JQHh/wWw2huCYLUcbeShrnOPWD0i8EJpOlvpjMKg3E8YqUq9U4x90DDUzjXgvCPCTA07hF6ObcfcBWN9pp9hla9yTHLzNLrED879xaw7EIQXO9gInb8I6Aniesr7DupOKRzoKOEtm40jz+eh+33Ud3pm0Y3daVnT+5YVD41q/PbBQT/NQBq3qrDHeig+o7ImOh9yIJ51zuEJAeU6lT00GKsQUL/ggXd8GMPd4HD1zauE5g3772icbr+//65zvVEt2VlCMmIfrYRgy9eDNyDuMyoThe4CI75CbzOZVtZHKzwCitkqjnP3W1qjhy3nByHD6inok8NA7Rb1qfjWWGKJVPuCQvXobyDWlK9NYnnkZ0oHcabk5ek8Vm1dqBIEyOazrXTp1wbncrz5YbGmx9VbGvGyQmd3QsVL/cZyubb+fEZKWCvKMZHbA8s1QHxclYsTJT8T/IuGSIp9bX9BBeJunPfJ/XnYqG/dnVh1UaTitq1wCwJuHUvb8rqGBrPHItR6KOQf/8MRu16x+9hj3edfItChKNLgGjvMNMq6O0dDTubFNpCcTzyyAHImo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers will change to "const struct ctl_table". As a preparation for that adapt the logic to work with a temporary variable, similar to how it is done in other parts of the kernel. Fixes: 964c9dff0091 ("stackleak: Allow runtime disabling of kernel stack erasing") Acked-by: Kees Cook Signed-off-by: Thomas Weißschuh --- kernel/stackleak.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/stackleak.c b/kernel/stackleak.c index d099f3affcf1..558b9d6d28d3 100644 --- a/kernel/stackleak.c +++ b/kernel/stackleak.c @@ -27,10 +27,11 @@ static int stack_erasing_sysctl(struct ctl_table *table, int write, int ret = 0; int state = !static_branch_unlikely(&stack_erasing_bypass); int prev_state = state; + struct ctl_table tmp = *table; - table->data = &state; - table->maxlen = sizeof(int); - ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + tmp.data = &state; + tmp.maxlen = sizeof(int); + ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); state = !!state; if (ret || !write || state == prev_state) return ret; From patchwork Tue Apr 23 07:54:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3498BC4345F for ; Tue, 23 Apr 2024 07:56:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7B766B00C8; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B2A86B00CD; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 532DD6B00C9; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 172E06B00C8 for ; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C3521A0E40 for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) X-FDA: 82040038374.18.4E49340 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf25.hostedemail.com (Postfix) with ESMTP id 0863BA0014 for ; Tue, 23 Apr 2024 07:56:05 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=qrpXb4E7; spf=pass (imf25.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858966; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aXTQUbdyz09aj7nbLnET8Y7hAVd6gS+jhIxjNyb6mHg=; b=hYdaoX9lJtd/UggOehiZrLLpyDCMbiqNXsE4fOdNPT1/HrGuUTSgFN6sYHW0cQ18EiKQIV UhmfLKZ6mX5PjeRd/wX6JYT8WJGfFD0YG2SX2gGMg4+gI+sQfRNKQnEuQ0VdUj3C1RRjOG zvfVvvZRa6CDSuCqH4BzcXtwB+qKbFE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=qrpXb4E7; spf=pass (imf25.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858966; a=rsa-sha256; cv=none; b=SImNDbxEUj3R7ZGY3Zr/RjxdvF/YhRqum0S9qhiuKPe0Ac+86Q9z/q4miCPkiutijAVWGO pg3LgVdjKttmg64nGTw/bE9RQt4u1nSvrGW1EHusLaidznXnZr567h3dq173yNfHhYr8V/ Akwhl1wZ7RADqhNIO/E2FLtH84chvTY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=1pR6m5Wi5iIO9mWeE7uFEYPdE/xPU01dcPav6FtcGgk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qrpXb4E7M7hSiZ8Cf2INubIQwovOxf8rtiST2nTdYG56P/i02vaGe83f+9bvQprvq VgpcOsvaoWCndC7LXwkbN21msJ81t9jqvLggR4K6+dWl6vt6tbFaQ5B1IFnTi+I3Mw H0IMGkDPx1RTLLHkm4qk51fTBM34bIyN02uPPn08= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:37 +0200 Subject: [PATCH v3 02/11] cgroup: bpf: constify ctl_table arguments and fields MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-2-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=686; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1pR6m5Wi5iIO9mWeE7uFEYPdE/xPU01dcPav6FtcGgk=; b=pcm/jJjouDKJ7dKkXuplkCwgN4lakaTVY5yViah+TEyJb0kgB/5JxKSM28vhTdxT/a0KzPrgc T5MafpuEka/DMwunsovOVuekoxGTF4FJjqwg/mb6qFtEZR2YOr2vquk X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Stat-Signature: ogd1t6oth6m6p5zn6nuc54obakoimawn X-Rspamd-Queue-Id: 0863BA0014 X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1713858965-929499 X-HE-Meta: U2FsdGVkX19abRJT2tkd4d31udtYkOGFx/r5PsDMFWcLLx70PC2HotVPowIUvO6Bztg0MHRFyAUVLBvs+8Tw/rchHRc+MzG7yxIdpNVsr/0qabbXl4xr7+6Ag9VZiDka/QTE9MOQWCne/JQGbhOFlmtVRi5UnZP0lM2hV4PcaW6rL+OcFFwsGwUCptYLMC3iQwDfjM8PGINLUZLcXSY9nWWDkjNyxMXMNSRN3E7LhKhGOvBQisVo9KSNpivAGAce/00wiHYbYhGnJDuK+I+9ksMSX1dBof3iBhiSVwdCBkF5TQwLvtFjHnWuiSxkQgB763+XmiBG9ghdT8cac22BQy80Ue5esyiIzZWjPjOMHgPl3aIWnq2Pvckvqz2kcGiPw2m0GpAfbqig2krss+vu8323FozwQG4RjyxYGoMrPkyvBY2pmmxOUlmDNELiIih4OK51fxtnR2CadKKhZk8QNOZWgH5mF8taViEDfYVpu8Wa5USRHWlwuwm6xiQHTdWsayM74q8UGNEqy8y0ZvhFIJjiNzIw1pYS9tatF/BGKOO8PXIyjwG1rL6XjPM++12vpzmuChNKBD4oVRLeLqhrsc/8rqYpocnDqHVbl/IQ1hVt/Yy7IMzBKVRsHPsCtnW/cvR6wz+vU2c/xgodtE+xvU2+iEJ4e9SUzr00+GnLbU/AfunzZ86xrRqDzke8BR5M11deBMFYdOU0eTJspgdzzNDz70IRb9bP2HY+Bl/Q0zHUKVEOTdT0Tih5THRCYwJIUznOUBZUVtvtoNm5gOaSNIoUaDQ7bUY1jdSrDqcy09Fb3VvqtW5ohPE+y3jgWnjbzoG9ZyXszej1rVukgJzO3BDBFiCDNmlhzsEoOwqKhsxH3GyWSNAAFoWcCjpWdnXBYJmSTeRTFl2u3sbz1F8f2Msc3HD5P9XH8YFkXB+H6vI1SMr83mbKnqvkuxDg0+xNOIVHSfU5y2YSAnB4OP+ zjpT8KwN VZMpXyIr6B6rjfs+A24XX1CbgCAA7ZLTP3J0Y3PdyUNG6OshL6RbYpeyk9NSckJo0uNNhxzPvfWyhfcHNKliKpNix9kmdxlGmQlRwZmfpQEzXu6sCpY3xCz71iBhb1ureqRAMGXmOTa54lW8LAIBDq9ewDQ4u7LO2x++AYzA7X/CD+c2Bx7135h/Bv9bkjA6A4PgiBTJhEvnsbHamEN5INDgO6g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the sysctl core will only use "const struct ctl_table". As a preparation for that adapt the cgroup-bpf code. Signed-off-by: Thomas Weißschuh --- include/linux/filter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 7a27f19bf44d..4eada55a2df8 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -1404,7 +1404,7 @@ struct bpf_sock_ops_kern { struct bpf_sysctl_kern { struct ctl_table_header *head; - struct ctl_table *table; + const struct ctl_table *table; void *cur_val; size_t cur_len; void *new_val; From patchwork Tue Apr 23 07:54:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30015C4345F for ; Tue, 23 Apr 2024 07:56:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C9BA6B00C5; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 050926B00C9; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE5086B00C8; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C03506B00C5 for ; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 66F65801DA for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) X-FDA: 82040038374.08.B8948CD Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf10.hostedemail.com (Postfix) with ESMTP id A5259C0009 for ; Tue, 23 Apr 2024 07:56:05 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=dzsiMjXG; spf=pass (imf10.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858965; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/qpxneV6QXXa3ldi9X8/PDcAcM2Z9Q+xYllYIWVWWP0=; b=DINJSwNIk46Jo4IKE3uPvhTaCNkZg4lq3nJewj7OohCE5alsgOuZJ44URQSnPU32p4FsKi MRiIKi/aFtGHCe/xHDJTEdG4/SXxYVnPFDbZIM2U7R5QDNdiQ1ks34GwSF1lr7pGxfVi9x SSI8+CwbRBKAy5JYy3tUZ49na3Guato= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858965; a=rsa-sha256; cv=none; b=IjqoYL95xh1bS5wkaVUfXw3VKsOdGR7LTTCOu1wHyuuWe7BbIlJQfRcF3JM0a2wjUOoBso k+CGsHcDJdaF37gbSv+KtJt9x/zZ08HeAU6POX0njEgj8N7PEcQxB1Brf7OtrxxWWdlwQV JSNTPKAT9ra1hMGcy/reuQa1D0zVXDk= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=dzsiMjXG; spf=pass (imf10.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=rorPfneHsH4rUwSDhKhni5qatzGJBaNeOV3jbM8lXHw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dzsiMjXGUMnBeinztfZVIlnYV1FybTv3PVNga/7GNRmjq0tvokzKVmAqMxqZ4TZfu 3Mm9Xa73ByvDCbl+zSGzluYBcTMsPar3kyGR78xthILGtEnmvJBhKWCBZI5pDCg6C/ UHsAfQ2uBimCPXwCv8/f91yRU/qBVoZCnvSEXqbk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:38 +0200 Subject: [PATCH v3 03/11] hugetlb: constify ctl_table arguments of utility functions MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-3-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=1138; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=rorPfneHsH4rUwSDhKhni5qatzGJBaNeOV3jbM8lXHw=; b=uf+pHLZXXpo1yHHJ2Z13M1e5OT7jsu5lvkviloIZv10UAQiz7g1qEzlA2Tlm9z/kgvmk0wE7S t+OfiZGT2B0DcKcd55qz3Jc+6I9uA8iEvRoTSo4pFJmvocUaelGw1Ie X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A5259C0009 X-Stat-Signature: ha7eiynr3jsfjo7juuyj6eew467sqags X-Rspam-User: X-HE-Tag: 1713858965-134820 X-HE-Meta: U2FsdGVkX19l7S6MwQH9IwFUF+rBOPgj6NzhZKL68p99jYSGFIVw/A5+wt2S0eZj++wsQpx8XvBBU5NuWbxX1gswCqmPrWTVzG09CSIvBxBuuTNe53d64PiQzC1LshtHIRkDh0fPkQHAQWcFKeprkzR4Ds2tGW0O00hggtbuu/iBtsg6g0vyKHzf8xYQgL+vCDoQ9zGPUcjTk+nJSe/1sc/mbDPXW7+PNV8tTZe+Vktr7sbHY8Ynvu6CwEb+cxvLv53a76jqgnxjQGR78YWHZ3rOJXQN/oKzJPinRdcrMJyYY6y5Q2IuWR+Q+Yo+uKQM64F3wKjRw2r7IwvIzDUksA9ycf3SmA2/KX950YHOvBryYY7TLQnnKzc5QRicRfB8ZPzIECN+szQToy1oezeX9lTTrRg1mvZK8KyDD8VFeewRmQNXZ5Mt2r20Pr2UJ1+HJjUl3uZRfHDGhsnGJrZZCKIvG0fO/KYl0/86BQSIj9oz0OZisKu2nRbikQkN7HW50q5zU0/Pm678g+6MmF0FN3+IkF1GbRfjxS831rwuROcYeZU4sQJaHiJ1AmV2CBLjZjjN3T+f4A/40tNBwbRCChl666+9Z0O+lPw+0lPb/lHvZv8F1sboHNJhBatNu6xNbTEvIf/iR8BNlY40PHq6j0ba5RI9JrWXUkL0tSvZ6Udm+DnrD9JJVN6zTVmV/1y25Xva8plNBUCWHQuDKiwOqWbG+qxdz0OI+zgNy89M3+LGTSbJ+3H6KC8S0PV6DZjtfyIYeBCcKZC4luMepzaBJvWdvG/BANaHQpVVmN8qF77T5wSjLa8wn9i/YVbn5jmMRRZG0bmDp5Pjt6SgZhjynZAUZkxnUOdC8ryXBtklFT2G5JX3/iYPI7DX2JDJlWLiRnDBYAl44ZpZ8jwGn8dq+2ZenmQjt4aWShj4fuCaVU1z4ittdzkteE5NS4V9IFZ1yzH/ZZbSPEd/RZvoTbz +NQSHHrk oJ144yStpxYx3PymCckFCPzIsXLQOrQWIvUYf+VM922HOx+meePcl3qtXrapmY6HR+noJnUSsZ/YO6FLyb+c+RrPUbs7cHXfPPMeZkQAlMt1WnAkDb6AiDILMgJRrLjfrz0NYZpsj+hxubos2FROj0RZMwU9hOzVhVmZTQjxW1sevyuUojXLBbzwMFvUrp6rsNoeJz1jeIjERV5WmtMZYLnd5og== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helpers. Signed-off-by: Thomas Weißschuh --- mm/hugetlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3b7d5ddc32ad..8d12ce63a439 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4911,7 +4911,7 @@ static unsigned int allowed_mems_nr(struct hstate *h) } #ifdef CONFIG_SYSCTL -static int proc_hugetlb_doulongvec_minmax(struct ctl_table *table, int write, +static int proc_hugetlb_doulongvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos, unsigned long *out) { @@ -4928,7 +4928,7 @@ static int proc_hugetlb_doulongvec_minmax(struct ctl_table *table, int write, } static int hugetlb_sysctl_handler_common(bool obey_mempolicy, - struct ctl_table *table, int write, + const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { struct hstate *h = &default_hstate; From patchwork Tue Apr 23 07:54:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF471C04FF8 for ; Tue, 23 Apr 2024 07:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A7026B00C6; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72F266B00C8; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46FBA6B00CB; Tue, 23 Apr 2024 03:56:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 021906B00C6 for ; Tue, 23 Apr 2024 03:56:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B440BC0697 for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) X-FDA: 82040038374.20.E50666C Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf07.hostedemail.com (Postfix) with ESMTP id 006A84001E for ; Tue, 23 Apr 2024 07:56:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=HfImcajL; spf=pass (imf07.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858966; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uX9q7voY2/t78vmYjI1zYaX1XEM3o5/p4a5uy/8deh8=; b=R5C26d7btp/rb4exXTrrn/WzZJGlDvLPVw5fO6BQc4zaumgz4aOy+t4b/b6shL+V00iyGt KF13lHk07TaGNlIF2hFY5vhYT8IbNrxBUXZzF4HP75sef5J5gjLRvUi7YFLsMnvIcci+wf ZH02a9GNUH0HPJ+LAv4bcUTQTdYXCEQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858966; a=rsa-sha256; cv=none; b=ElrIovgrIavRubk4ad7NFaxeZ+TW2b3Fe1S5yALnEkmrbdzJwZfxxh34F/TL8B8UnmuSD1 tktfJ7j1MzF9ROjVgu1MJD1VRRjISBw8jkArjBPn9XIAPIpSsFNuA+ZgiEvDfDXtr++MlM PuqCWLzTWpkWXjDi1CSvgvrPKHstD5Q= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=HfImcajL; spf=pass (imf07.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=opGR4gpnAvbs+lyNBq6fdLjOrQBbmIYYx1eB7UGZHV4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HfImcajLyH9fRAHB6Ui+Edknzu1unFNUQsyZkN6W9dmfU+gHpYzWRB8z1jdPEJfrY Pr+tQUXouYF6Fr8ZB0dJgU5uJKyqI4ZpirRA8P4QYR64pl5zSDWYNSCG1oUxNDMuR7 AXYmALCXm31TMp71SE8rzh6qU7YGEq6bCde/2XZw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:39 +0200 Subject: [PATCH v3 04/11] utsname: constify ctl_table arguments of utility function MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-4-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=696; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=opGR4gpnAvbs+lyNBq6fdLjOrQBbmIYYx1eB7UGZHV4=; b=ed5W9yz6Y3PYc8dy+kq6hSu45FqtfkT99vg42nbOB1Ni65LnrRYJQZmla0Oue7XwR99Gbnjaj bId0PbgErm0AeGk6gclOc5pv5Xfx6JPwBqf+J7ohAIHsKXAVAE3Ars1 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 006A84001E X-Stat-Signature: kwiejfx6oukpzi4bonpzeee4kdyp7zun X-HE-Tag: 1713858965-164538 X-HE-Meta: U2FsdGVkX19ObfpFduxQ9aeBcqV94BpjOUjRsai1pWpESbYvLGSvfpe5q6y9sKW0bH6s8+XBHE+S6NPoXccB5hgCmRL/BO4t2HnGBPXoQZdVfPgx+NW6Jin1yQ/RTUh5oBlkOisklDoZVqT89IUFEYeXXaQOpE6iNroE+7uNhngmvbR94E+2oh2luOcfxxADAjGG/bH1GvA6v7qIJhbJ3YsjJFsJd/0ZMJ7FliFaBTWlwMGfXAUf6nAy4WBfRtVQ9A/VdMX5pln/ew88WTk2XNhrH8X2RDH2h0jui0x5Ju5w8RODAnmO7NNVuDGIX21CZj3DpzDV30oP87wYD6nODN2Lz7dCmoe52AEWyv9q1PDNiHTv5hVunNeyEnfv/q3UfsMKEKruYYEPDqeR8+/EZRGBpkYi6mIkSmJxE6Psgh9gf/fWty99/O649NT3Ef6W2NCrP8B5TYiE8vndKOUJX0Y4W21pWThTFC/PhGQoGx4kpdW1v66LAaguZDBVVLHaVOKpTyuXg/Zmk31OOK7wuhqB8FcB/tsv371+agiqvFFuR8kKx7KvQVs15mEL/qFjgcj+/zdeViJabJ70HKQRKODe28c4cJADg8NXQsxwkJ9Z6zqBg1jjk9sceL1IxQuEYp9N4Sg3+n4ANuzClnkPEn41+JgIAppSLMCMjlF/vTiupXsrUH2tO9qpPruMXv/+Aa3nmU3sxSpMkAsjIYzghUGNRZ8RMdoRgM1SfFbW0ez/M17kwzrIbLbGQtL+tuz0M8pnvwtUA9iYVv1yE8LW5EzTKq2MqLEQccseeZmcgzKcn8lPuvDXatwrUpO+9DvXvNPtFH048ZGpk8qo6fmeZ2i1mScO1y8Yd1XgXuMP8h07KpvRdhWN8J8MMn/BkMXhgSqz+NcbCdep+uj+zK+kHEGgXzzbOToLraCg9uBhSrqMyLBpIAvly6tqaxN9nIi1C8YMSPgYZZQsXthktuA WVIxhVp5 hzw5vFAw34Sakq1SJfo5OYiwpKvcY0Z+hflE3yLv23W3AhOIGh+YtdUvMpsB1olKsDjwmi0hzIHHzxNrDgnThX2dleVKDnyJBTG1SQnLr+quJjId5U7SLATA0RNiVUd93DgADiQi3Q2SPbjtNV16SfBKAaMeaaPzhPNsRbsYtCB/SteJyNUmUfXsPw/9+CIfGPKz3j0ubunYcdG562OL1wr7BMQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helper. Signed-off-by: Thomas Weißschuh --- kernel/utsname_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 76a772072557..04e4513f2985 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -15,7 +15,7 @@ #ifdef CONFIG_PROC_SYSCTL -static void *get_uts(struct ctl_table *table) +static void *get_uts(const struct ctl_table *table) { char *which = table->data; struct uts_namespace *uts_ns; From patchwork Tue Apr 23 07:54:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4C5EC4345F for ; Tue, 23 Apr 2024 07:56:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EBEA6B00CD; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E5E06B00CB; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24D5B6B00D0; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E25156B00CD for ; Tue, 23 Apr 2024 03:56:09 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 89D3F1C12F2 for ; Tue, 23 Apr 2024 07:56:09 +0000 (UTC) X-FDA: 82040038458.05.D227BBC Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf18.hostedemail.com (Postfix) with ESMTP id E055C1C0005 for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=dtp2KrFT; spf=pass (imf18.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cRO+HDvPAFtWjU15NZurUgUgr1bdJer2r7B6/F9QL6A=; b=aHLml6pWEhWf6AiTH91f5zmAGQnnaa74vw2fG6TsPcxZGAf43reeFlSF4hxA+s2qqp36wc QJD/nMUB7MOdUphyVTPOPW0TfjW673Ctcy0c+PArEkaGJn+AvOgVPE4qa+kVMR0wDfsdxQ VpXVY5lDyTkZbMIvfA35Bvv6Tl4okjQ= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=dtp2KrFT; spf=pass (imf18.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=5kdT7lzpFaP84MuKytL9jTRoTEn5L/wd6kzcSBXHfT3rVt89yANyOLGaoG8b3z6CjpYEAu 5o5Qv5Ek5jNaL0HZneIRmYQU/mlEBLTlTDxJewWVEWAc6wvyO0QmLN4jwwnbPMj+ksif7m vf4fgVNbzEAH5iEKSwDlEnYMd8oxjBA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=C10U8w+9znaxkvj5EdGV6iNeFy+LKwoCMige5+WbmRk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dtp2KrFTs1ZPOV423X3Lj+ohYH+w1R0E/8kBpk9DMXXZtdIcFmbTu30wN5OkBGmMP FLzPXuqgfXj6gzjMKHmGAW69Xpdffu14WLEeO5qDjUe0ZwtkRmnV3IoKoevaneipoy 3sjOVDTg0D0OU3K0YuEo6+K2obOUKB6HIC+G61H4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:40 +0200 Subject: [PATCH v3 05/11] neighbour: constify ctl_table arguments of utility function MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-5-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=808; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=C10U8w+9znaxkvj5EdGV6iNeFy+LKwoCMige5+WbmRk=; b=EAoTey3kmtnh/z6T2K9kHOuOiGQPDvnlrHzdVg4MNSMG74MpVnrzaAzOlr8qG7tTA+0aGApZ5 EfQ5uq8SVYaAWFetEV8qu3UzVUp6J12UzjZsoq4ZupsTosh3ACnOL89 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Stat-Signature: gqzuk9yrd3r19ek95x49kyj1n7qn9fjg X-Rspamd-Queue-Id: E055C1C0005 X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1713858967-912665 X-HE-Meta: U2FsdGVkX19yUPqJggRVERfjRDcydqXbGSIBz9dKCYETlOeQraoRAEJh4smVWdJvDhQ84NQJqHlO2yXao7rf2BxiG8QpO4ty3nWFRB2aUPVvfU6PRNe+Q013g46rVcBkbJeLw3kQLVX5Q05H7q4EXjdbCiUDX7RPGYVocf8bm7SwCvUgtMIqjQU71Xu4EgyrcFFYtWwNrwFmtxuA/pQMBWB9FdCUbe8KHdZI0CMX6mmqFC6icXu7+o/dUKbU+iKnKCwrNHXzNrK0Ifrv/7roH03wDaSFkeFfd7HzLIIbHA8eYXKpqqNoT/Poq+aChlJwXK3SURG6ZUc1IDj0s1hwAEnPfTzBW4SLPyUu52uMuQM1Z1uVUHRT43SzC9xh5lMtWNDGUQ2L37hOx2dT+13ZSNqeLSw11z96yChxIhwnAYKzjMeE5wS+KM+l0Ih5GFKYBxQD4Fmv7NNg0EMPE9u9G4NB1bT3Do2fE+eU0Z6yXG/Cr38nkr8zi+x4V+cOH02usA+leI+v9hGWxNy1nRWftbS7RsOnmnttW5bvARgwqzmA8GkIX6txdrD7fMxtIAJ9jI3V6NOAWrYvfmn8GgdyT3ubZWJ2nPOErXam/0MMZ6ifoI8o/cAZiCqCL2/B57QD2s6USKcegwntCeGuP+nS51vudlZuykV9p1s3fqvdXjDRV4yE6LYc0507uESnKitfRqOVwCDO8Y6Gppkw2BNzqhBdustr19FqyTCQ9VCZygvUCMqdOq44CoV68hzBEGNXy+xlMbv7KaJqcPf5FDzCh/bPDYORy9wCyqCLlZN55HkOXxbJAlaZnb1b5m7Kj7A1FFHlv5vFn7s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helper. Signed-off-by: Thomas Weißschuh --- net/core/neighbour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 0805c00c63d4..92a01664a723 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -3578,7 +3578,7 @@ static void neigh_copy_dflt_parms(struct net *net, struct neigh_parms *p, rcu_read_unlock(); } -static void neigh_proc_update(struct ctl_table *ctl, int write) +static void neigh_proc_update(const struct ctl_table *ctl, int write) { struct net_device *dev = ctl->extra1; struct neigh_parms *p = ctl->extra2; From patchwork Tue Apr 23 07:54:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 839EBC04FF8 for ; Tue, 23 Apr 2024 07:56:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3B136B00CB; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E2A66B00D0; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D3196B00D2; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E94706B00CE for ; Tue, 23 Apr 2024 03:56:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A28A81A039A for ; Tue, 23 Apr 2024 07:56:09 +0000 (UTC) X-FDA: 82040038458.29.695CD90 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf19.hostedemail.com (Postfix) with ESMTP id D84D11A000B for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=Jh4kHqKR; spf=pass (imf19.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=6ZiyJhnARpYNhF3k/awQGWJfL88Hn+uS1iRa3Vdzpi222P9jUoXpalUI15x9tF+Vfip7lt aPNESfxI6UbdvAI6LuJ3ae1nEXaYiRjXsUpLqTxStanLHln2BYSLmgL2jXCwMgCm9g7MXB yogUN3qnwl5P7kQm5EtDxTb94nxflEI= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=Jh4kHqKR; spf=pass (imf19.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3MfFt51f4y3TwLLTLV3pPxUJwgdlScOTYqT2TYQV5hQ=; b=p/AtMlO8KziIN0PIpG68tQcV6NlhkrkaxyumSBDXetcBSPHB3eIx1DvEfDThRk/53hSTDk 4SJxE19vAAl0iCrF5PvAhc92mu+RRzzlY4crD/P0Ut07rai8HXDrizddF9LSeb6+k5nPAZ /8R9Zut/QyD+msEpUGHmTnOSO3UI3qg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=rhTtJbRFTTDD/EEuqh+xmQGgJG7l1CgJQWXHlODBL5I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Jh4kHqKR8uFfgbO8D9WK1hxUfjPm8iO4Tj/1g9oqbdvZsvOO7NNctmOr5j9hI/VKE pHafcxJ8BdeddjSts/bMxWLccdEWmQmje38r1ok3DoPkrNGs3KG6i7U8YJpR6imRw2 VR1iTBJjamva0pTfL/MxJ99YyYItdDSAEsnB8hOA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:41 +0200 Subject: [PATCH v3 06/11] ipv4/sysctl: constify ctl_table arguments of utility functions MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-6-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=1269; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=rhTtJbRFTTDD/EEuqh+xmQGgJG7l1CgJQWXHlODBL5I=; b=xkBxm95PFV9biLBQXL/jnQoslPWOqeiKfLilfo9X0/w/rpk96uwZ6XcT8dAItQlTvocuJZiXJ AWgjsh5bK7RD2GBrU5dFR8YS1o9Y0qoHpG5ydJoQPSEwJ0OoCUdGv/k X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D84D11A000B X-Stat-Signature: tztb1kmf7qjem9ho9dca7yctbrn8xk4x X-Rspam-User: X-HE-Tag: 1713858967-626653 X-HE-Meta: U2FsdGVkX19gusLb1Cyu3N1IYjBz2P0247APRcjUGoWrCa5dT3VeCc0xln/sUYCHuq9w045WA5qPZ/NaBmLaiMpRhz0nrBqePVXeSUZGGCmXAtZR+pDBQmbtQA+9gqpe4iFHfBqLBnYC7s4HMUVq/yRdBopkDwtUDriX3wIZkwYZrBdlkzyPgSTW9gU9+hjug1D46wRlUs1hOLRX7vFlKJ7N08HGFJv/UhvyIv0RW6OUAwErf2y1pt94Rn3ineqa3/rI81Z50WWpftsLH4Y+EBVV5K9Pw+XFYOo+agBEALMQd+IKyDLGFk8cLPXycadR9shFPQYb+e1mLtbUVH65z8/sa1tytZAXVLd/JOze/L8bV91laIsuudTwioFtzEJD8RovIFtJUS5QPKeES4pHeeRrRPZrVLeBuTRQjgkZFfF1QaAKlK3R4+mQLCVyFcYtkS7Bu9w3d/heDqfwf6ybXwFYtVczA/2mlAibzhe3ZlbzdnNAupDkztjaGHGum3P2W8ORG5wVBRSEGiQYJ3uJEK6wjDmVD99fc/FX3NrSEpZwKWyUBoAJJ7Md163ktq2wnP58pdAQya0M43SHfdOX9QdVuuXns1sqZ4C6Cl8OrDVN+Y4u1Guj6PmEwdIXeoAVXta92/odJ3h2/Io5dBlMgcpp5yxhJ307tRIbnNn3V3vNqxxkRxenauS091w0+IowtOEWDpLVSdsgBeR9J7KcaX5bv9zE0KFG4a9t4OzIQQkzWhAKq8agZH1GvCsqjDg4XNy7eAHvQP/IQBQYFDnuearYhnr9XSxejodscDFj2exSIjCYJQe0bzPuxe7m068+AsGYyDkoD049oZOoQVWAQXz7CDJcAxBZzmSF3XxOIC0CCC5UQHlAWKFhv1zhvj/QSPM2s44z1dkHx9lgQ1iKOt9vWXLXX1AXRRl+X7DIcwK4/TvGKkH2gJOA/JCfnQlC1qRDAtcJK4AOs9jiUfC MyrDGoup H37/dSeNvQZoLNIQg3CCmgwzCtHowJ1kfjEScOwZmvB4Spa5lqv1Lh5zxVqHfCmLO3ZqZdaN+PDl0rvFc9YOQXG49+wKwACJHQreRI1jwcwVk1Ofba8fIET0cMgYWx+dGwKMOPyhLh8/R3OIdMrApIppMp/CypP97X48VC6Ojm4xVxoX17h5dHiYRlxgz19NQYEZkUVfK05XdFLCh1NAd4Xqqgg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helpers. Signed-off-by: Thomas Weißschuh --- net/ipv4/sysctl_net_ipv4.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index ce5d19978a26..fc4c001bf72a 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -130,7 +130,8 @@ static int ipv4_privileged_ports(struct ctl_table *table, int write, return ret; } -static void inet_get_ping_group_range_table(struct ctl_table *table, kgid_t *low, kgid_t *high) +static void inet_get_ping_group_range_table(const struct ctl_table *table, + kgid_t *low, kgid_t *high) { kgid_t *data = table->data; struct net *net = @@ -145,7 +146,8 @@ static void inet_get_ping_group_range_table(struct ctl_table *table, kgid_t *low } /* Update system visible IP port range */ -static void set_ping_group_range(struct ctl_table *table, kgid_t low, kgid_t high) +static void set_ping_group_range(const struct ctl_table *table, + kgid_t low, kgid_t high) { kgid_t *data = table->data; struct net *net = From patchwork Tue Apr 23 07:54:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2A1AC4345F for ; Tue, 23 Apr 2024 07:56:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E8AE6B00D3; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 470696B00CD; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 190CD6B00D1; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D8EC56B00CB for ; Tue, 23 Apr 2024 03:56:09 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 97E7C40E68 for ; Tue, 23 Apr 2024 07:56:09 +0000 (UTC) X-FDA: 82040038458.30.6F52A59 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf12.hostedemail.com (Postfix) with ESMTP id D140640012 for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=cZv9tYu8; spf=pass (imf12.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bhNkIiQYurQjzaJyrrkPdphzlsCNu/7v2I6FxQjVCr8=; b=1NDkSO8aN1+sh7h6RAXI1712FQ6reJ4D2sEbZfPjoE2GXkNlpNH221uUiD/4dg1f+mwR8+ zseSwK4A9mN7ovfFywXA6HDhFqnVJH/glDBr+tD+weijSmKD5JTnsDTVnt2lQZS2FvVTx5 FgwflcHB3Jo1C/wnlzFZbzV50ERGHGQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=Q066taOX5HFyTSmaxJG97gqeCUwb/yCu5+ywEh8TyEfm6UT5iXCRBztMpHLO024kOmowpe F4c3tw1GERngj5sj1S/ouhktDnyNa0KtOakYI6Vu4G7ABSBfLOf3th+eFSS0Jyx19zz4sE LqlbQ3rEeA3AsBwTKVQamHGKkjR5ypI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=cZv9tYu8; spf=pass (imf12.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=Zi29e0eOxt3096ac9S5+YPXUBVokEDqe9aNQ4UAlgts=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cZv9tYu8jocP/CYyJINYfc6gNMFDkTBOvuAOKlCzFGjSQkkOQjo0JESha2IW51Tx2 8ga7jXOZatRJA1l9JDz69bqpRG/VPockakDWzf5aZ3apozniKI/TMoukS3JUAF1jwf 74sydQ3cQRwTNYzc5LQlBGGK7riDu1h8/tleJFis= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:42 +0200 Subject: [PATCH v3 07/11] ipv6/addrconf: constify ctl_table arguments of utility functions MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-7-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=1733; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Zi29e0eOxt3096ac9S5+YPXUBVokEDqe9aNQ4UAlgts=; b=Uw0D0YcV60peceqZ8qkDg47x1/65ErxkGJOFBWaWNhF23zLkktHPe16IBGyrNywDi8Y64Gmfl c6GjQOH3NApB35AQteIr4jMklYZuzfOAKo/zEOjtr7qwLtB/qod7qRv X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Stat-Signature: qo6z1hdmcfiz9p15f1bj17n997d7987k X-Rspamd-Queue-Id: D140640012 X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713858967-688780 X-HE-Meta: U2FsdGVkX1/5He7BbrsY1iQUdFBdJHk+tbjFEHOnR8h7qj13E49gjzMvjgCWs/nZcz4ta5r+V259OT4Mj8sTFXFdAxuLhZFFEzX4KgaX+VWcPAA6mxCcxV5QEdekDwWsCEMnoKdav+SM/DVcR2fFJGPw5DIJWUWMc5xO09rV2cdovLnMNRZtBnruc9t39RL2myt8R16sDv6+ZM/uj08jSIGL4JAjXNr+Y60UZdksefKcmZRbTpReUNmMY7s3I2jrzHlEdgbp5Vk/cXk5vVYBJf3eOXrJfa0s3SiDFnkCUIdtt5NFJ29Ys8KRp0pAKM9NUGztZa8ahaXD1+zkRRDWFm2eA/cXDtTeXVKYx+/ibBHAZhugkKYbUP6YIsi1dFPjM/7UZcBHYzshLq67ejVXrtJAQKaB17M+8gzmqHMVuAwFE+Zj02PpBwt6sbqf9SHX0k/o3y+udlBi4plxuJf4wiscqJ/OhS+JC2JlrvAZlTYqH8MdRRfSWZBVFr1r1g3dw4yqqmVk5IRv+9IVs3W/opDcNtrj/L5dxLlhQtENMdjdRUzho9JEOHJ9V7Mhn0AZgcFXQlEVsUnxI480SDhOxjmnIEfVMijolmStRdgSWyQypugGPRHQhuvaNQFpUS+38muabWinYScHRWrUY8dq90U3zge5WhxBidN1tuEb+DH7a9tzA3s4UlAmRV2vj0KtF5Z+tlia6XfaIGGtuDDDg7iuMGHqhpvysWOAGLRIlfTtuLadFsaw+Bhq/f9j7TnrHKE1avm8le0luWxAjpB5u5sSEiqqeWAU3M6HlhURclAWORY8AV1UWx3goE1/un41sbiHajX5iqpso9Nfgia2mvJk/izTeuuk9lpHi6SMTGyzmQEr9LvN0hQ696zUWRnP/VvRwFJ3TVLwMWjPJ9O3u/9deTyw5fnTho3PHMTe68QGS6QE4LQrrZcSwPnctOmyqyTBllVBo+U84WCwrAY nZL4yGU4 NlKPXXCFdLcc+WqIt6kAzdHLMIrtAxyMotgf6qcii0bsTyDsp2cucRuTNKPcnjVa2k3uGJX93fhU2M7NOZdZ3pL+Nb6JVwtbDq9wG4/oatnIzDXNDdG4PS9baAqgWfdMF+FjV8yjQ8J57ZrpMV6/OHMqEYMWoyFBXvknrUpUDBRB+ErDNswjRS5oYNLCE+g+vXoHmOMemEIAZ47a5kao2hj6XZw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helpers. Signed-off-by: Thomas Weißschuh --- net/ipv6/addrconf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 9aa0900abfa1..96ab349e8ba4 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -863,7 +863,7 @@ static void addrconf_forward_change(struct net *net, __s32 newf) } } -static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf) +static int addrconf_fixup_forwarding(const struct ctl_table *table, int *p, int newf) { struct net *net; int old; @@ -931,7 +931,7 @@ static void addrconf_linkdown_change(struct net *net, __s32 newf) } } -static int addrconf_fixup_linkdown(struct ctl_table *table, int *p, int newf) +static int addrconf_fixup_linkdown(const struct ctl_table *table, int *p, int newf) { struct net *net; int old; @@ -6378,7 +6378,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf) } } -static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf) +static int addrconf_disable_ipv6(const struct ctl_table *table, int *p, int newf) { struct net *net = (struct net *)table->extra2; int old; @@ -6669,7 +6669,7 @@ void addrconf_disable_policy_idev(struct inet6_dev *idev, int val) } static -int addrconf_disable_policy(struct ctl_table *ctl, int *valp, int val) +int addrconf_disable_policy(const struct ctl_table *ctl, int *valp, int val) { struct net *net = (struct net *)ctl->extra2; struct inet6_dev *idev; From patchwork Tue Apr 23 07:54:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42AB5C4345F for ; Tue, 23 Apr 2024 07:56:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E48396B00D5; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9766F6B00D2; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FAE36B00CE; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0E5516B00CF for ; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B4BE3801DA for ; Tue, 23 Apr 2024 07:56:09 +0000 (UTC) X-FDA: 82040038458.21.6CC45C2 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf16.hostedemail.com (Postfix) with ESMTP id 0306618000C for ; Tue, 23 Apr 2024 07:56:07 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=uTNAVwQO; spf=pass (imf16.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RH63MKPwBnqVQniCp8meCxRPD68GQSfUHeVcLvWQV0I=; b=xVadiop/CSEzpIOo8JDEmnexHXlD4Iv8XLHzvty9mb6g9wfNB1CNHwSKf06kvOvig18x/u y1+VcQnf8VcrE0ZG8mKW5ajm2GjX4KQPCDVJtqUWTU8A/iIpfZ5Vf1NpnDwxmzGmmaZ8Yi G/hbl1weyOdaUY1uThoCX4zD3zH4LSM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=JWcg9dsmvXD78QxHyXruizSiKHsIbyhzrCxH92vuzn5o4xgAiuPyIuFVozlW9aVgGiMUqM 8TXZLoci+xaL3HLecXimETZsOkMABrxeLg9S3OCce30m3M9elx6kqGNavAHCsKSREoJ9Hg 2gFC+c6JoUTy7hnaWUhwcjD+VVxkIhk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=uTNAVwQO; spf=pass (imf16.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=m+K+pCOcUIKDJXVlXdIjxkNCOOD+02kNnAffkd4pv3g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uTNAVwQOIrRyal1El9mD80wWXIn5+WwLLWjNLDCcaegSzdSC84+iXuF/GhKNCzZey dqHH7jcVgd6z8KAGRhgZtLRswyOrd22fZMdq605pjyZEWmoyB7lxnYP/oYvWQiq6lf wEKqJImxcbL8ej1t87j4xoAeM5vL0mYBMuWiF53E= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:43 +0200 Subject: [PATCH v3 08/11] ipv6/ndisc: constify ctl_table arguments of utility function MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-8-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=778; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=m+K+pCOcUIKDJXVlXdIjxkNCOOD+02kNnAffkd4pv3g=; b=Q+YktwnSI6kCGsBTIybu9xGGD/NXt4eNC5iasTFmeHPKR3qFek7DAHVOAL6ODtVWxHz0IlTDl mOjC9oMpS6vAF/sGF+2/gRvvMn2SvCRtOwEY6l6YCWFhCxPgYjqZVDv X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Stat-Signature: zt8tttmzyq1aqf76qfrbbuxdu7xdink4 X-Rspamd-Queue-Id: 0306618000C X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713858967-903001 X-HE-Meta: U2FsdGVkX18vYJB27GmjTom04QOVFkN6UdOgS07AQuGb/IC7C/6rK9QpcVPSY2/CtHyfOdz78yQHEepvgAxUk7LSFG+SGwctbvbArAr6A0Ybe2+/b2zvtmLNBohRAHrz6g3MWcmYAOOob3mYVM3ZSxxYeRHmENQr5YTojz4AEH62KDn6PgDR4vZVLnt1pJUi1ieamgleF51Ldc8FTQyehC1yxZ4XlrD6FU0icoIBzTVB4rz12ubmpSWdFihcDFTbL3gNuLEC8wUEK4Ma52sMl8pUm5CxkGMrqnZLZebxJwSLk25aqrv7vh7UqSTjY7ZDd+y1IOG2g0sKaeCGMLQN/kw2f/ATKXA/qno8lK5Er1bAh9mhDsI6X6mnJAJJ+F9gmCQDiPFnR3QLHq3ZwFSXakQlCsQlFE6YdWQQbrUIHiEOlBtQQiZStxTOZIs11foZidvW9BX4oxT9C9u6slMZ9k4swwuz/ADpDYnrxjkCDWOdcwYkuzToGSdu8MoR3JPaEPhgwZDDBtkJMAhPTUuXsICxD4FQp5gvbdBqqryJAU7OeSuOHHrdtQ04Vee0LEk7rKNoJPyNV2uEby3ZITMJcZL09BjFfA9bFqJJjey0rQZkyeYlApcX68E3alGt7VfTSwT38AWolp6RL/0BRJ3OIoM1+inFJ+st0gny/TTN6cHmZVbeafRXY0U9wX7p4WoPnoG4p+aXygHen/5Abs8oReVl9mlIpnEPhm57jgXclxxPdT/0aef7uLbeBvTUIKqXIm9CNT94jXwaLUfzzJRiflTqJgz9MxJiglrXEBIOMlQuB297ut4PiEqcVk/G8kXz76BppxBgvbHNFrjKDmFb6+kEPlMGN/xb4iG8ovN/k4Y5xarbmGSyabtoshzV9mDRbM0zjhvlyv4S4xdbA0g9vmvOUzkZ/gW4o01lXwOeCVR/iol5Qz+AvArrel9IE5rJGSiKibY3dXRZ/QlQJck W7fQJBEX iXG0AEm1oLbDsPW3TfS5H26hvLJae1VLuk3vmzqGVh+Z9QK/551E1+iCcwr+0wRNkCSg7NhYZMj5rDaHIyPpHGQVJR31wLRRosU3jzsWCIF7PHTTckIzEWsqmwsbS79+8LiwveAJ3gxgpJ8QvgO/RxviSf1fnmC69fFUSWKX+ULiGDTnfpXL/LY4Hm1cKgebBtcLx+A37LONlgEQHwcoiet1IGQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helper. Signed-off-by: Thomas Weißschuh --- net/ipv6/ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index ae134634c323..945d5f5ca039 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1936,7 +1936,7 @@ static struct notifier_block ndisc_netdev_notifier = { }; #ifdef CONFIG_SYSCTL -static void ndisc_warn_deprecated_sysctl(struct ctl_table *ctl, +static void ndisc_warn_deprecated_sysctl(const struct ctl_table *ctl, const char *func, const char *dev_name) { static char warncomm[TASK_COMM_LEN]; From patchwork Tue Apr 23 07:54:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C4A9C4345F for ; Tue, 23 Apr 2024 07:56:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81DB26B00CF; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CEF26B00D9; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D2D86B00CF; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AA8506B00D4 for ; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4BE5EC04D0 for ; Tue, 23 Apr 2024 07:56:10 +0000 (UTC) X-FDA: 82040038500.12.C0D8338 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf17.hostedemail.com (Postfix) with ESMTP id 8CD4240015 for ; Tue, 23 Apr 2024 07:56:08 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=iLEuUiqm; dmarc=none; spf=pass (imf17.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rIJs+6xcdTgPiPHzD3/SxSjeiXKKP/u1pSX3IEU0Qdg=; b=D/hjUyCx3xU93oXvbTmSa8OnzKW7FrUUsJIk4ppzA4SoAyyN57crfrzUVeGaoBQ2nPCWaQ 3WVcSROQCviJuM0pcgiotdyMZlA0zUA4TmEOtZF03Yovy2RgMqLojn0aXVtSiOiYwRPUqa ZrssRaRhyrFt+GeqeJrqNs6xm/v0PPY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=iLEuUiqm; dmarc=none; spf=pass (imf17.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=KdQakVLu3hpfR4yy+j7ywkG5emhJr2DSg+yhICsSWftnTrhVBE5W54IOiJ53Q1BsUNJYaJ giGpkt+UthhXf1aNSZ1Xqxn0aJdYsDJ4cKsoayXgrFolxMXl4A14nR1awUwrOWU1yJW9of YBUozk+X0y5IDJ3xA2E5B03gHu3H1LE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=odMbVtXputh1B0wvO7gtV7cKLTLD5qqVWgyPwr4fby8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=iLEuUiqmghQTs4TpLEBZo8gm3hwwbmMwVh4LjetW99mef7fnKS1+JFbAcu6CXN+nU Qkeg3C6Dg8GVXnY7Yt7xJGc6b7m/FkLbHyvle0PIjuq8AhNHSJZCZpA5JwOewu8BaK /noyOblAFfy+/YF6CCqIRarm1v2eXbwf+FU797II= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:44 +0200 Subject: [PATCH v3 09/11] ipvs: constify ctl_table arguments of utility functions MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-9-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=1292; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=odMbVtXputh1B0wvO7gtV7cKLTLD5qqVWgyPwr4fby8=; b=HGS1kdZAsaJZKpg4r6Gy7F4xJbcNv2yq+KS0wT9dr5GDwl8/cNzV2zronax9Lbe4GmE5G3NOC F+TpiwFZuPaBZHHRsyNSIMTh2HPxXZ0cjduuz09UV7awWr9POrydgh8 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8CD4240015 X-Rspam-User: X-Stat-Signature: 6c7qj5ibmqy57dwbccs9im9dyuygzyo9 X-HE-Tag: 1713858968-811092 X-HE-Meta: U2FsdGVkX19WA6ELzoT/AJr2ex7moeN4L4Bj+Y1RaBh3Q8gY25QOV/HURdbGecaXN22ZsEVwj4eoKCq9uFeWXpv8jjrWWj8oVF938aKoLv6RgZERtqI8QjUMFYF4+GEwsjSIgHt7faLC6LrEfgFJwdaZ3tWQWE0tB1AduJe+wApOLhTjf3+PFrw6ynM75MYMxCScFBSoTgquo5TlGDDP8aMd0hqfWhX+xIGVPUnsk0sj6NH2/xq4FH+dzCVDzBF21aPhoiIQccArXNFnEeoZFBf2E69NbxO038DqTgPsBxVpYekDffLatYNy1ZEIw3xruBoQ5giGF1zsS+JwvYv+siEF2f8n89BR6t+ao9r/uqbIrOVBhV46rmtvb2Au/ZvEHYUkP/tWCax4BrDz3+brj03QVvrwIkp7aD9okRjUal8AVtpRPKr8mHNvqwNU9rU7dKSGEFTYAfPq0AUXgIfdq0MlyjgnOkxrjGoeTgBYLNRl2GVGx9oshRd85xXBA1sQN+kOyRRTPY/MfAoQwc0+J6JdMw/QOqv4PKyJzp0WKOurXck1rvK3+ydGVjbUPgsOvtnkBwT8j1ZX7k9fQxuzSO5UrLVQJLo8rEit8Nv2SESKkAvreucD2h2HjulS2taPCuD5FFJn2fz0189OiFMd0ll2TdYyq1tfL5AHjvtNyWwH7JCnshHn6KlugRKrmZB4TCS18PRKRslo1i8cR+wD3wyJSKaJnoyXpo4/9lfHXBLMY8I1k0iA1+7pgvZZ9vXw0UvksaQ0CIEiIDJePGCp0jzSRsaYHqsSFrQaUT8yoCJ80hOCigSxtknutG1jTlhXhNsS/DRpvZtCcOEqwXFhPIX1fkX2RNE1vYPX1YnoyDNf69WqnvI6Osc8iwQZCfjGv9Mwt38klrq/UQ6U2GBv7p1gvMknDlCraZ17zG4xDoolgX1zO6189zn7ItVqP5QNKYWagkaEsmylVY2w6cL 02RoGiNO pGYa0MyJh8hnmO80ziO4ZT9/okli3tPGnQ+HofCRzifzwZ981ysmT/qGgA3oM0qEtdkct4mE+J8Hf1CSJuhkJTMSLKl3rWH4N6T42+i+04I+mkPj5D+ueXzD9hifQ2hyK0X8AxjqKbvHt+1fvfGj7dRUcpaCp/VrKLiOpMCu65UvoXZg7jcaYqSrMJc1hZNvtddmLkLrcqm3gzyV/RVeUyk2JXg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helpers. Signed-off-by: Thomas Weißschuh --- net/netfilter/ipvs/ip_vs_ctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 143a341bbc0a..689ac521ea2d 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -1924,7 +1924,8 @@ proc_do_sync_ports(struct ctl_table *table, int write, return rc; } -static int ipvs_proc_est_cpumask_set(struct ctl_table *table, void *buffer) +static int ipvs_proc_est_cpumask_set(const struct ctl_table *table, + void *buffer) { struct netns_ipvs *ipvs = table->extra2; cpumask_var_t *valp = table->data; @@ -1962,8 +1963,8 @@ static int ipvs_proc_est_cpumask_set(struct ctl_table *table, void *buffer) return ret; } -static int ipvs_proc_est_cpumask_get(struct ctl_table *table, void *buffer, - size_t size) +static int ipvs_proc_est_cpumask_get(const struct ctl_table *table, + void *buffer, size_t size) { struct netns_ipvs *ipvs = table->extra2; cpumask_var_t *valp = table->data; From patchwork Tue Apr 23 07:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 411DDC4345F for ; Tue, 23 Apr 2024 07:56:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D9076B00D4; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33B126B00D6; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A9366B00D7; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AA0946B00CF for ; Tue, 23 Apr 2024 03:56:10 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3D3B0120DEB for ; Tue, 23 Apr 2024 07:56:10 +0000 (UTC) X-FDA: 82040038500.15.971A95F Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf05.hostedemail.com (Postfix) with ESMTP id 83598100009 for ; Tue, 23 Apr 2024 07:56:08 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=BuKkQ4wn; spf=pass (imf05.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=a9R2TDpG8djghZqIV1uRWoI2kPm13d6nldGovHHPoxs=; b=lydx2Wv9azHfJl3SY1Ykujd1Jy4msnfTHdeDWOFnhc21zdLiiECaNurVD4i590yFOeL1yX 86E+4/Kd+9AGj33xSN9zsBtgdFzkAFp1dPCeEQ/kb2lHrWX8h2un6d1evbOWFnm3+C+7ee zu8anPwty8570Ipex9nFVfX2xoDv7/U= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=BuKkQ4wn; spf=pass (imf05.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858968; a=rsa-sha256; cv=none; b=iUVwdTzb5GtJtqcXTn4J7YZ6JVOFu5Pu2AIgw3jYjGo+LXV4/gg1GUHA84YBM/OT8syO3z wV9Z++ZkFo5gNQOw9hPUwhmsfuIdttACbj3hpA4cS9F585XtlOVUuP9dZc5w6wNFiQWLZW cjkJFZXEJIen7VOSqcqNAPz4Q0TF7Ek= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=ydR7obNBKRDnMbLpYk0O5xU1+ChzUePuE2B1VMOxcXg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BuKkQ4wnru53tO4VImE+RBd94hQrxsXOmY7rg+ASOS2vW15touD/aAGtiLNa1kC+7 kC2YollDK7PTHGVEIYC9k1hBEXljd/ZFrzfP4ao96J9I20cbjm5KtPCpR+HwBCFr96 ZKhP+40sphF/eXyhl8i7U8pbsuJQSpZMyZvpLjxI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:45 +0200 Subject: [PATCH v3 10/11] sysctl: constify ctl_table arguments of utility function MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-10-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=4555; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ydR7obNBKRDnMbLpYk0O5xU1+ChzUePuE2B1VMOxcXg=; b=ILR4Nd0n0ptnfip2BSMBBu8wiCN5WTML70FZKdOlvCmeFL1Tz1zsPatlYuvHdEeskE5uykhWp ovqoAP1o0dGDhLLLePYQ0dpqqOG2g0I2Y7dJoidleRvVpkT/QbYbHhD X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Queue-Id: 83598100009 X-Stat-Signature: psuyu3754z41mrxjfc5n836oey99nms5 X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1713858968-862769 X-HE-Meta: U2FsdGVkX19VnVHgyqME4FTfS4vbEDwdffqhBVJZQWCYPT5k7sXVupqsgsQvBP1tjxrAa27iXAYtTWvvGcylY0Cu5rNSGoYrUoNN4wlr+96+sqZmSgP2y94DPFNRSp4kVJO1dkvguIE+vcq5/GpvxT6litpQziFsAoMHFIkPXboC6rUq0pa6f34jjmx68EbtfVWV96U0qvDoW/+/5gJtuoTutzlVH1tgqrPUWaNBsEiyT1ecxLHkvKfRn6EYIzjoIPiGIS5SZ0HqHh1K5vd7/tpEMOXT1odhlraiCCk+/zQ1+G6JTI9Ar9LoeUJrmT6ud9Zrqoj254PCHqEwvOgVEl3P2Jfax4gLxZ87g8m7LNt/n27H93mEugAUUndsi3dCBWhHDqz43NbnjWHyqF/kTcmxKEQF5z4BjCWiomaiJbMUZ0IwiucLrRZV7btq/tnFwt0f57XtuhV9YDOH1GcOkdpf1f0YaM+DKzaehI8J0jTVqazcbEnr7eMbWu7zzt/SxPkmrICfTpUfJVMdsb5fS6wRd0/+a4geePewdfUs3ji2/jKW3mNEg2pI4pw2aUuUda9j3TMOPW22FaCem0+iXML7Wbr91H3CsmkrrahQW/JVgqwwXwDzhhm3VZselfa74nX3r4Mr+ECbA1sw+fnFPIj44zR7MEPZtxho69Qnqn5hjNiMo/85Q9pHHmjyX87vxb4JPKn25NYRRisWPxKd50sF2BBVRoc9duXsOlUJcg1+wlu0dky56cfpoM4191qNDUvpf//v6jBtVkZ+Ll2FMioqUPMz8Uqmym7fkZ5FLLsSn272nDEfpHp07PXwq9R9J8hiopjY7rs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helper. Signed-off-by: Thomas Weißschuh --- include/linux/sysctl.h | 2 +- kernel/sysctl.c | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 09db2f2e6488..54fbec062772 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -237,7 +237,7 @@ extern struct ctl_table_header *register_sysctl_mount_point(const char *path); void do_sysctl_args(void); bool sysctl_is_alias(char *param); -int do_proc_douintvec(struct ctl_table *table, int write, +int do_proc_douintvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, unsigned int *valp, diff --git a/kernel/sysctl.c b/kernel/sysctl.c index e0b917328cf9..62dd27752960 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -205,7 +205,7 @@ static int _proc_do_string(char *data, int maxlen, int write, return 0; } -static void warn_sysctl_write(struct ctl_table *table) +static void warn_sysctl_write(const struct ctl_table *table) { pr_warn_once("%s wrote to %s when file position was not 0!\n" "This will not be supported in the future. To silence this\n" @@ -223,7 +223,7 @@ static void warn_sysctl_write(struct ctl_table *table) * handlers can ignore the return value. */ static bool proc_first_pos_non_zero_ignore(loff_t *ppos, - struct ctl_table *table) + const struct ctl_table *table) { if (!*ppos) return false; @@ -468,7 +468,7 @@ static int do_proc_douintvec_conv(unsigned long *lvalp, static const char proc_wspace_sep[] = { ' ', '\t', '\n' }; -static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, +static int __do_proc_dointvec(void *tbl_data, const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(bool *negp, unsigned long *lvalp, int *valp, @@ -541,7 +541,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, return err; } -static int do_proc_dointvec(struct ctl_table *table, int write, +static int do_proc_dointvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(bool *negp, unsigned long *lvalp, int *valp, int write, void *data), @@ -552,7 +552,7 @@ static int do_proc_dointvec(struct ctl_table *table, int write, } static int do_proc_douintvec_w(unsigned int *tbl_data, - struct ctl_table *table, + const struct ctl_table *table, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, @@ -639,7 +639,7 @@ static int do_proc_douintvec_r(unsigned int *tbl_data, void *buffer, return err; } -static int __do_proc_douintvec(void *tbl_data, struct ctl_table *table, +static int __do_proc_douintvec(void *tbl_data, const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, @@ -675,7 +675,7 @@ static int __do_proc_douintvec(void *tbl_data, struct ctl_table *table, return do_proc_douintvec_r(i, buffer, lenp, ppos, conv, data); } -int do_proc_douintvec(struct ctl_table *table, int write, +int do_proc_douintvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, unsigned int *valp, @@ -1023,8 +1023,9 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write, } #endif -static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, - int write, void *buffer, size_t *lenp, loff_t *ppos, +static int __do_proc_doulongvec_minmax(void *data, + const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul, unsigned long convdiv) { unsigned long *i, *min, *max; @@ -1096,7 +1097,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, return err; } -static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, +static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul, unsigned long convdiv) { From patchwork Tue Apr 23 07:54:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13639470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19B27C4345F for ; Tue, 23 Apr 2024 07:56:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 057826B00D6; Tue, 23 Apr 2024 03:56:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFA3C6B00D9; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C10476B00DA; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 776366B00D6 for ; Tue, 23 Apr 2024 03:56:11 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2C94440E6C for ; Tue, 23 Apr 2024 07:56:11 +0000 (UTC) X-FDA: 82040038542.20.9BD23D1 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf11.hostedemail.com (Postfix) with ESMTP id E6B474000F for ; Tue, 23 Apr 2024 07:56:08 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=uagAM0++; spf=pass (imf11.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713858969; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3rC5D1UCvfcypHWGvfU/yXDL4XhyuKoJQZjhqf9+UdM=; b=D2yK7bcE7VZv+34rSmkp3ZJXpaHninE0BgcyxfuUfRfiO8uRNBI0i0f2Vtx/UQoYqcaFB2 gf3imh88XSzdxAHGm25PItv06IAen+uU2q14BibMXmXxWoWCBhK5w48/SRth/J9bhb/ava l1BKJEJQljDPK3SB59ySbL+BYe2Tck4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713858969; a=rsa-sha256; cv=none; b=5KCKFc0b10Yzb71EmUoiO+W5sdcz4u5YHnUNgmns/tHBalYkDYACQnukBzXJOeICpbglsm DuYY9rx3uiprevwM5BQBv1VDeWIDmheuA9YlBH5ICtisDIL8fj4oUVchl7Aqv6B2RDeLi+ i1Pq5AuwEW/BYJRjjRcARBPMpXT4NRI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=uagAM0++; spf=pass (imf11.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713858962; bh=FVysOkPE/qiRLZCuxnkxsMnTX0foyNtgrbyactsZP2Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uagAM0++rugBquWWZc12oBXw1p0sZNjLZ2P0BRn3a7mK4KfkLqVjep/MFqJY/7LAF 9caAdhgcu3xO8svnWs6UiBpEw54gG1sTupswjoZ3XrmizzbipFrDAq+6AqF37skYwx BR63gR5QqQWcerDyrgrTLAOjD+xHRp30erwz41hs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 09:54:46 +0200 Subject: [PATCH v3 11/11] sysctl: treewide: constify the ctl_table argument of handlers MIME-Version: 1.0 Message-Id: <20240423-sysctl-const-handler-v3-11-e0beccb836e2@weissschuh.net> References: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> In-Reply-To: <20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net> 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?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713858961; l=108174; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=FVysOkPE/qiRLZCuxnkxsMnTX0foyNtgrbyactsZP2Y=; b=5wEbCfrcoLTsgxV7Uxepjuju0i3n3dX4eEy0jjS4qXCKmY0HYJZJRKgtvn3SvZv68yUf+15PI DCOFgsjg7ChC0MoGza+B8re+o9KUvCk6GNeS16w70HPuLDKhvC0QRKO X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E6B474000F X-Rspam-User: X-Stat-Signature: qn176s8fqra8sn6xqkgsuscqozsznkan X-HE-Tag: 1713858968-53359 X-HE-Meta: U2FsdGVkX1/1eqd2RFtfKXaUo8bN9poo+eJYKjYn+41BvsnO3PiJ074JVNY4RnrTajDc+Jhdz5PwP0l6x/+JZIDhcIzH9Bgr9DYg8GHBb7v0gYH+nyvqTu9CKfBAHtNUTaxj6g6/VR/xk37d1i1rK0EGoq24eTdx2nUr+VUhCLSR0AFedNrkUfAvrkLu/GtPlF5JP4julS8vhQEqhV4vTBswUoal0t2yLz5QzcJmYN9vPgjjYBgMPSldnE3TgkjsQR8dQ1XiMmFqtMtiq9UFiM7rbXcJfziAhwlGX3TYkFH8bl7TQUhNs2aFIlasQpDmHtBGD2d77HvXVe3SVYCC261H1bJE1yvH4FJR52ix4QH4SAuVQiT0wjHjTXhjXllWwq+1kvsKURKThIZSH1RC4C2wU1OaWl7lElcNlTRnnNv2RBKWjzcFQ6Tl8uR6bNA1+RDACBxicggvehlsoI8GBzt2hWN0RM2gzZtsu01ZEnLR/hH7hjY5ZG3CZft6diMkFaJ+YIeFMJ4RwfR8tQPehot0xN3e47hpr6y1Xpo7GdUbAIPFFmJMA/yUEjgxng4P19pVWdS4CmiV9iqI8Pdbijlfnyd1/gDBvV4F0YeDWJl93nCet88EM96yufLtxgy49t/jvj2Zk1hI4dRj+W+CJB6Fk0eUqKQQspUB2xCCf9HLjnLujnrCJ+HO/bADgj3zkinSZ9orThZLLAL9US+/MZYxSGDhGqAlusagGg1ZxkSKUUugIJUb8UiNp3Y1ivaLKFRtaceZjxPwBmv8l2qir0+A2lLazXgNaahtw9PFiklkMawq0SrguOwM2DQibUCp7OY6ZEjD3Bb3IENxcmmNsun4jQ5XQLqoR0A9u7lCSomE/Ye/HSc7ieqR/QZjG1aTg7DGUVrw5Yk1fg/5DR2Fr2FlbmUulPMFB/IWGcZzH3dh/L/l1XdRWOCv5WVu1D++FwwpH9Qn0K95bDHnd9Q 0cwiCV8Y wKEU2AAj4UEjtCbP6GMj/LoXA5AAdoJZsGFlI+bFwLovmH8jG8NZsjyB4BLMerP31OLt2xUQ03VCtftFAV+vJIW1nYlbJEttlXcs3ruLykAKzmR+I67XYEkGPBdjymw0nCJLy4sLG0rhmfRVyhHallKtRWzIZUdogHo/nFsnQlWVDF/q1HexiQRh+cvJKNML25PB18LTtlx8mNmDkF6AaT09HmA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Adapt the proc_hander function signature to make it clear that handlers are not supposed to modify their ctl_table argument. This is a prerequisite to moving the static ctl_table structs into .rodata. By migrating all handlers at once a lengthy transition can be avoided. 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 scripted changes some other changes are done: * the typedef proc_handler is adapted * the prototypes of non-static handler are adapted * kernel/seccomp.c:{read,write}_actions_logged() and kernel/watchdog.c:proc_watchdog_common() are adapted as they need to adapted together with the handlers for type-consistency reasons Signed-off-by: Thomas Weißschuh --- 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/ftrace.h | 4 +- include/linux/mm.h | 8 ++-- include/linux/perf_event.h | 6 +-- include/linux/security.h | 2 +- include/linux/sysctl.h | 34 ++++++++-------- 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 | 2 +- kernel/sysctl.c | 68 +++++++++++++++---------------- 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 | 2 +- kernel/watchdog.c | 12 +++--- mm/compaction.c | 6 +-- mm/hugetlb.c | 8 ++-- 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 | 18 ++++---- net/core/sysctl_net_core.c | 20 ++++----- net/ipv4/devinet.c | 6 +-- net/ipv4/route.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 32 +++++++-------- net/ipv6/addrconf.c | 19 +++++---- net/ipv6/ndisc.c | 2 +- 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 | 12 +++--- 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 +- 92 files changed, 295 insertions(+), 293 deletions(-) diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index dd6ce86d4332..a3085cb68852 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -504,7 +504,7 @@ static int update_insn_emulation_mode(struct insn_emulation *insn, return ret; } -static int emulation_proc_handler(struct ctl_table *table, int write, +static int emulation_proc_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index ebb0158997ca..98efb587ef36 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -535,7 +535,7 @@ static unsigned int find_supported_vector_length(enum vec_type type, #if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL) -static int vec_proc_do_default_vl(struct ctl_table *table, int write, +static int vec_proc_do_default_vl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct vl_info *info = table->extra1; diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index c2978cb03b36..91a30e017d65 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -46,9 +46,9 @@ * /proc entries (sysctl) */ static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata"; -static int appldata_timer_handler(struct ctl_table *ctl, int write, +static int appldata_timer_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -static int appldata_interval_handler(struct ctl_table *ctl, int write, +static int appldata_interval_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); static struct ctl_table_header *appldata_sysctl_header; @@ -199,7 +199,7 @@ static void __appldata_vtimer_setup(int cmd) * Start/Stop timer, show status of timer (0 = not active, 1 = active) */ static int -appldata_timer_handler(struct ctl_table *ctl, int write, +appldata_timer_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int timer_active = appldata_timer_active; @@ -232,7 +232,7 @@ appldata_timer_handler(struct ctl_table *ctl, int write, * current timer interval. */ static int -appldata_interval_handler(struct ctl_table *ctl, int write, +appldata_interval_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int interval = appldata_interval; @@ -262,7 +262,7 @@ appldata_interval_handler(struct ctl_table *ctl, int write, * monitoring (0 = not in process, 1 = in process) */ static int -appldata_generic_handler(struct ctl_table *ctl, int write, +appldata_generic_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct appldata_ops *ops = NULL, *tmp_ops; diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 85328a0ef3b6..bce50ca75ea7 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -954,7 +954,7 @@ static int debug_active = 1; * always allow read, allow write only if debug_stoppable is set or * if debug_active is already off */ -static int s390dbf_procactive(struct ctl_table *table, int write, +static int s390dbf_procactive(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!write || debug_stoppable || !debug_active) diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 89e91b8ce842..1df3dc118696 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -600,7 +600,7 @@ static int __init topology_setup(char *str) } early_param("topology", topology_setup); -static int topology_ctl_handler(struct ctl_table *ctl, int write, +static int topology_ctl_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int enabled = topology_is_enabled(); diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index f8b13f247646..1d6749e095f7 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -243,7 +243,7 @@ static int cmm_skip_blanks(char *cp, char **endp) return str != cp; } -static int cmm_pages_handler(struct ctl_table *ctl, int write, +static int cmm_pages_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { long nr = cmm_get_pages(); @@ -262,7 +262,7 @@ static int cmm_pages_handler(struct ctl_table *ctl, int write, return 0; } -static int cmm_timed_pages_handler(struct ctl_table *ctl, int write, +static int cmm_timed_pages_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -282,7 +282,7 @@ static int cmm_timed_pages_handler(struct ctl_table *ctl, int write, return 0; } -static int cmm_timeout_handler(struct ctl_table *ctl, int write, +static int cmm_timeout_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { char buf[64], *p; diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c index 9a7c03d47861..51b805c727fc 100644 --- a/arch/x86/kernel/itmt.c +++ b/arch/x86/kernel/itmt.c @@ -38,7 +38,7 @@ static bool __read_mostly sched_itmt_capable; */ unsigned int __read_mostly sysctl_sched_itmt_enabled; -static int sched_itmt_update_handler(struct ctl_table *table, int write, +static int sched_itmt_update_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { unsigned int old_sysctl; diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index a5e07270e0d4..d0bd64129d43 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -3473,7 +3473,7 @@ static int cdrom_print_info(const char *header, int val, char *info, return 0; } -static int cdrom_sysctl_info(struct ctl_table *ctl, int write, +static int cdrom_sysctl_info(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int pos; @@ -3586,7 +3586,7 @@ static void cdrom_update_settings(void) mutex_unlock(&cdrom_mutex); } -static int cdrom_sysctl_handler(struct ctl_table *ctl, int write, +static int cdrom_sysctl_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/drivers/char/random.c b/drivers/char/random.c index 2597cb43f438..ca414208f899 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1604,7 +1604,7 @@ static u8 sysctl_bootid[UUID_SIZE]; * UUID. The difference is in whether table->data is NULL; if it is, * then a new UUID is generated and returned to the user. */ -static int proc_do_uuid(struct ctl_table *table, int write, void *buf, +static int proc_do_uuid(const struct ctl_table *table, int write, void *buf, size_t *lenp, loff_t *ppos) { u8 tmp_uuid[UUID_SIZE], *uuid; @@ -1635,8 +1635,8 @@ static int proc_do_uuid(struct ctl_table *table, int write, void *buf, } /* The same as proc_dointvec, but writes don't change anything. */ -static int proc_do_rointvec(struct ctl_table *table, int write, void *buf, - size_t *lenp, loff_t *ppos) +static int proc_do_rointvec(const struct ctl_table *table, int write, + void *buf, size_t *lenp, loff_t *ppos) { return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos); } diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 1ae3539beff5..891047c8a110 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -182,7 +182,7 @@ static void mac_hid_stop_emulation(void) mac_hid_destroy_emumouse(); } -static int mac_hid_toggle_emumouse(struct ctl_table *table, int write, +static int mac_hid_toggle_emumouse(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = table->data; diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 66f8542f3b18..14c5efd234ad 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -1908,7 +1908,7 @@ static int vrf_strict_mode_change(struct vrf_map *vmap, bool new_mode) return res; } -static int vrf_shared_table_handler(struct ctl_table *table, int write, +static int vrf_shared_table_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = (struct net *)table->extra1; diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index bd388560ed59..efa7c90e4234 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -33,7 +33,7 @@ #define PARPORT_MIN_SPINTIME_VALUE 1 #define PARPORT_MAX_SPINTIME_VALUE 1000 -static int do_active_device(struct ctl_table *table, int write, +static int do_active_device(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; @@ -70,7 +70,7 @@ static int do_active_device(struct ctl_table *table, int write, } #ifdef CONFIG_PARPORT_1284 -static int do_autoprobe(struct ctl_table *table, int write, +static int do_autoprobe(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport_device_info *info = table->extra2; @@ -113,7 +113,7 @@ static int do_autoprobe(struct ctl_table *table, int write, } #endif /* IEEE1284.3 support. */ -static int do_hardware_base_addr(struct ctl_table *table, int write, +static int do_hardware_base_addr(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; @@ -140,7 +140,7 @@ static int do_hardware_base_addr(struct ctl_table *table, int write, return 0; } -static int do_hardware_irq(struct ctl_table *table, int write, +static int do_hardware_irq(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; @@ -167,7 +167,7 @@ static int do_hardware_irq(struct ctl_table *table, int write, return 0; } -static int do_hardware_dma(struct ctl_table *table, int write, +static int do_hardware_dma(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; @@ -194,7 +194,7 @@ static int do_hardware_dma(struct ctl_table *table, int write, return 0; } -static int do_hardware_modes(struct ctl_table *table, int write, +static int do_hardware_modes(const struct ctl_table *table, int write, void *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c index 23fa6c5da82c..accdf3ac4c1d 100644 --- a/drivers/perf/arm_pmuv3.c +++ b/drivers/perf/arm_pmuv3.c @@ -1253,8 +1253,8 @@ static void armv8pmu_disable_user_access_ipi(void *unused) armv8pmu_disable_user_access(); } -static int armv8pmu_proc_user_access_handler(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int armv8pmu_proc_user_access_handler(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); if (ret || !write || sysctl_perf_user_access) diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 82636273d726..9c9ceec3a206 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -1013,7 +1013,7 @@ static void riscv_pmu_update_counter_access(void *info) csr_write(CSR_SCOUNTEREN, 0x2); } -static int riscv_pmu_proc_user_access_handler(struct ctl_table *table, +static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { diff --git a/fs/coredump.c b/fs/coredump.c index 8eae24afb3cb..b4f68117d203 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -986,7 +986,7 @@ void validate_coredump_safety(void) } } -static int proc_dostring_coredump(struct ctl_table *table, int write, +static int proc_dostring_coredump(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int error = proc_dostring(table, write, buffer, lenp, ppos); diff --git a/fs/dcache.c b/fs/dcache.c index 407095188f83..5c6ae57d0321 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -174,8 +174,8 @@ static long get_nr_dentry_negative(void) return sum < 0 ? 0 : sum; } -static int proc_nr_dentry(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int proc_nr_dentry(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { dentry_stat.nr_dentry = get_nr_dentry(); dentry_stat.nr_unused = get_nr_dentry_unused(); diff --git a/fs/drop_caches.c b/fs/drop_caches.c index b9575957a7c2..d45ef541d848 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -48,7 +48,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) iput(toput_inode); } -int drop_caches_sysctl_handler(struct ctl_table *table, int write, +int drop_caches_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int ret; diff --git a/fs/exec.c b/fs/exec.c index 40073142288f..ba59402194c7 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -2181,8 +2181,8 @@ COMPAT_SYSCALL_DEFINE5(execveat, int, fd, #ifdef CONFIG_SYSCTL -static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_dointvec_minmax_coredump(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos); diff --git a/fs/file_table.c b/fs/file_table.c index 4f03beed4737..f5480473727e 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -96,8 +96,8 @@ EXPORT_SYMBOL_GPL(get_max_files); /* * Handle nr_files sysctl */ -static int proc_nr_files(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int proc_nr_files(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { files_stat.nr_files = get_nr_files(); return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 92a5b8283528..b865a3fa52f3 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2413,7 +2413,7 @@ static int __init start_dirtytime_writeback(void) } __initcall(start_dirtytime_writeback); -int dirtytime_interval_handler(struct ctl_table *table, int write, +int dirtytime_interval_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/fs/inode.c b/fs/inode.c index 3a41f83a4ba5..a622503a992c 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -107,8 +107,8 @@ long get_nr_dirty_inodes(void) */ static struct inodes_stat_t inodes_stat; -static int proc_nr_inodes(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int proc_nr_inodes(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { inodes_stat.nr_inodes = get_nr_inodes(); inodes_stat.nr_unused = get_nr_inodes_unused(); diff --git a/fs/pipe.c b/fs/pipe.c index 50c8a8596b52..7dff2aa50a6d 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -1469,7 +1469,7 @@ static int do_proc_dopipe_max_size_conv(unsigned long *lvalp, return 0; } -static int proc_dopipe_max_size(struct ctl_table *table, int write, +static int proc_dopipe_max_size(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_douintvec(table, write, buffer, lenp, ppos, diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 627eb2f72ef3..4c3936b8f7b6 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2917,7 +2917,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = { }; EXPORT_SYMBOL(dquot_quotactl_sysfile_ops); -static int do_proc_dqstats(struct ctl_table *table, int write, +static int do_proc_dqstats(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { unsigned int type = (unsigned long *)table->data - dqstats.stat; diff --git a/fs/xfs/xfs_sysctl.c b/fs/xfs/xfs_sysctl.c index a191f6560f98..c84df23b494d 100644 --- a/fs/xfs/xfs_sysctl.c +++ b/fs/xfs/xfs_sysctl.c @@ -11,7 +11,7 @@ static struct ctl_table_header *xfs_table_header; #ifdef CONFIG_PROC_FS STATIC int xfs_stats_clear_proc_handler( - struct ctl_table *ctl, + const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, @@ -31,7 +31,7 @@ xfs_stats_clear_proc_handler( STATIC int xfs_panic_mask_proc_handler( - struct ctl_table *ctl, + const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, @@ -52,7 +52,7 @@ xfs_panic_mask_proc_handler( STATIC int xfs_deprecated_dointvec_minmax( - struct ctl_table *ctl, + const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 54d53f345d14..c3af2e5947aa 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -470,7 +470,7 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, extern int stack_tracer_enabled; -int stack_trace_sysctl(struct ctl_table *table, int write, void *buffer, +int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); /* DO NOT MODIFY THIS VARIABLE DIRECTLY! */ @@ -1159,7 +1159,7 @@ extern int tracepoint_printk; extern void disable_trace_on_warning(void); extern int __disable_trace_on_warning; -int tracepoint_printk_sysctl(struct ctl_table *table, int write, +int tracepoint_printk_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); #else /* CONFIG_TRACING */ diff --git a/include/linux/mm.h b/include/linux/mm.h index dc33f8269fb5..828d97c23834 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -204,11 +204,11 @@ extern int sysctl_overcommit_memory; extern int sysctl_overcommit_ratio; extern unsigned long sysctl_overcommit_kbytes; -int overcommit_ratio_handler(struct ctl_table *, int, void *, size_t *, +int overcommit_ratio_handler(const struct ctl_table *, int, void *, size_t *, loff_t *); -int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *, +int overcommit_kbytes_handler(const struct ctl_table *, int, void *, size_t *, loff_t *); -int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *, +int overcommit_policy_handler(const struct ctl_table *, int, void *, size_t *, loff_t *); #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) @@ -3897,7 +3897,7 @@ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm); #ifdef CONFIG_SYSCTL extern int sysctl_drop_caches; -int drop_caches_sysctl_handler(struct ctl_table *, int, void *, size_t *, +int drop_caches_sysctl_handler(const struct ctl_table *, int, void *, size_t *, loff_t *); #endif diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index a5304ae8c654..ce102aac11c0 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1587,11 +1587,11 @@ extern int sysctl_perf_cpu_time_max_percent; extern void perf_sample_event_took(u64 sample_len_ns); -int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, +int perf_event_max_sample_rate_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, +int perf_cpu_time_max_percent_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int perf_event_max_stack_handler(struct ctl_table *table, int write, +int perf_event_max_stack_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); /* Access to perf_event_open(2) syscall. */ diff --git a/include/linux/security.h b/include/linux/security.h index 21cf70346b33..96799ff57230 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -228,7 +228,7 @@ struct request_sock; #define LSM_UNSAFE_NO_NEW_PRIVS 4 #ifdef CONFIG_MMU -extern int mmap_min_addr_handler(struct ctl_table *table, int write, +extern int mmap_min_addr_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); #endif diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 54fbec062772..aa4c6d44aaa0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -61,31 +61,31 @@ extern const int sysctl_vals[]; extern const unsigned long sysctl_long_vals[]; -typedef int proc_handler(struct ctl_table *ctl, int write, void *buffer, +typedef int proc_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -int proc_dostring(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_dobool(struct ctl_table *table, int write, void *buffer, +int proc_dostring(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_dobool(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int proc_dointvec(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer, +int proc_dointvec(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_douintvec(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_dointvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int proc_dou8vec_minmax(struct ctl_table *table, int write, void *buffer, +int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write, +int proc_dointvec_jiffies(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); -int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *, +int proc_dointvec_userhz_jiffies(const struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_dointvec_ms_jiffies(struct ctl_table *, int, void *, size_t *, +int proc_dointvec_ms_jiffies(const struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_doulongvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void *, +int proc_doulongvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int, void *, size_t *, loff_t *); -int proc_do_large_bitmap(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_do_static_key(struct ctl_table *table, int write, void *buffer, +int proc_do_large_bitmap(const struct ctl_table *, int, void *, size_t *, loff_t *); +int proc_do_static_key(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); /* @@ -287,7 +287,7 @@ static inline bool sysctl_is_alias(char *param) } #endif /* CONFIG_SYSCTL */ -int sysctl_max_threads(struct ctl_table *table, int write, void *buffer, +int sysctl_max_threads(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); #endif /* _LINUX_SYSCTL_H */ diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 735eae6e272c..7da26d1aea12 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -17,7 +17,7 @@ extern int sysctl_stat_interval; #define DISABLE_NUMA_STAT 0 extern int sysctl_vm_numa_stat; DECLARE_STATIC_KEY_TRUE(vm_numa_stat_key); -int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write, +int sysctl_vm_numa_stat_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos); #endif @@ -301,8 +301,8 @@ void cpu_vm_stats_fold(int cpu); void refresh_zone_stat_thresholds(void); struct ctl_table; -int vmstat_refresh(struct ctl_table *, int write, void *buffer, size_t *lenp, - loff_t *ppos); +int vmstat_refresh(const struct ctl_table *, int write, void *buffer, + size_t *lenp, loff_t *ppos); void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *); diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 112d806ddbe4..1a54676d843a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -350,7 +350,7 @@ extern unsigned int dirty_expire_interval; extern unsigned int dirtytime_expire_interval; extern int laptop_mode; -int dirtytime_interval_handler(struct ctl_table *table, int write, +int dirtytime_interval_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty); diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 9bbdf6eaa942..7a533d5b1d59 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -486,7 +486,7 @@ void igmp6_event_report(struct sk_buff *skb); #ifdef CONFIG_SYSCTL -int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, +int ndisc_ifinfo_sysctl_change(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); #endif diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 0d28172193fa..a44f262a7384 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -412,12 +412,12 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, void *neigh_seq_next(struct seq_file *, void *, loff_t *); void neigh_seq_stop(struct seq_file *, void *); -int neigh_proc_dointvec(struct ctl_table *ctl, int write, +int neigh_proc_dointvec(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, +int neigh_proc_dointvec_jiffies(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write, +int neigh_proc_dointvec_ms_jiffies(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, diff --git a/include/net/netfilter/nf_hooks_lwtunnel.h b/include/net/netfilter/nf_hooks_lwtunnel.h index 52e27920f829..cef7a4eb8f97 100644 --- a/include/net/netfilter/nf_hooks_lwtunnel.h +++ b/include/net/netfilter/nf_hooks_lwtunnel.h @@ -2,6 +2,6 @@ #include #ifdef CONFIG_SYSCTL -int nf_hooks_lwtunnel_sysctl_handler(struct ctl_table *table, int write, +int nf_hooks_lwtunnel_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); #endif diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 9465b0ae470b..5d383a9a520e 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -17,8 +17,8 @@ #include #include "util.h" -static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_ipc_dointvec_minmax_orphans(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ipc_namespace *ns = container_of(table->data, struct ipc_namespace, shm_rmid_forced); @@ -33,7 +33,7 @@ static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int write, return err; } -static int proc_ipc_auto_msgmni(struct ctl_table *table, int write, +static int proc_ipc_auto_msgmni(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; @@ -48,7 +48,7 @@ static int proc_ipc_auto_msgmni(struct ctl_table *table, int write, return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos); } -static int proc_ipc_sem_dointvec(struct ctl_table *table, int write, +static int proc_ipc_sem_dointvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ipc_namespace *ns = diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 7dcd7f174bb1..93d1f856f3d4 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -5937,7 +5937,7 @@ const struct bpf_prog_ops bpf_syscall_prog_ops = { }; #ifdef CONFIG_SYSCTL -static int bpf_stats_handler(struct ctl_table *table, int write, +static int bpf_stats_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct static_key *key = (struct static_key *)table->data; @@ -5972,7 +5972,7 @@ void __weak unpriv_ebpf_notify(int new_state) { } -static int bpf_unpriv_handler(struct ctl_table *table, int write, +static int bpf_unpriv_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret, unpriv_enable = *(int *)table->data; diff --git a/kernel/delayacct.c b/kernel/delayacct.c index e039b0f99a0b..5cc4e0ef4128 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c @@ -44,8 +44,8 @@ void delayacct_init(void) } #ifdef CONFIG_PROC_SYSCTL -static int sysctl_delayacct(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int sysctl_delayacct(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int state = delayacct_on; struct ctl_table t; diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c index 1273be84392c..bd5699f869c3 100644 --- a/kernel/events/callchain.c +++ b/kernel/events/callchain.c @@ -229,7 +229,7 @@ get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user, * Used for sysctl_perf_event_max_stack and * sysctl_perf_event_max_contexts_per_stack. */ -int perf_event_max_stack_handler(struct ctl_table *table, int write, +int perf_event_max_stack_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *value = table->data; diff --git a/kernel/events/core.c b/kernel/events/core.c index f0128c5ff278..01cc910d31f3 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -450,7 +450,7 @@ static void update_perf_cpu_limits(void) static bool perf_rotate_context(struct perf_cpu_pmu_context *cpc); -int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, +int perf_event_max_sample_rate_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -474,7 +474,7 @@ int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, int sysctl_perf_cpu_time_max_percent __read_mostly = DEFAULT_CPU_TIME_MAX_PERCENT; -int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, +int perf_cpu_time_max_percent_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); diff --git a/kernel/fork.c b/kernel/fork.c index 99076dbe27d8..985bd0a5834c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -3418,7 +3418,7 @@ int unshare_files(void) return 0; } -int sysctl_max_threads(struct ctl_table *table, int write, +int sysctl_max_threads(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 1d92016b0b3c..688ab3443156 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -239,9 +239,9 @@ static long hung_timeout_jiffies(unsigned long last_checked, /* * Process updating of timeout sysctl */ -static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, - void *buffer, - size_t *lenp, loff_t *ppos) +static int proc_dohung_task_timeout_secs(const struct ctl_table *table, + int write, void *buffer, + size_t *lenp, loff_t *ppos) { int ret; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 9112d69d68b0..c0caa14880c3 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -888,7 +888,7 @@ struct kimage *kexec_crash_image; static int kexec_load_disabled; #ifdef CONFIG_SYSCTL -static int kexec_limit_handler(struct ctl_table *table, int write, +static int kexec_limit_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct kexec_load_limit *limit = table->data; diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 668ea401744b..fec9f6c4b0f1 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -939,7 +939,7 @@ static void unoptimize_all_kprobes(void) static DEFINE_MUTEX(kprobe_sysctl_mutex); static int sysctl_kprobes_optimization; -static int proc_kprobes_optimization_handler(struct ctl_table *table, +static int proc_kprobes_optimization_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { diff --git a/kernel/latencytop.c b/kernel/latencytop.c index 84c53285f499..b03af86018f4 100644 --- a/kernel/latencytop.c +++ b/kernel/latencytop.c @@ -65,8 +65,8 @@ static struct latency_record latency_record[MAXLR]; int latencytop_enabled; #ifdef CONFIG_SYSCTL -static int sysctl_latencytop(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int sysctl_latencytop(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int err; diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index dc48fecfa1dc..afd7d54acb56 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -277,7 +277,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) } #ifdef CONFIG_CHECKPOINT_RESTORE -static int pid_ns_ctl_handler(struct ctl_table *table, int write, +static int pid_ns_ctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct pid_namespace *pid_ns = task_active_pid_ns(current); diff --git a/kernel/pid_sysctl.h b/kernel/pid_sysctl.h index fe9fb991dc42..18ecaef6be41 100644 --- a/kernel/pid_sysctl.h +++ b/kernel/pid_sysctl.h @@ -5,7 +5,7 @@ #include #if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE) -static int pid_mfd_noexec_dointvec_minmax(struct ctl_table *table, +static int pid_mfd_noexec_dointvec_minmax(const struct ctl_table *table, int write, void *buf, size_t *lenp, loff_t *ppos) { struct pid_namespace *ns = task_active_pid_ns(current); diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h index 6c2afee5ef62..19dcc5832651 100644 --- a/kernel/printk/internal.h +++ b/kernel/printk/internal.h @@ -8,7 +8,7 @@ #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) void __init printk_sysctl_init(void); -int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, +int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); #else #define printk_sysctl_init() do { } while (0) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 6206804d275b..6d00e89744e9 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -197,7 +197,7 @@ __setup("printk.devkmsg=", control_devkmsg); char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit"; #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) -int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, +int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { char old_str[DEVKMSG_STR_MAX_SIZE]; diff --git a/kernel/printk/sysctl.c b/kernel/printk/sysctl.c index 3e47dedce9e5..6aaddb90149f 100644 --- a/kernel/printk/sysctl.c +++ b/kernel/printk/sysctl.c @@ -11,8 +11,9 @@ static const int ten_thousand = 10000; -static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_dointvec_minmax_sysadmin(const struct ctl_table *table, + int write, void *buffer, + size_t *lenp, loff_t *ppos) { if (write && !capable(CAP_SYS_ADMIN)) return -EPERM; diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5f9d32a110f9..d65f21c27304 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1835,7 +1835,7 @@ static void uclamp_sync_util_min_rt_default(void) uclamp_update_util_min_rt_default(p); } -static int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, +static int sysctl_sched_uclamp_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { bool update_root_tg = false; @@ -4603,7 +4603,7 @@ static void reset_memory_tiering(void) } } -static int sysctl_numa_balancing(struct ctl_table *table, int write, +static int sysctl_numa_balancing(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; @@ -4672,8 +4672,8 @@ static int __init setup_schedstats(char *str) __setup("schedstats=", setup_schedstats); #ifdef CONFIG_PROC_SYSCTL -static int sysctl_schedstats(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int sysctl_schedstats(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; int err; diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index aa4c1c874fa4..3f8c046755fd 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -26,10 +26,10 @@ int sysctl_sched_rt_runtime = 950000; #ifdef CONFIG_SYSCTL static int sysctl_sched_rr_timeslice = (MSEC_PER_SEC * RR_TIMESLICE) / HZ; -static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos); -static int sched_rr_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos); +static int sched_rt_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos); +static int sched_rr_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos); static struct ctl_table sched_rt_sysctls[] = { { .procname = "sched_rt_period_us", @@ -2952,8 +2952,8 @@ static void sched_rt_do_global(void) raw_spin_unlock_irqrestore(&def_rt_bandwidth.rt_runtime_lock, flags); } -static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int sched_rt_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int old_period, old_runtime; static DEFINE_MUTEX(mutex); @@ -2991,8 +2991,8 @@ static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, return ret; } -static int sched_rr_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int sched_rr_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int ret; static DEFINE_MUTEX(mutex); diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 1d6eefa4032e..2b52f34dc35c 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -285,7 +285,7 @@ void rebuild_sched_domains_energy(void) } #ifdef CONFIG_PROC_SYSCTL -static int sched_energy_aware_handler(struct ctl_table *table, int write, +static int sched_energy_aware_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret, state; diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 7ed72723fb8a..97a3d0e81ac1 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -2334,7 +2334,7 @@ static bool seccomp_actions_logged_from_names(u32 *actions_logged, char *names) return true; } -static int read_actions_logged(struct ctl_table *ro_table, void *buffer, +static int read_actions_logged(const struct ctl_table *ro_table, void *buffer, size_t *lenp, loff_t *ppos) { char names[sizeof(seccomp_actions_avail)]; @@ -2352,7 +2352,7 @@ static int read_actions_logged(struct ctl_table *ro_table, void *buffer, return proc_dostring(&table, 0, buffer, lenp, ppos); } -static int write_actions_logged(struct ctl_table *ro_table, void *buffer, +static int write_actions_logged(const struct ctl_table *ro_table, void *buffer, size_t *lenp, loff_t *ppos, u32 *actions_logged) { char names[sizeof(seccomp_actions_avail)]; @@ -2413,9 +2413,9 @@ static void audit_actions_logged(u32 actions_logged, u32 old_actions_logged, return audit_seccomp_actions_logged(new, old, !ret); } -static int seccomp_actions_logged_handler(struct ctl_table *ro_table, int write, - void *buffer, size_t *lenp, - loff_t *ppos) +static int seccomp_actions_logged_handler(const struct ctl_table *ro_table, + int write, void *buffer, + size_t *lenp, loff_t *ppos) { int ret; diff --git a/kernel/stackleak.c b/kernel/stackleak.c index 558b9d6d28d3..f64b2b3d0244 100644 --- a/kernel/stackleak.c +++ b/kernel/stackleak.c @@ -21,7 +21,7 @@ static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass); #ifdef CONFIG_SYSCTL -static int stack_erasing_sysctl(struct ctl_table *table, int write, +static int stack_erasing_sysctl(const struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret = 0; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 62dd27752960..4d3e5cecbc88 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -256,7 +256,7 @@ static bool proc_first_pos_non_zero_ignore(loff_t *ppos, * * Returns 0 on success. */ -int proc_dostring(struct ctl_table *table, int write, +int proc_dostring(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (write) @@ -702,7 +702,7 @@ int do_proc_douintvec(const struct ctl_table *table, int write, * * Returns 0 on success. */ -int proc_dobool(struct ctl_table *table, int write, void *buffer, +int proc_dobool(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table tmp; @@ -739,7 +739,7 @@ int proc_dobool(struct ctl_table *table, int write, void *buffer, * * Returns 0 on success. */ -int proc_dointvec(struct ctl_table *table, int write, void *buffer, +int proc_dointvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); @@ -758,7 +758,7 @@ int proc_dointvec(struct ctl_table *table, int write, void *buffer, * * Returns 0 on success. */ -int proc_douintvec(struct ctl_table *table, int write, void *buffer, +int proc_douintvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_douintvec(table, write, buffer, lenp, ppos, @@ -769,7 +769,7 @@ int proc_douintvec(struct ctl_table *table, int write, void *buffer, * Taint values can only be increased * This means we can safely use a temporary. */ -static int proc_taint(struct ctl_table *table, int write, +static int proc_taint(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; @@ -864,7 +864,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, * * Returns 0 on success or -EINVAL on write when the range check fails. */ -int proc_dointvec_minmax(struct ctl_table *table, int write, +int proc_dointvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct do_proc_dointvec_minmax_conv_param param = { @@ -933,7 +933,7 @@ static int do_proc_douintvec_minmax_conv(unsigned long *lvalp, * * Returns 0 on success or -ERANGE on write when the range check fails. */ -int proc_douintvec_minmax(struct ctl_table *table, int write, +int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct do_proc_douintvec_minmax_conv_param param = { @@ -961,7 +961,7 @@ int proc_douintvec_minmax(struct ctl_table *table, int write, * * Returns 0 on success or an error on write when the range check fails. */ -int proc_dou8vec_minmax(struct ctl_table *table, int write, +int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table tmp; @@ -1004,7 +1004,7 @@ int proc_dou8vec_minmax(struct ctl_table *table, int write, EXPORT_SYMBOL_GPL(proc_dou8vec_minmax); #ifdef CONFIG_MAGIC_SYSRQ -static int sysrq_sysctl_handler(struct ctl_table *table, int write, +static int sysrq_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int tmp, ret; @@ -1121,7 +1121,7 @@ static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, * * Returns 0 on success. */ -int proc_doulongvec_minmax(struct ctl_table *table, int write, +int proc_doulongvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); @@ -1144,7 +1144,7 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, * * Returns 0 on success. */ -int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, +int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_doulongvec_minmax(table, write, buffer, @@ -1265,14 +1265,14 @@ static int do_proc_dointvec_ms_jiffies_minmax_conv(bool *negp, unsigned long *lv * * Returns 0 on success. */ -int proc_dointvec_jiffies(struct ctl_table *table, int write, +int proc_dointvec_jiffies(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table,write,buffer,lenp,ppos, do_proc_dointvec_jiffies_conv,NULL); } -int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write, +int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct do_proc_dointvec_minmax_conv_param param = { @@ -1298,7 +1298,7 @@ int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write, * * Returns 0 on success. */ -int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, +int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table, write, buffer, lenp, ppos, @@ -1321,15 +1321,15 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, * * Returns 0 on success. */ -int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table, write, buffer, lenp, ppos, do_proc_dointvec_ms_jiffies_conv, NULL); } -static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int proc_do_cad_pid(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { struct pid *new_pid; pid_t tmp; @@ -1367,7 +1367,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer, * * Returns 0 on success. */ -int proc_do_large_bitmap(struct ctl_table *table, int write, +int proc_do_large_bitmap(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err = 0; @@ -1499,85 +1499,85 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, #else /* CONFIG_PROC_SYSCTL */ -int proc_dostring(struct ctl_table *table, int write, +int proc_dostring(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dobool(struct ctl_table *table, int write, +int proc_dobool(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec(struct ctl_table *table, int write, +int proc_dointvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_douintvec(struct ctl_table *table, int write, +int proc_douintvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec_minmax(struct ctl_table *table, int write, +int proc_dointvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_douintvec_minmax(struct ctl_table *table, int write, +int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dou8vec_minmax(struct ctl_table *table, int write, +int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec_jiffies(struct ctl_table *table, int write, +int proc_dointvec_jiffies(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write, +int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, +int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, +int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_doulongvec_minmax(struct ctl_table *table, int write, +int proc_doulongvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, +int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } -int proc_do_large_bitmap(struct ctl_table *table, int write, +int proc_do_large_bitmap(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; @@ -1586,7 +1586,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, #endif /* CONFIG_PROC_SYSCTL */ #if defined(CONFIG_SYSCTL) -int proc_do_static_key(struct ctl_table *table, int write, +int proc_do_static_key(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct static_key *key = (struct static_key *)table->data; diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 48288dd4a102..64b0d8a0aa0f 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -289,7 +289,7 @@ static void timers_update_migration(void) } #ifdef CONFIG_SYSCTL -static int timer_migration_handler(struct ctl_table *table, int write, +static int timer_migration_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index f783d7b279f6..db1ebe70866a 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -8223,7 +8223,7 @@ static bool is_permanent_ops_registered(void) } static int -ftrace_enable_sysctl(struct ctl_table *table, int write, +ftrace_enable_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = -ENODEV; diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 233d1af39fff..2e6a0b1142d3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2761,7 +2761,7 @@ static void output_printk(struct trace_event_buffer *fbuffer) raw_spin_unlock_irqrestore(&tracepoint_iter_lock, flags); } -int tracepoint_printk_sysctl(struct ctl_table *table, int write, +int tracepoint_printk_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index 304ceed9fd7d..a2f048c8382f 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2811,7 +2811,7 @@ static int create_user_tracefs(void) return -ENODEV; } -static int set_max_user_events_sysctl(struct ctl_table *table, int write, +static int set_max_user_events_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 5a48dba912ea..7f9572a37333 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -514,7 +514,7 @@ static const struct file_operations stack_trace_filter_fops = { #endif /* CONFIG_DYNAMIC_FTRACE */ int -stack_trace_sysctl(struct ctl_table *table, int write, void *buffer, +stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int was_enabled; diff --git a/kernel/umh.c b/kernel/umh.c index 598b3ffe1522..ff1f13a27d29 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -495,7 +495,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait) EXPORT_SYMBOL(call_usermodehelper); #if defined(CONFIG_SYSCTL) -static int proc_cap_handler(struct ctl_table *table, int write, +static int proc_cap_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 04e4513f2985..7282f61a8650 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -30,7 +30,7 @@ static void *get_uts(const struct ctl_table *table) * Special case of dostring for the UTS structure. This has locks * to observe. Should this be in kernel/sys.c ???? */ -static int proc_do_uts_string(struct ctl_table *table, int write, +static int proc_do_uts_string(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table uts_table; diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 941236828de8..6cbdd1143f06 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -974,7 +974,7 @@ static void proc_watchdog_update(void) * -------------------|----------------------------------|------------------------------- * proc_soft_watchdog | watchdog_softlockup_user_enabled | WATCHDOG_SOFTOCKUP_ENABLED */ -static int proc_watchdog_common(int which, struct ctl_table *table, int write, +static int proc_watchdog_common(int which, const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err, old, *param = table->data; @@ -1001,7 +1001,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, /* * /proc/sys/kernel/watchdog */ -static int proc_watchdog(struct ctl_table *table, int write, +static int proc_watchdog(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED | @@ -1012,7 +1012,7 @@ static int proc_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/nmi_watchdog */ -static int proc_nmi_watchdog(struct ctl_table *table, int write, +static int proc_nmi_watchdog(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!watchdog_hardlockup_available && write) @@ -1025,7 +1025,7 @@ static int proc_nmi_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/soft_watchdog */ -static int proc_soft_watchdog(struct ctl_table *table, int write, +static int proc_soft_watchdog(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED, @@ -1036,7 +1036,7 @@ static int proc_soft_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/watchdog_thresh */ -static int proc_watchdog_thresh(struct ctl_table *table, int write, +static int proc_watchdog_thresh(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err, old; @@ -1059,7 +1059,7 @@ static int proc_watchdog_thresh(struct ctl_table *table, int write, * user to specify a mask that will include cpus that have not yet * been brought online, if desired. */ -static int proc_watchdog_cpumask(struct ctl_table *table, int write, +static int proc_watchdog_cpumask(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err; diff --git a/mm/compaction.c b/mm/compaction.c index e731d45befc7..ea5957c2da39 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2955,7 +2955,7 @@ static int compact_nodes(void) return 0; } -static int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int write, +static int compaction_proactiveness_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int rc, nid; @@ -2985,7 +2985,7 @@ static int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int * This is the entry point for compacting all nodes via * /proc/sys/vm/compact_memory */ -static int sysctl_compaction_handler(struct ctl_table *table, int write, +static int sysctl_compaction_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int ret; @@ -3296,7 +3296,7 @@ static int kcompactd_cpu_online(unsigned int cpu) return 0; } -static int proc_dointvec_minmax_warn_RT_change(struct ctl_table *table, +static int proc_dointvec_minmax_warn_RT_change(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret, old; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8d12ce63a439..9b0834634e8b 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4950,7 +4950,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy, return ret; } -static int hugetlb_sysctl_handler(struct ctl_table *table, int write, +static int hugetlb_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { @@ -4959,15 +4959,15 @@ static int hugetlb_sysctl_handler(struct ctl_table *table, int write, } #ifdef CONFIG_NUMA -static int hugetlb_mempolicy_sysctl_handler(struct ctl_table *table, int write, - void *buffer, size_t *length, loff_t *ppos) +static int hugetlb_mempolicy_sysctl_handler(const struct ctl_table *table, + int write, void *buffer, size_t *length, loff_t *ppos) { return hugetlb_sysctl_handler_common(true, table, write, buffer, length, ppos); } #endif /* CONFIG_NUMA */ -static int hugetlb_overcommit_handler(struct ctl_table *table, int write, +static int hugetlb_overcommit_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { struct hstate *h = &default_hstate; diff --git a/mm/page-writeback.c b/mm/page-writeback.c index db5769cb12fd..b86aece672bf 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -493,8 +493,8 @@ bool node_dirty_ok(struct pglist_data *pgdat) } #ifdef CONFIG_SYSCTL -static int dirty_background_ratio_handler(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int dirty_background_ratio_handler(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -504,8 +504,8 @@ static int dirty_background_ratio_handler(struct ctl_table *table, int write, return ret; } -static int dirty_background_bytes_handler(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int dirty_background_bytes_handler(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -515,8 +515,8 @@ static int dirty_background_bytes_handler(struct ctl_table *table, int write, return ret; } -static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +static int dirty_ratio_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int old_ratio = vm_dirty_ratio; int ret; @@ -529,7 +529,7 @@ static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer, return ret; } -static int dirty_bytes_handler(struct ctl_table *table, int write, +static int dirty_bytes_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { unsigned long old_bytes = vm_dirty_bytes; @@ -2151,8 +2151,8 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) /* * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs */ -static int dirty_writeback_centisecs_handler(struct ctl_table *table, int write, - void *buffer, size_t *length, loff_t *ppos) +static int dirty_writeback_centisecs_handler(const struct ctl_table *table, + int write, void *buffer, size_t *length, loff_t *ppos) { unsigned int old_interval = dirty_writeback_interval; int ret; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 33d4a1be927b..9810ea000e71 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5135,7 +5135,7 @@ static char numa_zonelist_order[] = "Node"; /* * sysctl handler for numa_zonelist_order */ -static int numa_zonelist_order_handler(struct ctl_table *table, int write, +static int numa_zonelist_order_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { if (write) @@ -6102,7 +6102,7 @@ postcore_initcall(init_per_zone_wmark_min) * that we can call two helper functions whenever min_free_kbytes * changes. */ -static int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, +static int min_free_kbytes_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int rc; @@ -6118,7 +6118,7 @@ static int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, return 0; } -static int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write, +static int watermark_scale_factor_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int rc; @@ -6148,7 +6148,7 @@ static void setup_min_unmapped_ratio(void) } -static int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write, +static int sysctl_min_unmapped_ratio_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int rc; @@ -6175,7 +6175,7 @@ static void setup_min_slab_ratio(void) sysctl_min_slab_ratio) / 100; } -static int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int write, +static int sysctl_min_slab_ratio_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int rc; @@ -6199,7 +6199,7 @@ static int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int wri * minimum watermarks. The lowmem reserve ratio can only make sense * if in function of the boot time zone sizes. */ -static int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *table, +static int lowmem_reserve_ratio_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int i; @@ -6220,7 +6220,7 @@ static int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *table, * cpu. It is the fraction of total pages in each zone that a hot per cpu * pagelist can have before it gets flushed back to buddy allocator. */ -static int percpu_pagelist_high_fraction_sysctl_handler(struct ctl_table *table, +static int percpu_pagelist_high_fraction_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { struct zone *zone; diff --git a/mm/util.c b/mm/util.c index c9e519e6811f..958b9013d2f3 100644 --- a/mm/util.c +++ b/mm/util.c @@ -835,8 +835,8 @@ int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */ unsigned long sysctl_admin_reserve_kbytes __read_mostly = 1UL << 13; /* 8MB */ -int overcommit_ratio_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +int overcommit_ratio_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -851,8 +851,8 @@ static void sync_overcommit_as(struct work_struct *dummy) percpu_counter_sync(&vm_committed_as); } -int overcommit_policy_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +int overcommit_policy_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; int new_policy = -1; @@ -887,8 +887,8 @@ int overcommit_policy_handler(struct ctl_table *table, int write, void *buffer, return ret; } -int overcommit_kbytes_handler(struct ctl_table *table, int write, void *buffer, - size_t *lenp, loff_t *ppos) +int overcommit_kbytes_handler(const struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/mm/vmstat.c b/mm/vmstat.c index 8507c497218b..33a032d69554 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -74,7 +74,7 @@ static void invalid_numa_statistics(void) static DEFINE_MUTEX(vm_numa_stat_lock); -int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write, +int sysctl_vm_numa_stat_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { int ret, oldval; @@ -1887,7 +1887,7 @@ static void refresh_vm_stats(struct work_struct *work) refresh_cpu_vm_stats(true); } -int vmstat_refresh(struct ctl_table *table, int write, +int vmstat_refresh(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { long val; diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 7948a9e7542c..0c95eb0ae8f0 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -1177,7 +1177,7 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net, #ifdef CONFIG_SYSCTL static -int brnf_sysctl_call_tables(struct ctl_table *ctl, int write, +int brnf_sysctl_call_tables(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 92a01664a723..9a089e3bcd34 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -3543,7 +3543,7 @@ EXPORT_SYMBOL(neigh_app_ns); #ifdef CONFIG_SYSCTL static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN); -static int proc_unres_qlen(struct ctl_table *ctl, int write, +static int proc_unres_qlen(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int size, ret; @@ -3595,7 +3595,7 @@ static void neigh_proc_update(const struct ctl_table *ctl, int write) neigh_copy_dflt_parms(net, p, index); } -static int neigh_proc_dointvec_zero_intmax(struct ctl_table *ctl, int write, +static int neigh_proc_dointvec_zero_intmax(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -3610,7 +3610,7 @@ static int neigh_proc_dointvec_zero_intmax(struct ctl_table *ctl, int write, return ret; } -static int neigh_proc_dointvec_ms_jiffies_positive(struct ctl_table *ctl, int write, +static int neigh_proc_dointvec_ms_jiffies_positive(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table tmp = *ctl; @@ -3626,7 +3626,7 @@ static int neigh_proc_dointvec_ms_jiffies_positive(struct ctl_table *ctl, int wr return ret; } -int neigh_proc_dointvec(struct ctl_table *ctl, int write, void *buffer, +int neigh_proc_dointvec(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); @@ -3636,7 +3636,7 @@ int neigh_proc_dointvec(struct ctl_table *ctl, int write, void *buffer, } EXPORT_SYMBOL(neigh_proc_dointvec); -int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, void *buffer, +int neigh_proc_dointvec_jiffies(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos); @@ -3646,7 +3646,7 @@ int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, void *buffer, } EXPORT_SYMBOL(neigh_proc_dointvec_jiffies); -static int neigh_proc_dointvec_userhz_jiffies(struct ctl_table *ctl, int write, +static int neigh_proc_dointvec_userhz_jiffies(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -3656,7 +3656,7 @@ static int neigh_proc_dointvec_userhz_jiffies(struct ctl_table *ctl, int write, return ret; } -int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write, +int neigh_proc_dointvec_ms_jiffies(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec_ms_jiffies(ctl, write, buffer, lenp, ppos); @@ -3666,7 +3666,7 @@ int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write, } EXPORT_SYMBOL(neigh_proc_dointvec_ms_jiffies); -static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write, +static int neigh_proc_dointvec_unres_qlen(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -3676,7 +3676,7 @@ static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write, return ret; } -static int neigh_proc_base_reachable_time(struct ctl_table *ctl, int write, +static int neigh_proc_base_reachable_time(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 903ab4a51c17..ba9842d773e3 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -94,7 +94,7 @@ static struct cpumask *rps_default_mask_cow_alloc(struct net *net) return rps_default_mask; } -static int rps_default_mask_sysctl(struct ctl_table *table, int write, +static int rps_default_mask_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = (struct net *)table->data; @@ -125,7 +125,7 @@ static int rps_default_mask_sysctl(struct ctl_table *table, int write, return err; } -static int rps_sock_flow_sysctl(struct ctl_table *table, int write, +static int rps_sock_flow_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { unsigned int orig_size, size; @@ -197,7 +197,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write, #ifdef CONFIG_NET_FLOW_LIMIT static DEFINE_MUTEX(flow_limit_update_mutex); -static int flow_limit_cpu_sysctl(struct ctl_table *table, int write, +static int flow_limit_cpu_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct sd_flow_limit *cur; @@ -254,7 +254,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write, return ret; } -static int flow_limit_table_len_sysctl(struct ctl_table *table, int write, +static int flow_limit_table_len_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { unsigned int old, *ptr; @@ -276,7 +276,7 @@ static int flow_limit_table_len_sysctl(struct ctl_table *table, int write, #endif /* CONFIG_NET_FLOW_LIMIT */ #ifdef CONFIG_NET_SCHED -static int set_default_qdisc(struct ctl_table *table, int write, +static int set_default_qdisc(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { char id[IFNAMSIZ]; @@ -295,7 +295,7 @@ static int set_default_qdisc(struct ctl_table *table, int write, } #endif -static int proc_do_dev_weight(struct ctl_table *table, int write, +static int proc_do_dev_weight(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { static DEFINE_MUTEX(dev_weight_mutex); @@ -313,7 +313,7 @@ static int proc_do_dev_weight(struct ctl_table *table, int write, return ret; } -static int proc_do_rss_key(struct ctl_table *table, int write, +static int proc_do_rss_key(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table fake_table; @@ -326,7 +326,7 @@ static int proc_do_rss_key(struct ctl_table *table, int write, } #ifdef CONFIG_BPF_JIT -static int proc_dointvec_minmax_bpf_enable(struct ctl_table *table, int write, +static int proc_dointvec_minmax_bpf_enable(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -359,7 +359,7 @@ static int proc_dointvec_minmax_bpf_enable(struct ctl_table *table, int write, # ifdef CONFIG_HAVE_EBPF_JIT static int -proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write, +proc_dointvec_minmax_bpf_restricted(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!capable(CAP_SYS_ADMIN)) @@ -370,7 +370,7 @@ proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write, # endif /* CONFIG_HAVE_EBPF_JIT */ static int -proc_dolongvec_minmax_bpf_restricted(struct ctl_table *table, int write, +proc_dolongvec_minmax_bpf_restricted(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!capable(CAP_SYS_ADMIN)) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 7592f242336b..2e6912c1fb21 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -2377,7 +2377,7 @@ static int devinet_conf_ifindex(struct net *net, struct ipv4_devconf *cnf) } } -static int devinet_conf_proc(struct ctl_table *ctl, int write, +static int devinet_conf_proc(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int old_value = *(int *)ctl->data; @@ -2429,7 +2429,7 @@ static int devinet_conf_proc(struct ctl_table *ctl, int write, return ret; } -static int devinet_sysctl_forward(struct ctl_table *ctl, int write, +static int devinet_sysctl_forward(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; @@ -2476,7 +2476,7 @@ static int devinet_sysctl_forward(struct ctl_table *ctl, int write, return ret; } -static int ipv4_doint_and_flush(struct ctl_table *ctl, int write, +static int ipv4_doint_and_flush(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 2e29ab819967..d2e88f3e6fe8 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3394,7 +3394,7 @@ static int ip_rt_gc_min_interval __read_mostly = HZ / 2; static int ip_rt_gc_elasticity __read_mostly = 8; static int ip_min_valid_pmtu __read_mostly = IPV4_MIN_MTU; -static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write, +static int ipv4_sysctl_rtcache_flush(const struct ctl_table *__ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = (struct net *)__ctl->extra1; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index fc4c001bf72a..4c3a03b7a0f8 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -62,7 +62,7 @@ static void set_local_port_range(struct net *net, unsigned int low, unsigned int } /* Validate changes from /proc interface. */ -static int ipv4_local_port_range(struct ctl_table *table, int write, +static int ipv4_local_port_range(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = table->data; @@ -96,7 +96,7 @@ static int ipv4_local_port_range(struct ctl_table *table, int write, } /* Validate changes from /proc interface. */ -static int ipv4_privileged_ports(struct ctl_table *table, int write, +static int ipv4_privileged_ports(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(table->data, struct net, @@ -159,7 +159,7 @@ static void set_ping_group_range(const struct ctl_table *table, } /* Validate changes from /proc interface. */ -static int ipv4_ping_group_range(struct ctl_table *table, int write, +static int ipv4_ping_group_range(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct user_namespace *user_ns = current_user_ns(); @@ -194,7 +194,7 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write, return ret; } -static int ipv4_fwd_update_priority(struct ctl_table *table, int write, +static int ipv4_fwd_update_priority(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net; @@ -210,7 +210,7 @@ static int ipv4_fwd_update_priority(struct ctl_table *table, int write, return ret; } -static int proc_tcp_congestion_control(struct ctl_table *ctl, int write, +static int proc_tcp_congestion_control(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(ctl->data, struct net, @@ -230,7 +230,7 @@ static int proc_tcp_congestion_control(struct ctl_table *ctl, int write, return ret; } -static int proc_tcp_available_congestion_control(struct ctl_table *ctl, +static int proc_tcp_available_congestion_control(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -246,7 +246,7 @@ static int proc_tcp_available_congestion_control(struct ctl_table *ctl, return ret; } -static int proc_allowed_congestion_control(struct ctl_table *ctl, +static int proc_allowed_congestion_control(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -283,7 +283,7 @@ static int sscanf_key(char *buf, __le32 *key) return ret; } -static int proc_tcp_fastopen_key(struct ctl_table *table, int write, +static int proc_tcp_fastopen_key(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(table->data, struct net, @@ -354,7 +354,7 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, return ret; } -static int proc_tfo_blackhole_detect_timeout(struct ctl_table *table, +static int proc_tfo_blackhole_detect_timeout(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -369,7 +369,7 @@ static int proc_tfo_blackhole_detect_timeout(struct ctl_table *table, return ret; } -static int proc_tcp_available_ulp(struct ctl_table *ctl, +static int proc_tcp_available_ulp(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -386,7 +386,7 @@ static int proc_tcp_available_ulp(struct ctl_table *ctl, return ret; } -static int proc_tcp_ehash_entries(struct ctl_table *table, int write, +static int proc_tcp_ehash_entries(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(table->data, struct net, @@ -410,7 +410,7 @@ static int proc_tcp_ehash_entries(struct ctl_table *table, int write, return proc_dointvec(&tbl, write, buffer, lenp, ppos); } -static int proc_udp_hash_entries(struct ctl_table *table, int write, +static int proc_udp_hash_entries(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(table->data, struct net, @@ -434,8 +434,8 @@ static int proc_udp_hash_entries(struct ctl_table *table, int write, } #ifdef CONFIG_IP_ROUTE_MULTIPATH -static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write, - void *buffer, size_t *lenp, +static int proc_fib_multipath_hash_policy(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = container_of(table->data, struct net, @@ -449,8 +449,8 @@ static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write, return ret; } -static int proc_fib_multipath_hash_fields(struct ctl_table *table, int write, - void *buffer, size_t *lenp, +static int proc_fib_multipath_hash_fields(const struct ctl_table *table, + int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 96ab349e8ba4..5190acc3c4f8 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -6308,7 +6308,7 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) #ifdef CONFIG_SYSCTL -static int addrconf_sysctl_forward(struct ctl_table *ctl, int write, +static int addrconf_sysctl_forward(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; @@ -6333,7 +6333,7 @@ static int addrconf_sysctl_forward(struct ctl_table *ctl, int write, return ret; } -static int addrconf_sysctl_mtu(struct ctl_table *ctl, int write, +static int addrconf_sysctl_mtu(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct inet6_dev *idev = ctl->extra1; @@ -6404,7 +6404,7 @@ static int addrconf_disable_ipv6(const struct ctl_table *table, int *p, int newf return 0; } -static int addrconf_sysctl_disable(struct ctl_table *ctl, int write, +static int addrconf_sysctl_disable(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; @@ -6429,7 +6429,7 @@ static int addrconf_sysctl_disable(struct ctl_table *ctl, int write, return ret; } -static int addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write, +static int addrconf_sysctl_proxy_ndp(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; @@ -6470,7 +6470,7 @@ static int addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write, return ret; } -static int addrconf_sysctl_addr_gen_mode(struct ctl_table *ctl, int write, +static int addrconf_sysctl_addr_gen_mode(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -6533,7 +6533,7 @@ static int addrconf_sysctl_addr_gen_mode(struct ctl_table *ctl, int write, return ret; } -static int addrconf_sysctl_stable_secret(struct ctl_table *ctl, int write, +static int addrconf_sysctl_stable_secret(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -6601,7 +6601,7 @@ static int addrconf_sysctl_stable_secret(struct ctl_table *ctl, int write, } static -int addrconf_sysctl_ignore_routes_with_linkdown(struct ctl_table *ctl, +int addrconf_sysctl_ignore_routes_with_linkdown(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) @@ -6701,8 +6701,9 @@ int addrconf_disable_policy(const struct ctl_table *ctl, int *valp, int val) return 0; } -static int addrconf_sysctl_disable_policy(struct ctl_table *ctl, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int addrconf_sysctl_disable_policy(const struct ctl_table *ctl, + int write, void *buffer, + size_t *lenp, loff_t *ppos) { int *valp = ctl->data; int val = *valp; diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 945d5f5ca039..abcd93bee5d7 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1951,7 +1951,7 @@ static void ndisc_warn_deprecated_sysctl(const struct ctl_table *ctl, } } -int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void *buffer, +int ndisc_ifinfo_sysctl_change(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net_device *dev = ctl->extra1; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1f4b935a0e57..c8340013bf72 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6329,7 +6329,7 @@ static int rt6_stats_seq_show(struct seq_file *seq, void *v) #ifdef CONFIG_SYSCTL -static int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write, +static int ipv6_sysctl_rtcache_flush(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net; diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 75de55f907b0..e5a4cbc3e8c3 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c @@ -30,7 +30,7 @@ static u32 rt6_multipath_hash_fields_all_mask = static u32 ioam6_id_max = IOAM6_DEFAULT_ID; static u64 ioam6_id_wide_max = IOAM6_DEFAULT_ID_WIDE; -static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write, +static int proc_rt6_multipath_hash_policy(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net; @@ -46,7 +46,7 @@ static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write, } static int -proc_rt6_multipath_hash_fields(struct ctl_table *table, int write, void *buffer, +proc_rt6_multipath_hash_fields(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net; diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 5d2012d1cf4a..9ed2db996ec1 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1347,7 +1347,7 @@ static int mpls_netconf_dump_devconf(struct sk_buff *skb, #define MPLS_PERDEV_SYSCTL_OFFSET(field) \ (&((struct mpls_dev *)0)->field) -static int mpls_conf_proc(struct ctl_table *ctl, int write, +static int mpls_conf_proc(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { int oval = *(int *)ctl->data; @@ -2601,7 +2601,7 @@ static int resize_platform_label_table(struct net *net, size_t limit) return -ENOMEM; } -static int mpls_platform_labels(struct ctl_table *table, int write, +static int mpls_platform_labels(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = table->data; diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 689ac521ea2d..e34879f7a2f4 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -1846,7 +1846,7 @@ static int ip_vs_zero_all(struct netns_ipvs *ipvs) #ifdef CONFIG_SYSCTL static int -proc_do_defense_mode(struct ctl_table *table, int write, +proc_do_defense_mode(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct netns_ipvs *ipvs = table->extra2; @@ -1873,7 +1873,7 @@ proc_do_defense_mode(struct ctl_table *table, int write, } static int -proc_do_sync_threshold(struct ctl_table *table, int write, +proc_do_sync_threshold(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct netns_ipvs *ipvs = table->extra2; @@ -1901,7 +1901,7 @@ proc_do_sync_threshold(struct ctl_table *table, int write, } static int -proc_do_sync_ports(struct ctl_table *table, int write, +proc_do_sync_ports(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int *valp = table->data; @@ -1984,7 +1984,7 @@ static int ipvs_proc_est_cpumask_get(const struct ctl_table *table, return ret; } -static int ipvs_proc_est_cpulist(struct ctl_table *table, int write, +static int ipvs_proc_est_cpulist(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -2011,7 +2011,7 @@ static int ipvs_proc_est_cpulist(struct ctl_table *table, int write, return ret; } -static int ipvs_proc_est_nice(struct ctl_table *table, int write, +static int ipvs_proc_est_nice(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct netns_ipvs *ipvs = table->extra2; @@ -2041,7 +2041,7 @@ static int ipvs_proc_est_nice(struct ctl_table *table, int write, return ret; } -static int ipvs_proc_run_estimation(struct ctl_table *table, int write, +static int ipvs_proc_run_estimation(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct netns_ipvs *ipvs = table->extra2; diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index bb9dea676ec1..3d5284639ca8 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -527,7 +527,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_count); static unsigned int nf_conntrack_htable_size_user __read_mostly; static int -nf_conntrack_hash_sysctl(struct ctl_table *table, int write, +nf_conntrack_hash_sysctl(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/net/netfilter/nf_hooks_lwtunnel.c b/net/netfilter/nf_hooks_lwtunnel.c index 00e89ffd78f6..3d237f9cc8ee 100644 --- a/net/netfilter/nf_hooks_lwtunnel.c +++ b/net/netfilter/nf_hooks_lwtunnel.c @@ -25,7 +25,7 @@ static inline int nf_hooks_lwtunnel_set(int enable) } #ifdef CONFIG_SYSCTL -int nf_hooks_lwtunnel_sysctl_handler(struct ctl_table *table, int write, +int nf_hooks_lwtunnel_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int proc_nf_hooks_lwtunnel_enabled = 0; diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index efedd2f13ac7..a8edc3e75db9 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c @@ -409,7 +409,7 @@ static struct ctl_table nf_log_sysctl_ftable[] = { { } }; -static int nf_log_proc_dostring(struct ctl_table *table, int write, +static int nf_log_proc_dostring(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { const struct nf_logger *logger; diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c index 0d0bf41381c2..e59d16e67376 100644 --- a/net/phonet/sysctl.c +++ b/net/phonet/sysctl.c @@ -48,7 +48,7 @@ void phonet_get_local_port_range(int *min, int *max) } while (read_seqretry(&local_port_range_lock, seq)); } -static int proc_local_port_range(struct ctl_table *table, int write, +static int proc_local_port_range(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/net/rds/tcp.c b/net/rds/tcp.c index 2dba7505b414..d23ea8c11902 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -61,7 +61,7 @@ static atomic_t rds_tcp_unloading = ATOMIC_INIT(0); static struct kmem_cache *rds_tcp_conn_slab; -static int rds_tcp_skbuf_handler(struct ctl_table *ctl, int write, +static int rds_tcp_skbuf_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *fpos); static int rds_tcp_min_sndbuf = SOCK_MIN_SNDBUF; @@ -683,7 +683,7 @@ static void rds_tcp_sysctl_reset(struct net *net) spin_unlock_irq(&rds_tcp_conn_lock); } -static int rds_tcp_skbuf_handler(struct ctl_table *ctl, int write, +static int rds_tcp_skbuf_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *fpos) { struct net *net = current->nsproxy->net_ns; diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 25bdf17c7262..3af5d7b05ae9 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c @@ -43,19 +43,19 @@ static unsigned long max_autoclose_max = (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ; -static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write, +static int proc_sctp_do_hmac_alg(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write, +static int proc_sctp_do_rto_min(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, void *buffer, - size_t *lenp, loff_t *ppos); -static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, void *buffer, - size_t *lenp, loff_t *ppos); -static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, +static int proc_sctp_do_rto_max(const struct ctl_table *ctl, int write, + void *buffer, size_t *lenp, loff_t *ppos); +static int proc_sctp_do_udp_port(const struct ctl_table *ctl, int write, + void *buffer, size_t *lenp, loff_t *ppos); +static int proc_sctp_do_alpha_beta(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -static int proc_sctp_do_auth(struct ctl_table *ctl, int write, +static int proc_sctp_do_auth(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); -static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write, +static int proc_sctp_do_probe_interval(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos); static struct ctl_table sctp_table[] = { @@ -388,7 +388,7 @@ static struct ctl_table sctp_net_table[] = { { /* sentinel */ } }; -static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write, +static int proc_sctp_do_hmac_alg(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; @@ -433,7 +433,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write, return ret; } -static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write, +static int proc_sctp_do_rto_min(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; @@ -461,7 +461,7 @@ static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write, return ret; } -static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, +static int proc_sctp_do_rto_max(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; @@ -489,7 +489,7 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, return ret; } -static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, +static int proc_sctp_do_alpha_beta(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (write) @@ -499,7 +499,7 @@ static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); } -static int proc_sctp_do_auth(struct ctl_table *ctl, int write, +static int proc_sctp_do_auth(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; @@ -528,7 +528,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write, return ret; } -static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, +static int proc_sctp_do_udp_port(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; @@ -569,7 +569,7 @@ static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, return ret; } -static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write, +static int proc_sctp_do_probe_interval(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct net *net = current->nsproxy->net_ns; diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 93941ab12549..672067efacef 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -40,7 +40,7 @@ EXPORT_SYMBOL_GPL(nlm_debug); #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) -static int proc_do_xprt(struct ctl_table *table, int write, +static int proc_do_xprt(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { char tmpbuf[256]; @@ -62,8 +62,8 @@ static int proc_do_xprt(struct ctl_table *table, int write, } static int -proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp, - loff_t *ppos) +proc_dodebug(const struct ctl_table *table, int write, void *buffer, + size_t *lenp, loff_t *ppos) { char tmpbuf[20], *s = NULL; char *p; diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index f86970733eb0..09832e4945a3 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c @@ -74,7 +74,7 @@ enum { SVCRDMA_COUNTER_BUFSIZ = sizeof(unsigned long long), }; -static int svcrdma_counter_handler(struct ctl_table *table, int write, +static int svcrdma_counter_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct percpu_counter *stat = (struct percpu_counter *)table->data; diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 6239777090c4..16568b6d589d 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -2029,7 +2029,7 @@ static int __init alloc_buffers(void) } #ifdef CONFIG_SYSCTL -static int apparmor_dointvec(struct ctl_table *table, int write, +static int apparmor_dointvec(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!aa_current_policy_admin_capable(NULL)) diff --git a/security/min_addr.c b/security/min_addr.c index 88c9a6a21f47..0ce267c041ab 100644 --- a/security/min_addr.c +++ b/security/min_addr.c @@ -29,7 +29,7 @@ static void update_mmap_min_addr(void) * sysctl handler which just sets dac_mmap_min_addr = the new value and then * calls update_mmap_min_addr() so non MAP_FIXED hints get rounded properly */ -int mmap_min_addr_handler(struct ctl_table *table, int write, +int mmap_min_addr_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int ret; diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index b6684a074a59..5b762f452977 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c @@ -435,7 +435,7 @@ static struct security_hook_list yama_hooks[] __ro_after_init = { }; #ifdef CONFIG_SYSCTL -static int yama_dointvec_minmax(struct ctl_table *table, int write, +static int yama_dointvec_minmax(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table table_copy;