mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Wen Yang <wen.yang@linux.dev>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>,
	 Luis Chamberlain <mcgrof@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	 Joel Granados <j.granados@samsung.com>,
	Christian Brauner <brauner@kernel.org>,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/5] sysctl: encode the min/max values directly in the table entry
Date: Sun, 15 Sep 2024 08:08:10 +0200	[thread overview]
Message-ID: <ec28176d-5ed4-4635-932d-bbc4c1cf6bd7@t-8ch.de> (raw)
In-Reply-To: <cover.1726365007.git.wen.yang@linux.dev>

Hi,

On 2024-09-15 10:08:26+0000, Wen Yang wrote:
> Many modules use these additional static/global variables (such as
> two_five_five, n_65535, ue_int_max, etc.) in the boundary checking of
> sysctl, and they are read-only and never changed.
> 
> Eric points out: "by turning .extra1 and .extra2 into longs instead of
> keeping them as pointers and needing constants to be pointed at somewhere
> .. The only people I can see who find a significant benefit by
> consolidating all of the constants into one place are people who know how
> to stomp kernel memory."
> 
> This patch series achieves direct encoding values in table entries and still
> maintains compatibility with existing extra1/extra2 pointers.
> Afterwards, we can remove these unnecessary static variables progressively and
> also gradually kill the shared const array.

As this is already v3 it would be nice to have a series changelog and
links to previous revisions.

> 
> Wen Yang (5):
>   sysctl: add helper functions to extract table->extra1/extra2
>   sysctl: support encoding values directly in the table entry
>   sysctl: add KUnit test code to check for encoding  min/max in table
>     entries
>   sysctl: delete mmap_rnd_bits_{min/max} and
>     mmap_rnd_compat_bits_{min/max} to save 16 bytes
>   sysctl: delete six_hundred_forty_kb to save 4 bytes
> 
>  fs/proc/proc_sysctl.c  |  29 +-
>  include/linux/mm.h     |   4 -
>  include/linux/sysctl.h |  95 ++++++-
>  kernel/sysctl-test.c   | 581 +++++++++++++++++++++++++++++++++++++++++
>  kernel/sysctl.c        |  45 ++--
>  mm/mmap.c              |   4 -
>  6 files changed, 708 insertions(+), 50 deletions(-)
> 
> -- 
> 2.25.1
> 

      parent reply	other threads:[~2024-09-15  6:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-15  2:08 Wen Yang
2024-09-15  2:08 ` [PATCH v3 1/5] sysctl: add helper functions to extract table->extra1/extra2 Wen Yang
2024-09-15  2:08 ` [PATCH v3 2/5] sysctl: support encoding values directly in the table entry Wen Yang
2024-09-15  6:25   ` Thomas Weißschuh
2024-09-21  8:19     ` Wen Yang
2024-09-15  2:08 ` [PATCH v3 3/5] sysctl: add KUnit test code to check for encoding min/max in table entries Wen Yang
2024-09-15  2:08 ` [PATCH v3 4/5] sysctl: delete mmap_rnd_bits_{min/max} and mmap_rnd_compat_bits_{min/max} to save 16 bytes Wen Yang
2024-09-15  2:08 ` [PATCH v3 5/5] sysctl: delete six_hundred_forty_kb to save 4 bytes Wen Yang
2024-09-15  6:08 ` Thomas Weißschuh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec28176d-5ed4-4635-932d-bbc4c1cf6bd7@t-8ch.de \
    --to=thomas@t-8ch.de \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=j.granados@samsung.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=wen.yang@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome