Message ID | 20240315-sysctl-const-handler-v1-1-1322ac7cb03d@weissschuh.net (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 EEF69C54E6A for <linux-mm@archiver.kernel.org>; Fri, 15 Mar 2024 20:48:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D602A80142; Fri, 15 Mar 2024 16:48:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D0B1D800B4; Fri, 15 Mar 2024 16:48:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B845980142; Fri, 15 Mar 2024 16:48:22 -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 AB5B1800B4 for <linux-mm@kvack.org>; Fri, 15 Mar 2024 16:48:22 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 85FAE140DB2 for <linux-mm@kvack.org>; Fri, 15 Mar 2024 20:48:22 +0000 (UTC) X-FDA: 81900461244.21.75CB5C4 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf03.hostedemail.com (Postfix) with ESMTP id 8AD0F20004 for <linux-mm@kvack.org>; Fri, 15 Mar 2024 20:48:20 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=KAKMyTIr; spf=pass (imf03.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=1710535700; 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=k6t3DmZzxMUzMtsSE5OLzF4+BBya42FgEYUbAPENz4M=; b=tsT+GGVvgwinSsRwp0ZKN0LocKccuLrIFVvB4eHJ70mQpnfT9waTWV/HnKofM1e9l5D5Gg ijjFa+iez7VSyW3wGhyBMpirFpu6/MXYNobBBUzB6hYFQmbdtTZcJ6/JQAOA+vkSZ0u3yv hBVpq6npD2B6ZNf+hT3U3h7PajnRvUA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710535700; a=rsa-sha256; cv=none; b=iAa7mxCCRm0ehohdaPAXrhul8LmXetURKWsjS2/jnSRytqe09G5kHwNdwV5ltHrFYrCk27 DYxHuadEjBDkGAPB1oLPgYuhzP4lIEIrketXb+5DgoYSkbOT85lk9EFdPjO3oDetvmgx3S F7xsaAklOZwuVK10RuN/kMbWRWivNNc= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=KAKMyTIr; spf=pass (imf03.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=1710535696; bh=H2m3CgyPxKp8J+A7s6etu+nqQuMydVMaRq2xUBYcaE4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KAKMyTIrxsBKgzyowba560Va0oJiD0MsSOpq/KKmIhQMjwW/Y1aOE3/Dn8oyWJu3Q ch5t4fh43gRp6lXO3u/WZdPgPrZC1ZY1fTdYnJOWWejpqsv3ZFOQdJBBdBPCMymWyi mjiCD+xXA6BByHT9/rUXPnIE44pC/sa/0O7fCWDk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> Date: Fri, 15 Mar 2024 21:47:59 +0100 Subject: [PATCH 01/11] stackleak: don't modify ctl_table argument MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240315-sysctl-const-handler-v1-1-1322ac7cb03d@weissschuh.net> References: <20240315-sysctl-const-handler-v1-0-1322ac7cb03d@weissschuh.net> In-Reply-To: <20240315-sysctl-const-handler-v1-0-1322ac7cb03d@weissschuh.net> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kees Cook <keescook@chromium.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, Muchun Song <muchun.song@linux.dev>, Andrew Morton <akpm@linux-foundation.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, David Ahern <dsahern@kernel.org>, Simon Horman <horms@verge.net.au>, Julian Anastasov <ja@ssi.bg>, Pablo Neira Ayuso <pablo@netfilter.org>, Jozsef Kadlecsik <kadlec@netfilter.org>, Florian Westphal <fw@strlen.de>, Luis Chamberlain <mcgrof@kernel.org>, Joel Granados <j.granados@samsung.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Phillip Potter <phil@philpotter.co.uk>, Theodore Ts'o <tytso@mit.edu>, "Jason A. Donenfeld" <Jason@zx2c4.com>, Sudip Mukherjee <sudipm.mukherjee@gmail.com>, Mark Rutland <mark.rutland@arm.com>, Atish Patra <atishp@atishpatra.org>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, Eric Biederman <ebiederm@xmission.com>, Chandan Babu R <chandan.babu@oracle.com>, "Darrick J. Wong" <djwong@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu <mhiramat@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Balbir Singh <bsingharora@gmail.com>, "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>, Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>, Petr Mladek <pmladek@suse.com>, John Ogness <john.ogness@linutronix.de>, Sergey Senozhatsky <senozhatsky@chromium.org>, Juri Lelli <juri.lelli@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>, Daniel Bristot de Oliveira <bristot@redhat.com>, Valentin Schneider <vschneid@redhat.com>, Andy Lutomirski <luto@amacapital.net>, Will Drewry <wad@chromium.org>, John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Roopa Prabhu <roopa@nvidia.com>, Nikolay Aleksandrov <razor@blackwall.org>, Remi Denis-Courmont <courmisch@gmail.com>, Allison Henderson <allison.henderson@oracle.com>, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>, Xin Long <lucien.xin@gmail.com>, Chuck Lever <chuck.lever@oracle.com>, Jeff Layton <jlayton@kernel.org>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>, John Johansen <john.johansen@canonical.com>, Paul Moore <paul@paul-moore.com>, James Morris <jmorris@namei.org>, "Serge E. Hallyn" <serge@hallyn.com>, Alexander Popov <alex.popov@linux.com> Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-fsdevel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-xfs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kexec@lists.infradead.org, bridge@lists.linux.dev, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-sctp@vger.kernel.org, linux-nfs@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1710535695; l=1205; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=H2m3CgyPxKp8J+A7s6etu+nqQuMydVMaRq2xUBYcaE4=; b=DLCpjj80ePju45B1sM6SeMu3SU3+SovEAF9F+apF8HUTZcbHxhK7sFWDz+WraIYUf5lzi8ctP 25gNqwcr0i1CjOhkjNKarmdmKbieJ/tL+nZegKGxX2K6TvuJVTedQUi X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Queue-Id: 8AD0F20004 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: umz4yxdn45umq3wi1jk985bfa6wm6ead X-HE-Tag: 1710535700-855289 X-HE-Meta: U2FsdGVkX1+jSQnpxnXpAAIU1uXshtpopuArWWiZ0Ve7teix5cV3mzjzFEDiJJHLVHvFDBSH2tWjUiwSpLbihCrujWMpq24KLPA3zWGAyPXRiV6rx/6cS3WS4lTNB7SZptP15OROEP0s3RFZHBktVb3f2sRymSaxGDRcsksPDIAQm8twzimucyb+0En/etHiG/4FpvLcoo9oAylAGU+n8uQW8TC9B5Lrwt6IqezWTZf4/HgMZzgNWLlXngbX5LOj+LxOGbK9f1GH807KGSzOIEvic0BCEDGwn8xhq7TIO3qddXt2b6PbCpB9J34Wq/LZgJleCuZGC+C7Tr7w2k+QtK8T2L4XEjZyIZRG9fFIpLqA6HYAqgBB2w0Q5vWq/UcR9OZuJUMSHKvER+bYS6ZmiR7iI31yZDQQLA6NCovttVDwkRW6asUaQPTDvC2JjNapOFVBmob43y+z4Kk9CUgFaBB/B44FO5OixTxIFRmXMs00LquyICgkpDLSEXlfMW43giWN8WO/rH9ziUbKlSxiZH2joFYMXYiexEe0gNpcZHcM15VX5oUjfB7tx20vDeH6x9LWluASQQzmkOdeUZ8R1mobXByAeKEKMUCnNKINdcHSfel5SFbvcLzO4JJ3PIVUzfG5RMq48DLiG865DwB9AnWcHHJV9bMU1znpC9/hy7RsxREnkDp806MOD3+7SKbRE6F4oJXpGxAA0R/39lq2/a2J2xREzLb7vA8cCSdiruLSWi8r5PUBy/RQH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aoLO0rB28YKpNCd7ch8IXT4hV59/KqEFdPHk/ZSVmSMBwQyiE+rN0x7iEnrkTPs+8rVaUGyeZ3zd6CfPFaKUhIuIbmb3UGmiWgZiACYMw7hU9YcEFALfgDSou58CeZEJ3Ofa6gudnv6drFXSSzUPP1meYNk3zcsOYDDi0RVPDBFifrv93CEK5QIXllM+qMErA9vEfSp6CfxzorjOP3d01KbWA3+CkrytOcvp1JaASr/pRIQ53g0MQRGXUr3jkHz1iclPpxMV6XcEaznS43TvKClbwvDhE5XL5DW1BL7WgeUaN5KX7njWmh1+IFbsxKlfKyYXD19U8qdRtBDb/vNoLlE95LXLAckOC0HgSND3J0gUUNfQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
sysctl: treewide: constify ctl_table argument of sysctl handlers
|
expand
|
diff --git a/kernel/stackleak.c b/kernel/stackleak.c index 34c9d81eea94..b292e5ca0b7d 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;