mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] sysctl changes for v7.4-rc1
@ 2026-10-20 13:08 Joel Granados
  2026-10-23 19:44 ` Linus Torvalds
  2026-10-23 19:57 ` pr-tracker-bot
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Granados @ 2026-10-20 13:08 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Bradley Morgan, Ethan Nelson-Moore, Oleg Nesterov, Yibo Tan,
	Zhan Xusheng, Kees Cook, linux-fsdevel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2901 bytes --]

The following changes since commit df2908090cda368b01ff43709f51890076c56157:

  Linux 7.3-rc2 (2026-09-06 15:07:20 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/ tags/sysctl-7.04-rc1

for you to fetch changes up to 7b08e5851884e4ad207a6401b1dcffdb03d43c28:

  selftests: sysctl: Check the sign of a negative jiffies read (2026-09-25 14:00:00 +0200)

----------------------------------------------------------------
Summary

* Disallow partial vector updates

  Stage sysctl vector writes before updating. Removes the chance of leaving a
  sysctl vector partially updated due to erroneous input. This is not an atomic
  write; a concurrent reader can still see a partially updated vector.

* Remove redundant sysctl config guards

  Remove locations where (CONFIG_SYSCTL && CONFIG_PROC_FS) was checked. They
  are superfluous as CONFIG_SYSCTL now depends directly on CONFIG_PROC_FS.

* Rewrite selftests using KTAP helpers

  Each test now reports its own KTAP result and runs in a subshell. Test suite
  continues after failure.

* Misc

  Fix a use-after-free in the selftests test_sysctl module. Quiet an unused
  variable warning in fs/proc/proc_sysctl.c:init_header(). Add tests for
  partial vector updates and the int jiffies converters.

* Testing

  This series was run through the sysctl selftests and kunit in x86_64. It
  landed in linux-next between rc2 and rc3, giving the latest changes
  considerable of testing

----------------------------------------------------------------
Ethan Nelson-Moore (1):
      sysctl: quiet unused variable warning in fs/proc/proc_sysctl.c:init_header()

Joel Granados (5):
      sysctl: Split data conversion and file position handling
      sysctl: Reject uint arrays before calling the general proc_vec
      sysctl: Disallow partial updates for erroneous sysctl vectors
      sysctl: Add 0013 to test partially updated vectors
      sysctl: Rewrite selftests on top of KTAP helpers

Oleg Nesterov (3):
      sysctl: collapse redundant CONFIG_SYSCTL nesting in kernel/sysctl.c
      sysctl: consolidate CONFIG_SYSCTL into a single block in kernel/sysctl.c
      sysctl: remove redundant CONFIG_PROC_FS checks

Yibo Tan (1):
      sysctl: unregister tables before freeing bitmap

Zhan Xusheng (2):
      sysctl: Add jiffies converter entries to the test module
      selftests: sysctl: Check the sign of a negative jiffies read

 drivers/parport/procfs.c                 |    6 +-
 fs/dcache.c                              |    2 +-
 fs/file_table.c                          |    2 +-
 fs/proc/proc_sysctl.c                    |    2 +-
 kernel/sysctl.c                          |  459 ++++++----
 lib/test_sysctl.c                        |   33 +-
 tools/testing/selftests/sysctl/sysctl.sh | 1476 ++++++++++++------------------
 7 files changed, 881 insertions(+), 1099 deletions(-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] sysctl changes for v7.4-rc1
  2026-10-20 13:08 [GIT PULL] sysctl changes for v7.4-rc1 Joel Granados
@ 2026-10-23 19:44 ` Linus Torvalds
  2026-10-27 12:10   ` Joel Granados
  2026-10-23 19:57 ` pr-tracker-bot
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2026-10-23 19:44 UTC (permalink / raw)
  To: Joel Granados
  Cc: Bradley Morgan, Ethan Nelson-Moore, Oleg Nesterov, Yibo Tan,
	Zhan Xusheng, Kees Cook, linux-fsdevel, linux-kernel

On Tue, 20 Oct 2026 at 03:09, Joel Granados <joel.granados@kernel.org> wrote:
>
> * Disallow partial vector updates
>
>   Stage sysctl vector writes before updating. Removes the chance of leaving a
>   sysctl vector partially updated due to erroneous input. This is not an atomic
>   write; a concurrent reader can still see a partially updated vector.

I've pulled this, but this feels like it could easily break any number
of random scripts.

We used to just update until we hit an error, and I would not be AT
ALL surprised if there are scripts around that echo some
not-entirely-cleaned-up string to /proc/sys.

Put another way: I do not understand why that commit claims that the
vector data should be unchanged just because the Nth element wasn't a
number.

What was the impetus for this change? Was there an actual problem it
fixes, or was it just a random decision to possibly break user space?

                  Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] sysctl changes for v7.4-rc1
  2026-10-20 13:08 [GIT PULL] sysctl changes for v7.4-rc1 Joel Granados
  2026-10-23 19:44 ` Linus Torvalds
@ 2026-10-23 19:57 ` pr-tracker-bot
  1 sibling, 0 replies; 4+ messages in thread
From: pr-tracker-bot @ 2026-10-23 19:57 UTC (permalink / raw)
  To: Joel Granados
  Cc: Linus Torvalds, Bradley Morgan, Ethan Nelson-Moore,
	Oleg Nesterov, Yibo Tan, Zhan Xusheng, Kees Cook, linux-fsdevel,
	linux-kernel

The pull request you sent on Tue, 20 Oct 2026 15:08:55 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/ tags/sysctl-7.04-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/845f394e462fb1bd67b9779c467be478631a4daf

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] sysctl changes for v7.4-rc1
  2026-10-23 19:44 ` Linus Torvalds
@ 2026-10-27 12:10   ` Joel Granados
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Granados @ 2026-10-27 12:10 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Bradley Morgan, Ethan Nelson-Moore, Oleg Nesterov, Yibo Tan,
	Zhan Xusheng, Kees Cook, linux-fsdevel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2893 bytes --]

On Fri, Oct 23, 2026 at 09:44:01AM -1000, Linus Torvalds wrote:
> On Tue, 20 Oct 2026 at 03:09, Joel Granados <joel.granados@kernel.org> wrote:
> >
> > * Disallow partial vector updates
> >
> >   Stage sysctl vector writes before updating. Removes the chance of leaving a
> >   sysctl vector partially updated due to erroneous input. This is not an atomic
> >   write; a concurrent reader can still see a partially updated vector.
> 
> I've pulled this, but this feels like it could easily break any number
> of random scripts.
> 
> We used to just update until we hit an error, and I would not be AT
> ALL surprised if there are scripts around that echo some
> not-entirely-cleaned-up string to /proc/sys.

Writing fewer elements than the vector or junk after a complete vector
behave exactly as before. What changes is only a write that already
returned EINVAL.

> 
> Put another way: I do not understand why that commit claims that the
> vector data should be unchanged just because the Nth element wasn't a
> number.

Not because the Nth elem is a number, but because the write fails.

Two comments:
1. The vector must remain unchanged on error for internal custom proc
   handlers (like vm.lowmem_reserve_ratio & kernel.sem) to avoid missing
   post-processing of a partially updated vector.

2. The user space that will be affected are the ones that ignore the
   EINVAL return value of the writable numeric sysctl vectors [1] (14: give
   or take) and depend on a subset of it being updated.

In retrospect I see that I missed clarifying the impact of the change. I
made a note of it for next time.

> 
> What was the impetus for this change? Was there an actual problem it
> fixes, or was it just a random decision to possibly break user space?

This all came about from Jianlin Shi's fix for vm.lowmem_reserve_ratio
[2]. An erroneous return from proc_dointvec_minmax meant that
setup_per_zone_lowmem_reserve was not executed even when the some of
sysctl_lowmem_reserve_ratio vector was changed. Andrew's take was that
the handler should parse into a temporary, and that this is really a
flaw in proc_dointvec_minmax(). So not just a random decision.

I see 2 options:
1. Leave this in and I'll address anything that bubbles up in the
   7.4-rcX cycle. With the option of removing it if the impact to user
   space is to big.

2. We remove it before rc1. And make sure that all custom proc handlers
   stage their vectors on write.

Let me know what you prefer or if you have another option.

Best

Joel

[1] kernel.{printk,acct,sem},
    vm.lowmem_reserve_ratio,
    net.ipv4.{tcp_rmem,tcp_wmem,tcp_mem,udp_mem},
    net.sctp.{sctp_mem,sctp_rmem,sctp_wmem},
    net.tipc.{tipc_rmem,sk_filter}
    net.ipv4.vs.sync_threshold 

[2] https://lore.kernel.org/all/tencent_FFD4F4D728AAE8A8AE0AF277A59854A29A06@qq.com


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-27 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 13:08 [GIT PULL] sysctl changes for v7.4-rc1 Joel Granados
2026-10-23 19:44 ` Linus Torvalds
2026-10-27 12:10   ` Joel Granados
2026-10-23 19:57 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®