All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wilson Felipe Pereira <wfelipe@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Wilson Felipe Pereira <wfelipe@google.com>
Subject: [PATCH 0/2] init: fix array boundary bugs in boot parameter parsing
Date: Tue, 18 Aug 2026 04:53:45 +0000	[thread overview]
Message-ID: <20260818045357.4123784-1-wfelipe@google.com> (raw)

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

             reply	other threads:[~2026-08-18  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  4:53 Wilson Felipe Pereira [this message]
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

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=20260818045357.4123784-1-wfelipe@google.com \
    --to=wfelipe@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.