From nobody Sun Feb 8 02:21:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7712F657A3 for ; Thu, 11 Apr 2024 01:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712797585; cv=none; b=kbv29vueukAXLuhAiMF643Kwr+SuNpn2nL5pnZnaHgqaL9cLCcKUJJftflAWiu8PvsMciriu+xd3VxAp4Kb+/rSiNN0ZWsxKKj/pL5bvYDaK1eehnX+fQ84/TtVojvwv+I30KVaf3CIQtR9p/AQpZPfjZuKksAkfhIMKbbUqcOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712797585; c=relaxed/simple; bh=zhLDADHOwmHHPH8g5hxQ5LSBrm2Fmoz5QVlMxcXmoXc=; h=Date:From:To:Cc:Subject:Message-Id:Mime-Version:Content-Type; b=dCDXRbTlvprwJyba09lYMPKMzM0TzJO73W/qkgHKqDiMMGa+q9ZG+0xdIX1XmGIVdHIqRiKhZf6yovNmBJ9oG43mxveuLO7T2WZ2t3XQnPEFLQb3D0UgBnHNiHqhRPSsmZ0vNfhzVa2QGIpSeKhejMf8Eme4kUy+JowcP4Gf2LQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jyg+0vMn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jyg+0vMn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A6D3C433F1; Thu, 11 Apr 2024 01:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712797585; bh=zhLDADHOwmHHPH8g5hxQ5LSBrm2Fmoz5QVlMxcXmoXc=; h=Date:From:To:Cc:Subject:From; b=Jyg+0vMnyURozpnMc2Xc4q3nFO2f5qbLlsZ9hwgkKxwYNaRo3CFfxkCT6bSPiRtR4 BWTW6cZqOLQMb7FKK4uQ3Cd9nQl9o8Y5EKxpIQ/AezQ4O6X0aAhhud431ka0H68fsr mk1+X7g5+q85XIwUA80CJ2ebTpin/eh5sVmCWs0aNl/mR4IXxgM3FzcwXw9PqE3rnE Ug44ykKSf8fYA21TSgdsDk6mSVxgAchwRs+rxfJgq3Z1EgmFTpNG7ZLu7j9nOTHRTV oP+vcC8uUQorXvSs3OH6JzZSNv4t7wuOXGBnxeWM8GRZKUfhwnWW3udr/IKOLe8S2U /pi5AtO+GulHA== Date: Thu, 11 Apr 2024 10:06:21 +0900 From: Masami Hiramatsu (Google) To: Linus Torvalds Cc: Masami Hiramatsu , Zhenhua Huang , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [GIT PULL] bootconfig: Fixes for v6.9-rc3 Message-Id: <20240411100621.d3fd98310487cef580456853@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Linus, Bootconfig fixes for v6.9-rc3: - fs/proc: Fix to not show original kernel cmdline more than twice on /proc/bootconfig. - fs/proc: Fix to show the original cmdline only if the bootconfig modifies it. Please pull the latest bootconfig-fixes-v6.9-rc3 tree, which can be found a= t: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git bootconfig-fixes-v6.9-rc3 Tag SHA1: b0066d569a0eed92657edc836868122a6761da49 Head SHA1: c722cea208789d9e2660992bcd05fb9fac3adb56 Masami Hiramatsu (1): fs/proc: Skip bootloader comment if no embedded kernel parameters Zhenhua Huang (1): fs/proc: remove redundant comments from /proc/bootconfig ---- fs/proc/bootconfig.c | 12 ++++++------ include/linux/bootconfig.h | 1 + init/main.c | 5 +++++ 3 files changed, 12 insertions(+), 6 deletions(-) --------------------------- diff --git a/fs/proc/bootconfig.c b/fs/proc/bootconfig.c index 902b326e1e56..87dcaae32ff8 100644 --- a/fs/proc/bootconfig.c +++ b/fs/proc/bootconfig.c @@ -62,12 +62,12 @@ static int __init copy_xbc_key_value_list(char *dst, si= ze_t size) break; dst +=3D ret; } - if (ret >=3D 0 && boot_command_line[0]) { - ret =3D snprintf(dst, rest(dst, end), "# Parameters from bootloader:\n#= %s\n", - boot_command_line); - if (ret > 0) - dst +=3D ret; - } + } + if (cmdline_has_extra_options() && ret >=3D 0 && boot_command_line[0]) { + ret =3D snprintf(dst, rest(dst, end), "# Parameters from bootloader:\n# = %s\n", + boot_command_line); + if (ret > 0) + dst +=3D ret; } out: kfree(key); diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h index ca73940e26df..e5ee2c694401 100644 --- a/include/linux/bootconfig.h +++ b/include/linux/bootconfig.h @@ -10,6 +10,7 @@ #ifdef __KERNEL__ #include #include +bool __init cmdline_has_extra_options(void); #else /* !__KERNEL__ */ /* * NOTE: This is only for tools/bootconfig, because tools/bootconfig will diff --git a/init/main.c b/init/main.c index 2ca52474d0c3..881f6230ee59 100644 --- a/init/main.c +++ b/init/main.c @@ -487,6 +487,11 @@ static int __init warn_bootconfig(char *str) =20 early_param("bootconfig", warn_bootconfig); =20 +bool __init cmdline_has_extra_options(void) +{ + return extra_command_line || extra_init_args; +} + /* Change NUL term back to "=3D", to make "param" the whole string. */ static void __init repair_env_string(char *param, char *val) { --=20 Masami Hiramatsu (Google)