[PATCH 0/2] init: fix array boundary bugs in boot parameter parsing

Wilson Felipe Pereira <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.