[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZjQHEpRW7q686kU7@bombadil.infradead.org>
Date: Thu, 2 May 2024 14:35:14 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Allen <allen.lkml@...il.com>
Cc: Kees Cook <keescook@...omium.org>,
Allen Pais <apais@...ux.microsoft.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, viro@...iv.linux.org.uk, brauner@...nel.org,
jack@...e.cz, ebiederm@...ssion.com, j.granados@...sung.com
Subject: Re: [PATCH v2] fs/coredump: Enable dynamic configuration of max file
note size
On Thu, May 02, 2024 at 01:03:52PM -0700, Allen wrote:
> +int proc_core_file_note_size_max(struct ctl_table *table, int write,
> void __user *buffer, size_t *lenp, loff_t *ppos) {
> + int error = proc_douintvec(table, write, buffer, lenp, ppos);
> + if (write && (core_file_note_size_max < MAX_FILE_NOTE_SIZE ||
> core_file_note_size_max > MAX_ALLOWED_NOTE_SIZE))
> + core_file_note_size_max = MAX_FILE_NOTE_SIZE; // Revert to
> default if out of bounds
> + return error;
> +}
There's already a proc helper which let's you set min / max.
Luis
Powered by blists - more mailing lists