lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251017-jag-sysctl_jiffies-v1-0-175d81dfdf82@kernel.org>
Date: Fri, 17 Oct 2025 10:32:10 +0200
From: Joel Granados <joel.granados@...nel.org>
To: Kees Cook <kees@...nel.org>, Alexander Viro <viro@...iv.linux.org.uk>, 
 Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
 Joel Granados <joel.granados@...nel.org>
Subject: [PATCH 0/7] sysctl: Move jiffies converters out of kernel/sysctl.c

Move the jiffies converters into kernel/time/jiffies.c and replace the
pipe-max-size proc_handler converter with a macro based version. This is
all part of the effort to relocate non-sysctl logic out of
kernel/sysctl.c into more relevant subsystems. And is based on the
preparation series in [1].

What was done?
==============

* Moved converter macros (SYSCTL_USER_TO_KERN{,_INT_CONV,UINT_CONV},
  SYSCTL_KERN_TO_USER{,INT_CONV} & SYSCTL_{,U}INT_CONV_CUSTOM) to
  sysctl.h so they can be used in jiffies.c and pipe.c.

* Moved jiffie converters (proc_dointvec_ms_jiffies{,_minmax},
  proc_dointvec{_,_userhz_}jiffies & proc_doulongvec_ms_jiffies_minmax)
  to kernel/time/jiffies.c.

* Replaced do_proc_dopipe_max_size_conv in fs/pipe.c with a macro
  version; no functional changes intended.

Why it is done?
===============

Motivation is to move non-sysctl logic out of kernel/sysctl.c which had
become a dumping ground for ctl_tables until this trend was changed by
the commits leading to (and including) 73184c8e4ff4 ("sysctl: rename
kern_table -> sysctl_subsys_table"). Same motivation as in [1].

Testing
=======

Tested by running sysctl kunit tests and selftests on x86_64 architecture
to ensure no functional regressions.

Comments are greatly appreciated

Best

[1] https://lore.kernel.org/20251016-jag-sysctl_conv-v2-0-a2f16529acc4@kernel.org

Signed-off-by: Joel Granados <joel.granados@...nel.org>
---
Joel Granados (7):
      sysctl: Allow custom converters from outside sysctl
      sysctl: Move INT converter macros to sysctl header
      sysctl: Move UINT converter macros to sysctl header
      sysctl: Move jiffies converters to kernel/time/jiffies.c
      sysctl: Move proc_doulongvec_ms_jiffies_minmax to kernel/time/jiffies.c
      sysctl: Create pipe-max-size converter using sysctl UINT macros
      sysctl: Wrap do_proc_douintvec with the public function proc_douintvec_conv

 fs/pipe.c               |  28 ++---
 include/linux/jiffies.h |  11 ++
 include/linux/sysctl.h  | 145 +++++++++++++++++++---
 kernel/sysctl.c         | 312 +++++++-----------------------------------------
 kernel/time/jiffies.c   | 125 +++++++++++++++++++
 5 files changed, 314 insertions(+), 307 deletions(-)
---
base-commit: 130e5390ba572bffa687f32ed212dac1105b654a
change-id: 20251014-jag-sysctl_jiffies-7f0145ef9b56

Best regards,
-- 
Joel Granados <joel.granados@...nel.org>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ