mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] init: fix array boundary bugs in boot parameter parsing
@ 2026-08-18  4:53 Wilson Felipe Pereira
  2026-08-18  4:53 ` [PATCH 1/2] init/main: fix off-by-one in argv_init cleanup Wilson Felipe Pereira
  2026-08-18  4:53 ` [PATCH 2/2] init/main: fix false-positive kernel panic on environment variable overwrite Wilson Felipe Pereira
  0 siblings, 2 replies; 3+ messages in thread
From: Wilson Felipe Pereira @ 2026-08-18  4:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Wilson Felipe Pereira

This series fixes two distinct boundary logic edge-case bugs in
`init/main.c` related to parsing boot command-line arguments and
environment variables. Both bugs have been present since the early
git history (Linux-2.6.12-rc2).

1. The first patch fixes an off-by-one error in `init_setup()` where
   the final slot of the `argv_init` array was left uncleared. This
   allowed a stale kernel parameter to leak into the `init` process's
   user-space command line if exactly `MAX_INIT_ARGS` unknown
   parameters were passed.

2. The second patch fixes a false-positive kernel panic in
   `unknown_bootoption()`. If a user filled the environment variable
   array up to its exact limit (32) and then attempted to overwrite
   the final variable, the kernel would panic before evaluating
   whether it was a harmless duplicate.

Exact QEMU reproduction steps for both edge cases are documented
inside their respective commit descriptions.

Wilson Felipe Pereira (2):
  init/main: fix off-by-one in argv_init cleanup
  init/main: fix false-positive kernel panic on environment variable
    overwrite

 init/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--
2.55.0.699.gb54405d56f-goog

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

end of thread, other threads:[~2026-08-18  4:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18  4:53 [PATCH 0/2] init: fix array boundary bugs in boot parameter parsing Wilson Felipe Pereira
2026-08-18  4:53 ` [PATCH 1/2] init/main: fix off-by-one in argv_init cleanup Wilson Felipe Pereira
2026-08-18  4:53 ` [PATCH 2/2] init/main: fix false-positive kernel panic on environment variable overwrite Wilson Felipe Pereira

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®