From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 E70E533E35C; Mon, 8 Jun 2026 16:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935899; cv=none; b=NLN47rySaZU/cJ5DTrHdi7KH9lxrNaHxscA8+uTe9Ocxo+08vUY7t8K4vGhAn2cNSnP5B74nQmy0sahU7NbAsNxK+kCFf1HPfieE1qN7fL2PPil8DaLPA9/BcHmPnDP4A40C7Uk42toSSmkMq4RPQVvj0FzVNhdzUzGz14IA8aU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935899; c=relaxed/simple; bh=EAWSBZHUbvF+BebKTrcH7f4eYwq+NcrjSdvoq/taW5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KNcCxhmuVEjnPEqgX1athgJDrX6SeTMgXD9q13EghrPGE6F4hfETe/U0VuRrcmbGM/RrOMVqUVlENcp4hn7WhwNBIWq+lm7Np/Gh4ANkhwRK3585YyvZfzZWVaeLoFdwnigvad0KJqhpQOa69QZoHs48PthIEjDjpW2P7OfWyWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=d0knTwgK; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="d0knTwgK" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=pBa18RzXk1ANKaCmnnGIArgni6qzEnHSHRPoGBtodfY=; b=d0knTwgKFs1Irwis1QYmbIPQQn p/1ChDd36Jk6g/tEJoXXt454yKKKLBlUgBmTR9i41jFgsigJIUTr972W70Ga0Vyy0MHH9cN6sWtei 4alK//msRye7FMEqV6VVF2gpmGJvxFYrdqF0i8XRjCorjmNFBKjhQPnni9T1Fmu7E/wC3T+O/3Kq6 N9GqqcS5TYQdhVUyn3gTkT0srXdU9suV8EJtUFqbyNC33EG0Y0fucBB/sk5jT0YpvpPt9qC2KPIaJ +y8x8B1Z979qRbZLZ0B7JZhfd1RqnuYSi6a5cgf7hc/ydN4uf65AjwmWgWSgaMLl9T62XeCe25oJp yh/9w8rQ==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcmS-007kgA-2p; Mon, 08 Jun 2026 16:24:53 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:23:58 -0700 Subject: [PATCH v3 1/6] bootconfig: fix NULL-pointer arithmetic in xbc_snprint_cmdline() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-1-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3059; i=leitao@debian.org; h=from:subject:message-id; bh=EAWSBZHUbvF+BebKTrcH7f4eYwq+NcrjSdvoq/taW5o=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzK5LPT66nv+qLpXluaKpNYu2BCwNRJv6Mam QcnhQFA1SOJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 bd6CD/wK/q58rEK8FWKyE7pAyNDnoOTF0e02qaAQAWYIEtoBQUtwxsRg82rcem8X1610p0t7lYS wP1zMB0H0hD5oPBqWpsjdPHiUTGQZ4ncxu+KRBIA9ZwKeOf/krE1f79xkceshMhEwViAb8WcY+k QBc/IgRGWWAHwxvGgvH9nOpvST4m0aoZuN1s6AzzUbZB6DR+cOIwk36XVKwrdejtbdDdVnWVdTS j3rox/vQ2IXEDIzEcS4fht9kW8jL6Ihk8u6Z8ZnQW0p0JHRa070pknTNIwe4qivQtwx9X6bYSAc 1Zg56ArgRLyXNc0circUzxoj7DhKbHjVCOEctYeq626cEpIWgC+5QEC+BJWsV6Jy7TXFn+5CI2X jULQSwxMP6ln0MTYx0dEbRulqcVGndm/G5u1++Xq3lJO8yjIUrKkvhWQX8Z43AttiI191KnFrcY KwLOw0dfVKgAZA1cWsEtz316TWEO0da0h0JXiEmJPLVdmbs/MGd17hlSsQw0fcjyPt+oVaW1HPC ydfnDgzuJOt+lVwCo2HHIY+YOSdJj+/7aJOI/dCpMgEOfPRhHbevw0gk7A8xNIQwf4shMeKbonG uTSrf6q2Q+gejvzyP685r4I59bL+GpDuVnFQjgB52kRfpDl4uWiWkTU0lJHmMsGrK/sMKGVw9MH reVCFgdMuB65i1A== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao xbc_snprint_cmdline() is meant to be called twice: first with buf=3DNULL, size=3D0 to probe the rendered length, then with a real buffer to fill it (the standard snprintf() two-pass pattern). The probe call makes the function compute "buf + size" (NULL + 0) and, on every iteration, advance "buf +=3D ret" from that NULL base and pass the result back into snprintf(). Pointer arithmetic on a NULL pointer is undefined behavior. It is harmless in the in-kernel callers today, but the follow-up patches run this same code in the userspace tools/bootconfig parser at kernel build time, where host UBSan / FORTIFY_SOURCE abort the build. Track a running written length (size_t) instead of mutating @buf, and only form "buf + len" when @buf is non-NULL. snprintf(NULL, 0, ...) is itself well defined and returns the would-be length, so the two-pass "probe then fill" usage returns identical byte counts. Signed-off-by: Breno Leitao --- lib/bootconfig.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index f445b7703fdd..2ed9ee3dc81c 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -427,10 +427,18 @@ static char xbc_namebuf[XBC_KEYLEN_MAX] __initdata; int __init xbc_snprint_cmdline(char *buf, size_t size, struct xbc_node *ro= ot) { struct xbc_node *knode, *vnode; - char *end =3D buf + size; const char *val, *q; + size_t len =3D 0; int ret; =20 + /* + * Track the running written length rather than advancing @buf, so we + * never form "buf + size" or "buf +=3D ret" while @buf is NULL (the + * size-probe call passes buf=3DNULL, size=3D0). NULL pointer arithmetic + * is undefined behavior and trips host UBSan / FORTIFY_SOURCE when + * this renderer runs at kernel build time. snprintf(NULL, 0, ...) + * itself is well defined and returns the would-be length. + */ xbc_node_for_each_key_value(root, knode, val) { ret =3D xbc_node_compose_key_after(root, knode, xbc_namebuf, XBC_KEYLEN_MAX); @@ -439,10 +447,11 @@ int __init xbc_snprint_cmdline(char *buf, size_t size= , struct xbc_node *root) =20 vnode =3D xbc_node_get_child(knode); if (!vnode) { - ret =3D snprintf(buf, rest(buf, end), "%s ", xbc_namebuf); + ret =3D snprintf(buf ? buf + len : NULL, rest(len, size), + "%s ", xbc_namebuf); if (ret < 0) return ret; - buf +=3D ret; + len +=3D ret; continue; } xbc_array_for_each_value(vnode, val) { @@ -452,15 +461,15 @@ int __init xbc_snprint_cmdline(char *buf, size_t size= , struct xbc_node *root) * whitespace. */ q =3D strpbrk(val, " \t\r\n") ? "\"" : ""; - ret =3D snprintf(buf, rest(buf, end), "%s=3D%s%s%s ", - xbc_namebuf, q, val, q); + ret =3D snprintf(buf ? buf + len : NULL, rest(len, size), + "%s=3D%s%s%s ", xbc_namebuf, q, val, q); if (ret < 0) return ret; - buf +=3D ret; + len +=3D ret; } } =20 - return buf - (end - size); + return len; } #undef rest =20 --=20 2.53.0-Meta From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 9BCCA37C10A; Mon, 8 Jun 2026 16:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935900; cv=none; b=OJu/PQ+tcRxjRu2E+BjUsl3nEcxrev8mez5qrqyFUdVEl0nfi/L/llnmG3tK7Ay2QAefMnWBm7J2BZz9asg8FeqoA3mSCIAcH8kyDZE6hj+IwJSHN87z0qhO4a9vCp837/1eKK1M3mTZOs3T+jOKtBauCXrZlfXRFQvnjdfTTis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935900; c=relaxed/simple; bh=BXM/BFTpXoNCSM4CwFdmj+8+KMuxV3hQSRoT1Izhr7c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pBTO8CGxctIMxSgWBXLecfXTcKiY4z06NbK9wF7XaXh8j94S/otLC7I0x0nhE7EZ4VWK5a4w5mPJIf1FFggwg273ACljS24mi3aAZUsDLqajIw/JkTfhQBTRfr6R/W/8dEb0YBowbEJddtkyXNfGlMloQzlWd+GInN3rpfGRSqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=ClX++Bnm; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="ClX++Bnm" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=YgzIlvI5ADPZKpxArpAL5pQC0m+dtwWvGtJdhHuopts=; b=ClX++BnmfKd+m+fqtgk0iV5iqW dRxWT/cX4mbtX6KpCYj83rCosGS6BpIMJ+ev3NHTAgzEinQPz5BXNo+NAi35wZvOnzCcQDxetM3dP yKtJ6ZTey5LmLHkSljnrKnWz6x8cxdpSs7CMfKHCkxNwADny6uVlMCDiOgTRNKRxrmGb+2RO36NLQ HodnGLhXI/Cy2kv1jQmpyNtNYPvZoGtETI/aMSjid/BNfxq5WFZs1b1E+NokDgE/022O7UmIAAuKX zFzu2mzU2xecV1oK60skUrUN97/TZG/6I7kzDgTEpMSfy3RMMoT6QbtjSSzMbqx179MGmD/918LWg RHP/1Puw==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcmX-007kgR-1Y; Mon, 08 Jun 2026 16:24:57 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:23:59 -0700 Subject: [PATCH v3 2/6] bootconfig: render descendant keys when xbc_snprint_cmdline() root has a value Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-2-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2222; i=leitao@debian.org; h=from:subject:message-id; bh=BXM/BFTpXoNCSM4CwFdmj+8+KMuxV3hQSRoT1Izhr7c=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzKa68U1lMRfbsTQE3FbGEfTsLSSLEXIa7Af MuZF+fPDzKJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 bRy8D/9KlQx1Pb4wQOVHicCTNfYPZh8apApG6BcWdpBhIr2L33lGNzjUpQuUHK4Vm9KfD+CXOVA RIlv1ipVhWhYC3qu1kB34etCPt/9J8k3/7GrDz/5wIdJu2b+IsQxgJwMoca+0XO9zb0xNx2QdIm qLvooFICwjeBACSkotGF0Kc5zXIWr1x8i+to2n1BIFU6QLp3qWC7OHzyo35U/o/whjbFAjeC7+t V9OPNFdTF9ahu4K9Sffo3RhM1IJ0SnsOPCaDoRF6rxdOocIy4oqfT9txQeqyKzpEJv/4OGaE8hr MFuY8kNb/HROJpXk3b1GCff80GWd/mjvUWbBJjRIieAtqSyrmcyJB+MAYbQZ+0Fnm1EypRmkepq SunRsrLdZvXT67JDrGSPCwyi3KdU8jyrGj1S933ZbT8+yQZ9FRpXjiQJcSN4T+5pEeAW34no1vG WNp7tWVq98sVzRdat/umIixoyHwwA7gNVuNc+3H6SDdayhC0jeFN0/2uPlwlYW6g8+dUavyXhym 97aXEGzB60NCtvDchwr99j/rPgUjL/VtX0xRrV991d52ASu55JXdoFjrAP5DxFhLFCNfGtbMkfe Yjz+W7kh26HZmvfhUqSqoULC6+hlDstxKea8AJC7cH9/EwhXxIFtD179t/cPI3jdE2oGKFZblVT ZxwUfRa4M9ErOCA== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao xbc_node_for_each_key_value() walks to the first leaf under @root, and when @root is itself a leaf it yields @root. That happens not only for an empty "kernel {}" subtree, but also when @root carries both a value and subkeys, e.g. kernel =3D x kernel.foo =3D bar Here @root ("kernel") is a leaf because its first child is the value node "x", so the iterator returns @root first. Feeding @root back into xbc_node_compose_key_after(root, root) returns -EINVAL, which the only in-kernel caller papers over with a "len <=3D 0" check -- but the follow-up tools/bootconfig -C user propagates the error and turns such a bootconfig into a build failure. Worse, short-circuiting the whole call on a leaf @root would silently drop the valid "kernel.foo =3D bar" descendant that the pre-existing code rendered. Skip @root inside the loop instead of bailing out: the value-only entry is dropped (it is rendered through the "kernel" cmdline path, not here), while real descendant keys are still emitted. An entirely empty subtree now renders nothing and returns 0 rather than -EINVAL, matching the "nothing to render is not an error" semantics expected by the new build-time caller. Signed-off-by: Breno Leitao --- lib/bootconfig.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 2ed9ee3dc81c..926094d97397 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -440,6 +440,17 @@ int __init xbc_snprint_cmdline(char *buf, size_t size,= struct xbc_node *root) * itself is well defined and returns the would-be length. */ xbc_node_for_each_key_value(root, knode, val) { + /* + * An empty or value-only @root (e.g. "kernel {}" or + * "kernel =3D x", possibly alongside "kernel.foo =3D bar") + * yields @root itself here. Skip it: composing a key for it + * would fail with -EINVAL, yet any real descendant keys must + * still be rendered. An entirely empty subtree then renders + * nothing and returns 0 rather than an error. + */ + if (knode =3D=3D root) + continue; + ret =3D xbc_node_compose_key_after(root, knode, xbc_namebuf, XBC_KEYLEN_MAX); if (ret < 0) --=20 2.53.0-Meta From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 4A77034751E; Mon, 8 Jun 2026 16:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935906; cv=none; b=YbZ6SP43IfSJFN4w+zqS9F60ctHY6ONbrvu7302LKsIX1BWpG0lu70a3/omUOdVwhx14ydONkuVj4Mwn1mvOe2OsixKbMwC3tXJaHF4TBG7f3R9mL9AXMNhMq7wDlX8vo2PftW//CtfTEHuf33KsBd7ZHTz0jcjzVlCFuvOUGBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935906; c=relaxed/simple; bh=MU6J5H3Q1vhb3d0Ss6aXTnaEKSK0vAc5wrkWIcvM+MU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fBIgDrpA3O+9120SdiqdPIiePbJpVQsz5aFlSlRZvr+o8iukCaXh98SmrhZPF2arZ4zXR1WWHEJtBHSbdI8FDxQI2o7RMUzg0+fYAF1e6cmsuvSO81UQnOu0r5X9AoxLgjyxUiVb6Y1dhcjDOxQqVmK842toInbcXMmvMtPAz5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=v3ixqfCI; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="v3ixqfCI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=+6lERUPhyBADlBsNl9KJQp5WXB9b4FBLPa74x6Ankz8=; b=v3ixqfCIX6cdL/fwENxHZ03Ea0 r60G+dlwbz+qpqK5rBzcJksb2r5purEHTcVW+PEmleO8Y1eCjmR8CW7Jy20Jje1jPjL61GPN1zYwH ZaAWPVpEFK4sYiYI0oSGp30/zawomDHG7EszBpzIPwrghvdE/ya7f1SRjeEfO8MLpuwJ30rSlhLUu llLFE4tf6o/g9Pv4T0yNCIO6cuEy5d1EAK+BrVuyzCdrgb5TavkwGHgQtZXQanKLfNZjidnEMhWvi ohJwtI2APoKI6rTB9xirdf9JIPzHjo86BxTLCTWJYa2HuBhnacMh37nz84IjaIoOavabIhFQ6Y1/J gfDrLvBw==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcmc-007khh-0j; Mon, 08 Jun 2026 16:25:02 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:24:00 -0700 Subject: [PATCH v3 3/6] bootconfig: render embedded bootconfig as a kernel cmdline at build time Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-3-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8689; i=leitao@debian.org; h=from:subject:message-id; bh=MU6J5H3Q1vhb3d0Ss6aXTnaEKSK0vAc5wrkWIcvM+MU=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzKIqO09awufHCbX6CbLFCDoAG00hNKOViVd luClyOFbKqJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 ba6VD/91mDThbc0AykRBZkf7FlV0A8yjYit/hEkMcy3nWs3fjlQAVPwaKRJf3ud6eEGYMtf+5ph eAX12ezpwBmLSt+pVti89/twZoH8vqxxkc3r25PinTSJj/094eAw1q/L1j6pRW7Y6vUR5Tgf0Jt n0wgnctmPjPoxGhrHuDcWvL4xp9/SVEUg29zQOe70ZCVd5Ij8eHwbg1bL2F5A+yee6inlJAKVGY 9WWI0pdAlL+z2SUjS62XIK8rhZ673PCK1IWwLmpMrW9oem5HjbH1EtxKNzuUXzmoYS12WQL07Wq qGicX/ax54bBSggUmeOQQk5O/ozdaTKm411+mDGnxioQI8kyFy1FF7A+ooNVd+d3v2xEv98lw2U e/3hxwKBBGPuaKHj+w9waTPocm20DuJ/o+4tRbVu1/Oj5BuKRF0XdYh5VFsAgZhWoU+JvvGjEW4 Ne6wI2Lml6CrcxYr33fs644Y6KDVZfRogqFVcOSr4lCN/aRF77nFWPBcaxbfTUu7pFgUiY7r/3z x6UAt0K5FgDFkHjx2l7ORler1vzGzP5wIBh5PtIkEMywgzKt3lyRI8xheUL0SX1DyPFztHhl8Sc xugIXQng1GZ277HDJnNH329WlVCdU3EmnRaI9uXd52vSQHUoQualyIp1913bk2txe6ve7+F4cVU Fl/Ucl2SXjyrPSg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Add the build-time pipeline that renders the "kernel" subtree of CONFIG_BOOT_CONFIG_EMBED_FILE into a flat cmdline string and stashes it in .init.rodata as embedded_kernel_cmdline[]. A follow-up patch adds the runtime helper that prepends this string to boot_command_line during early architecture setup so parse_early_param() sees the values. The build wires up: tools/bootconfig -C kernel - userspace tool already shared with lib/bootconfig.c, used here in -C mode to render a bootconfig file to a cmdline lib/embedded-cmdline.S - .incbin's the rendered text plus a NUL (listed under the EXTRA BOOT CONFIG MAINTAINERS entry) lib/Makefile rule - runs tools/bootconfig at build time Makefile prepare dep - ensures tools/bootconfig is built first, same pattern as tools/objtool and tools/bpf/resolve_btfids Drop the test target from tools/bootconfig/Makefile's default 'all' recipe so that hooking the binary into the kernel build does not run test-bootconfig.sh on every prepare. The tests stay available as 'make -C tools/bootconfig test', matching the convention of tools/objtool and tools/bpf/resolve_btfids whose 'all' targets only build the binary. Require BOOT_CONFIG_EMBED_FILE to be non-empty before the new option can be enabled, otherwise tools/bootconfig -C runs against an empty file and prints a parse error on every kernel build. The feature gates on CONFIG_ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG, a silent symbol arches select once they've wired the prepend call into setup_arch(). No arch selects it in this patch, so the user-visible CONFIG_BOOT_CONFIG_EMBED_CMDLINE is not yet enableable; when an arch later opts in, the runtime behavior is added by the follow-up patches. tools/bootconfig also installs on target systems, so its own Makefile keeps $(CC) and stays cross-buildable as a standalone tool. The kernel build, which runs the tool on the build host during prepare, instead forces CC=3D$(HOSTCC) from a dedicated tools/bootconfig rule, so the executed binary is always a host binary -- plain $(CC) would cross-compile it under ARCH=3D... and fail to exec ("Exec format error"). embedded-cmdline.S places the rendered string in .init.rodata with the "a" (allocatable, read-only) flag and %progbits, not "aw": the data is never written at runtime, so it must not land in a writable section. A follow-up patch wires the build-time tools/bootconfig into the top-level clean target. Signed-off-by: Breno Leitao --- MAINTAINERS | 1 + Makefile | 11 +++++++++++ init/Kconfig | 36 ++++++++++++++++++++++++++++++++++++ lib/Makefile | 16 ++++++++++++++++ lib/embedded-cmdline.S | 16 ++++++++++++++++ tools/bootconfig/Makefile | 2 +- 6 files changed, 81 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4087b67bbc69..fb9314cbe344 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9845,6 +9845,7 @@ F: fs/proc/bootconfig.c F: include/linux/bootconfig.h F: lib/bootconfig-data.S F: lib/bootconfig.c +F: lib/embedded-cmdline.S F: tools/bootconfig/* F: tools/bootconfig/scripts/* =20 diff --git a/Makefile b/Makefile index d59f703f9797..4a8ea7c90ca8 100644 --- a/Makefile +++ b/Makefile @@ -1543,6 +1543,17 @@ prepare: tools/bpf/resolve_btfids endif endif =20 +# tools/bootconfig renders the embedded bootconfig into a cmdline at build= time. +ifdef CONFIG_BOOT_CONFIG_EMBED_CMDLINE +prepare: tools/bootconfig +endif + +# tools/bootconfig is run on the build host during prepare, so force a host +# binary here; its own Makefile keeps $(CC) for standalone and cross build= s. +tools/bootconfig: FORCE + $(Q)mkdir -p $(objtree)/tools + $(Q)$(MAKE) O=3D$(abspath $(objtree)) subdir=3Dtools -C $(srctree)/tools/= bootconfig CC=3D$(HOSTCC) + # The tools build system is not a part of Kbuild and tends to introduce # its own unique issues. If you need to integrate a new tool into Kbuild, # please consider locating that tool outside the tools/ tree and using the diff --git a/init/Kconfig b/init/Kconfig index ca35184532dc..203b1187fde7 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1569,6 +1569,42 @@ config BOOT_CONFIG_EMBED_FILE This bootconfig will be used if there is no initrd or no other bootconfig in the initrd. =20 +config ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG + bool + help + Silent symbol; no C code reads it directly. Architectures + select it once their setup_arch() calls + xbc_prepend_embedded_cmdline() before parse_early_param(). + Its only role is to gate the user-visible + BOOT_CONFIG_EMBED_CMDLINE option per-arch, the same + ARCH_SUPPORTS_* idiom used by ARCH_SUPPORTS_CFI, etc. + +config BOOT_CONFIG_EMBED_CMDLINE + bool "Render embedded bootconfig as kernel cmdline at build time" + depends on BOOT_CONFIG_EMBED + depends on BOOT_CONFIG_EMBED_FILE !=3D "" + depends on ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG + default n + help + Render the "kernel" subtree of the embedded bootconfig file into a + flat cmdline string at kernel build time and prepend it to + boot_command_line during early architecture setup. This makes + early_param() handlers (e.g. mem=3D, earlycon=3D, loglevel=3D) see the + values supplied via the embedded bootconfig. + + The runtime bootconfig parser is unaffected, so tree-structured + consumers such as ftrace boot-time tracing keep working. + + Note: when an initrd also carries a bootconfig, its "kernel" + subtree is still parsed at runtime, but the embedded "kernel" + keys remain in boot_command_line for parse_early_param() and + end up later than the initrd keys in saved_command_line, so + parse_args() last-wins favors the embedded values. If you need + initrd to override embedded kernel.* keys, leave this option + off. + + If unsure, say N. + config CMDLINE_LOG_WRAP_IDEAL_LEN int "Length to try to wrap the cmdline when logged at boot" default 1021 diff --git a/lib/Makefile b/lib/Makefile index 6e72d2c1cce7..9de0ac7732a2 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -273,6 +273,22 @@ filechk_defbconf =3D cat $(or $(real-prereqs), /dev/nu= ll) $(obj)/default.bconf: $(CONFIG_BOOT_CONFIG_EMBED_FILE) FORCE $(call filechk,defbconf) =20 +obj-$(CONFIG_BOOT_CONFIG_EMBED_CMDLINE) +=3D embedded-cmdline.o +$(obj)/embedded-cmdline.o: $(obj)/embedded_cmdline.bin + +# Render the bootconfig "kernel" subtree to a flat cmdline string using +# the userspace tools/bootconfig parser (-C mode). The runtime prepend +# helper enforces COMMAND_LINE_SIZE at boot, so no build-time size +# check is performed here (COMMAND_LINE_SIZE is an arch header +# constant, not a Kconfig value). +quiet_cmd_render_cmdline =3D BCONF2C $@ + cmd_render_cmdline =3D \ + $(objtree)/tools/bootconfig/bootconfig -C $< > $@ + +targets +=3D embedded_cmdline.bin +$(obj)/embedded_cmdline.bin: $(obj)/default.bconf $(objtree)/tools/bootcon= fig/bootconfig FORCE + $(call if_changed,render_cmdline) + obj-$(CONFIG_RBTREE_TEST) +=3D rbtree_test.o obj-$(CONFIG_INTERVAL_TREE_TEST) +=3D interval_tree_test.o =20 diff --git a/lib/embedded-cmdline.S b/lib/embedded-cmdline.S new file mode 100644 index 000000000000..740d7ad2dc01 --- /dev/null +++ b/lib/embedded-cmdline.S @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Embed the build-time-rendered bootconfig "kernel" subtree as a flat + * cmdline string. setup_arch() prepends this to boot_command_line on + * architectures that select ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG. + * + * Copyright (c) 2026 Meta Platforms, Inc. and affiliates + * Copyright (c) 2026 Breno Leitao + */ + .section .init.rodata, "a", %progbits + .global embedded_kernel_cmdline +embedded_kernel_cmdline: + .incbin "lib/embedded_cmdline.bin" + .byte 0 + .global embedded_kernel_cmdline_end +embedded_kernel_cmdline_end: diff --git a/tools/bootconfig/Makefile b/tools/bootconfig/Makefile index 90eb47c9d8de..4e82fd9553cd 100644 --- a/tools/bootconfig/Makefile +++ b/tools/bootconfig/Makefile @@ -15,7 +15,7 @@ override CFLAGS +=3D -Wall -g -I$(CURDIR)/include ALL_TARGETS :=3D bootconfig ALL_PROGRAMS :=3D $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) =20 -all: $(ALL_PROGRAMS) test +all: $(ALL_PROGRAMS) =20 $(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC) $(CC) $(filter %.c,$^) $(CFLAGS) $(LDFLAGS) -o $@ --=20 2.53.0-Meta From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 446423D0C12; Mon, 8 Jun 2026 16:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935910; cv=none; b=KTwSEUsESarQb/UKXikGv9HX/d1R/G2VbbB7z1bM3phZe/3XWAEbNHgbrq5pAt1KV9n+fblVSo9SJui719FCzvImkRpkpNkxba1gVVUUXp7jrt09QTTgagc4ZkiQ3EMWDJkzPp3EzfdM8Oe8aSoCLsF/4eM4MnqjTXT7CabSQt0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935910; c=relaxed/simple; bh=GMzLUVeFWLZ40gLjsC/rM3teKcgu7q4GmDJjjIZVOFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dXJKl2kW8ITrxQlZ2WGs0lC72/SPbdGzLCF2htXJNM97+5djzbB0eogHdv4fNPqnbYWxLMcUyUthGGp3qlCD/H6hCFOrDaMmWR7bIiLzx0I+ucIdmrbL13So2ZEPKJOuJiP9zH1yHL2NKMDTgL8h+y421w1mIKFXg8oyiudI3VM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=oRtlOgJ1; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="oRtlOgJ1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=1VTmtkqW0s7kqQ+7QybZTdloVtK/A2fFw2RLZnID1Po=; b=oRtlOgJ1O+CEks+uYPTqaQiQoX x/hV3LZi6rGBE2tkIBQ02j4ZVRDXwqYLNNId7gIwZw2JHqGJ71RCtxcndDxEyYGr78w2dCw6UvFvR DG8UE1WGBLrZGP1ZdptzJaTaRPuS+Lnk55RwkZKPOnOcTj3/PNfLhL5lW5PfnpiXWdgKNtqxrGzMY Wwg987fcYfCbCUOGJSuCxnFREjPDNXXK22rBtna2sH/s3BcbuhBERZU3aefzL8jemjUjzOM18D/bz wdVQ74CuWA0YVRgBD7KnHJ1mHqXECA6nIMGf2LCAB2CPYFhh/P/gmVcCo/M3OXCNDbqowXv0/C70v LNg3CvLA==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcmh-007kju-07; Mon, 08 Jun 2026 16:25:07 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:24:01 -0700 Subject: [PATCH v3 4/6] bootconfig: clean build-time tools/bootconfig from make clean Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-4-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2499; i=leitao@debian.org; h=from:subject:message-id; bh=GMzLUVeFWLZ40gLjsC/rM3teKcgu7q4GmDJjjIZVOFI=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzKbFe7kxY68ror44/Je5dPkbLpIQOlRNDDI lgj4yO//5CJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 bXvKD/9d93blN4VEaye9+U5l3xgtO/6U6M11x1WjRT+2HrHJqVCldp312tpHqPBapkPLfe+2zAO 9KlkV9gCy9SGmTIWJD8CEusHglmxUwYisfApsAkVVI1+E4Mw1ZStFQfC0c36P9ipV8R/8/NG155 CZVv2p71AzN9wIS7I01+TsHn7TiavMN+OQ8Tmnv+7gWz71QYDMoc5X1EySHgb870H20f+QY7bzO 3UmLMB/PVeL8im/Yc/iqW7iEdbQ3g7XkSbFDNhHXwBKJJUMc+6J3NFUEDbxYKXVc1TB0M8ilbY2 EqDqKkBgdfdszXCdP/hPXoWek3RmpQM9y47MByVjx+v+wxOaBBvcaKLygxWSV2COMuHMxQwmBQY SMd7lTe2/LJri7Xvh5P6KCgIJydyXOWPylcRzRMnE9C0O4rBDw0BmyNmABkjXgPy4VeuJgo9ECb Cb4t7IhniJZ//UOc97vePWydL+UhZ1VuXkys094zgkTsujKk/m539jvTYbXSk7fkfi3WuZrcPej 1+UfZDGgG6DqrlO6w9sYzZQlu+Vjh80UK4OLm7i/LZsHgeqiXtUjg1GunGDe5aux/uNWQa0I8pn NEHbSkq5y/pIA8RO/zKh37vUzuU5SoQ9sY/Km5HY1R8eDUENr9UIzxVdxhqDFSqG4vbTCTT2/Lb ytcpc4asSVlK56Q== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The previous patch builds tools/bootconfig during 'make prepare' to render the embedded bootconfig cmdline, but nothing removes it on 'make clean', leaving the compiled tool and its objects behind. Wire a bootconfig_clean hook into the top-level clean target so the compiled tool and its objects are removed by make clean, matching the prepare-wired tools/objtool and tools/bpf/resolve_btfids. The hook runs tools/bootconfig's Makefile via $(MAKE), which the kernel build invokes with -rR (MAKEFLAGS +=3D -rR). -rR drops the built-in $(RM) variable, so the existing "$(RM) -f ..." clean recipe would expand to a bare "-f ..." and fail. Spell the recipe with a literal "rm -f" so it keeps working both standalone and when invoked from Kbuild. Signed-off-by: Breno Leitao --- Makefile | 13 ++++++++++++- tools/bootconfig/Makefile | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4a8ea7c90ca8..84ca047f0c10 100644 --- a/Makefile +++ b/Makefile @@ -1580,6 +1580,17 @@ ifneq ($(wildcard $(objtool_O)),) $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=3D$(objtool_O) srctree=3D$= (abs_srctree) $(patsubst objtool_%,%,$@) endif =20 +PHONY +=3D bootconfig_clean + +bootconfig_O =3D $(abspath $(objtree))/tools/bootconfig + +# tools/bootconfig is only built (via the prepare hook above) when +# CONFIG_BOOT_CONFIG_EMBED_CMDLINE is set; skip its clean otherwise. +bootconfig_clean: +ifneq ($(wildcard $(bootconfig_O)),) + $(Q)$(MAKE) -sC $(srctree)/tools/bootconfig O=3D$(bootconfig_O) clean +endif + tools/: FORCE $(Q)mkdir -p $(objtree)/tools $(Q)$(MAKE) O=3D$(abspath $(objtree)) subdir=3Dtools -C $(srctree)/tools/ @@ -1749,7 +1760,7 @@ vmlinuxclean: $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean) =20 -clean: archclean vmlinuxclean resolve_btfids_clean objtool_clean +clean: archclean vmlinuxclean resolve_btfids_clean objtool_clean bootconfi= g_clean =20 # mrproper - Delete all generated files, including .config # diff --git a/tools/bootconfig/Makefile b/tools/bootconfig/Makefile index 4e82fd9553cd..3cb8066d5141 100644 --- a/tools/bootconfig/Makefile +++ b/tools/bootconfig/Makefile @@ -27,4 +27,4 @@ install: $(ALL_PROGRAMS) install $(OUTPUT)bootconfig $(DESTDIR)$(bindir) =20 clean: - $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS) + rm -f $(OUTPUT)*.o $(ALL_PROGRAMS) --=20 2.53.0-Meta From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 050CD3BFE34; Mon, 8 Jun 2026 16:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935915; cv=none; b=htXcez8yMdIQIn9oo+vmvifcvP+TwGse75d3Njye36SH2wzPR/wOzHu9vk4Czh8CsIoAXRuYxUiIKv8oQLgjjtZJ1CK/+jo0RyKbr5JyoIx4f/k9u4zYy++wIScccdDmfyKZ1Gf1j6p4L+kXhh9hEGiuHaWmL7vOJ5cxB7NxmF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935915; c=relaxed/simple; bh=HphAVP8d1EmlWPiq3Xm6Fy1H9xBvQSlS+8N330xZBQs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dVqgrY6Pcp8+w7B39Knxkm51TEFXJUPJInKEQ8neUQtv+9Lq3N6lLQl6c371DjVCRZK7xHLXCt8/yYqYq1ELZeohy7KxzhJ1LoTwYY3VIH4+FaAAi1+qMRUOcVpkbsJTdtOS0mLYuxr78iMoVOQn31ljNLAyFdoeEhEKprVTNbU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=PZaIuFlm; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="PZaIuFlm" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=76ZX8FMuSby1II008hNX9DM5CqfyvtNrG2xvmlC+9pU=; b=PZaIuFlmEx5nP8nAsMih1m0Pgu la7rhBT+qq24M8xVqpnnbbKJ1Ln5cppo5IjcfMUwquGS6R+hPxZdu50ZtMU6JXqQx5i7TQmLeBcrC abT1sEfIEhYKAOrkcfv7US8yU79Kg8P/SOxEF7jKZfujiaerPv0vtKzNsWnT/Oh1pOEibRdzqeDzm AnQ/mVX99oa9bVasSmMr6Czht7gcCBWvT1twFashOxEi6yTao/M5+T88lg3WntlZijsIu8AAiNw+X 5e+b81Y/lg+r3yrbIHZz8imTd2YfyGUeLNRaVA9Sj4vg/f2wlTvBstkQ8d8Cjj243T0QDBfo0uz8w cTtx/FJw==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcml-007kk9-2h; Mon, 08 Jun 2026 16:25:12 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:24:02 -0700 Subject: [PATCH v3 5/6] bootconfig: add xbc_prepend_embedded_cmdline() helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-5-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5585; i=leitao@debian.org; h=from:subject:message-id; bh=HphAVP8d1EmlWPiq3Xm6Fy1H9xBvQSlS+8N330xZBQs=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzK10c7DZ0XI10AnC5xdb7i/1xWBj2zVz6Tu KsnNgku/sOJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 bbbfEACSFcbI/bagdsqbASrDjrn969hjA6NLURUPqFAWRPz1agcqIHFUhpP28n+xfu5PNgGpOsH 0N7ioYfdNHfoZcemJqMPB+jOxP+2cNQlE740neq6/wjm28wyfTBY4uyFbIIwO7iX5hoEq+iO8sj RwZsKu2JWf0Y2Mye7huOCbW72+FFs1NiHV/vXauFEv+6MdNY58zK2fJl28inWyQ7BhaI/R2c7qy T5N8pspuOXEJwJqP+yOwMei0KQ02g6slh+n4GgyeQpc9XVxyLC9jn50qZFvBvY1leKjoRggDlbE PpxGhMaVX7F3GTaRWcPJBlEojb2ul/JIlWmCPT5rfMNG0F+9MWgK721JQWOivPZz6vLwmNAN7P3 +aeL/EF6k9Hr7BeiLGPk2ZwnM0x9zFeKqpU77PQmGk1cCkOYaXNfsLrZ5xopdX6w91xNBa1fs+6 xHNrph/m7U7mUXnsUJTympfk+EgNAUJUGyTZF6rTRH3laOa+mk/nlBKZvjREniP+YW7FjdzxVJt eFKbUO4o/E2CU6RQfYMNNiwoNQ8YWzGZc1EZANSlMj5cm/RcHLujUcy4t4yUHXITJGKELbTlI82 1hI4emZ4K5EyQaxMEnlBeW9Skjp7rF4nqPsh8qMBTWP7/rAxJtWk3UbdxuwmV/ruH6/PJUgWBvM VY1EALIy0qGfwGg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Add a helper that prepends the build-time-rendered embedded bootconfig "kernel" subtree (embedded_kernel_cmdline[] from embedded-cmdline.S) to a cmdline buffer with a separating space. Architectures call this from setup_arch() before parse_early_param() so early_param() handlers (mem=3D, earlycon=3D, loglevel=3D, ...) see values supplied via the embedded bootconfig. The in-place prepend (shift the existing string right, then drop the embedded string in front) is factored into a small str_prepend() helper. On overflow the helper logs an error and leaves the cmdline untouched rather than panicking. Booting without the embedded values is better than refusing to boot, and the error tells the user why their embedded keys are missing. The helper records whether it actually prepended, exposed via xbc_embedded_cmdline_applied(). setup_boot_config() uses this to decide whether the runtime "kernel" render would duplicate keys already folded into boot_command_line. When CONFIG_BOOT_CONFIG_EMBED_CMDLINE=3Dn, the public declaration in resolves to a no-op stub so callers compile unchanged. Signed-off-by: Breno Leitao --- include/linux/bootconfig.h | 9 ++++++ lib/bootconfig.c | 78 ++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 87 insertions(+) diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h index 1c7f3b74ffcf..c186137f87ac 100644 --- a/include/linux/bootconfig.h +++ b/include/linux/bootconfig.h @@ -308,4 +308,13 @@ static inline const char *xbc_get_embedded_bootconfig(= size_t *size) } #endif =20 +/* Build-time-rendered bootconfig cmdline prepended in setup_arch() */ +#ifdef CONFIG_BOOT_CONFIG_EMBED_CMDLINE +void __init xbc_prepend_embedded_cmdline(char *dst, size_t size); +bool __init xbc_embedded_cmdline_applied(void); +#else +static inline void xbc_prepend_embedded_cmdline(char *dst, size_t size) { } +static inline bool xbc_embedded_cmdline_applied(void) { return false; } +#endif + #endif diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 926094d97397..f66be0b2dc24 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,83 @@ const char * __init xbc_get_embedded_bootconfig(size_t *= size) return (*size) ? embedded_bootconfig_data : NULL; } #endif + +#ifdef CONFIG_BOOT_CONFIG_EMBED_CMDLINE +/* embedded_kernel_cmdline is defined in embedded-cmdline.S */ +extern __visible const char embedded_kernel_cmdline[]; +extern __visible const char embedded_kernel_cmdline_end[]; + +/* Set once the embedded cmdline has actually been prepended. */ +static bool xbc_cmdline_applied __initdata; + +/* + * str_prepend() - Prepend @src in front of the string in @dst, in place + * @dst: NUL-terminated destination buffer, currently @dst_len bytes long + * @dst_len: length of the current @dst string (excluding its NUL) + * @src: bytes to prepend (not NUL-terminated) + * @src_len: number of bytes from @src to prepend + * + * The caller must guarantee @dst has room for src_len + dst_len + 1 bytes. + * Moving dst_len + 1 bytes carries @dst's NUL terminator too, so an empty + * @dst needs no special case. + */ +static void __init str_prepend(char *dst, size_t dst_len, + const char *src, size_t src_len) +{ + memmove(dst + src_len, dst, dst_len + 1); + memcpy(dst, src, src_len); +} + +/** + * xbc_prepend_embedded_cmdline() - Prepend embedded bootconfig cmdline + * @dst: cmdline buffer to prepend into (must already contain a NUL byte) + * @size: total capacity of @dst in bytes + * + * Prepend the build-time-rendered "kernel" subtree of the embedded + * bootconfig to @dst. The rendered string already ends with a single + * space (the xbc_snprint_cmdline() invariant), which serves as the + * separator between the embedded keys and any existing content of @dst. + * On overflow, log an error and leave @dst untouched rather than + * silently truncating: booting without the embedded values is better + * than refusing to boot, and the error message tells the user why + * their embedded keys are missing. + * + * Intended to be called from setup_arch() before parse_early_param() so + * that early_param() handlers see the embedded values. + */ +void __init xbc_prepend_embedded_cmdline(char *dst, size_t size) +{ + size_t embed_len =3D embedded_kernel_cmdline_end - embedded_kernel_cmdlin= e; + size_t dst_len; + + if (!size || embed_len <=3D 1) /* trailing NUL only */ + return; + embed_len--; /* exclude trailing NUL byte */ + + dst_len =3D strnlen(dst, size); + if (embed_len + dst_len + 1 > size) { + pr_err("embedded bootconfig cmdline (%zu bytes) does not fit in COMMAND_= LINE_SIZE with %zu bytes already used; ignoring embedded values\n", + embed_len, dst_len); + return; + } + + str_prepend(dst, dst_len, embedded_kernel_cmdline, embed_len); + xbc_cmdline_applied =3D true; +} + +/** + * xbc_embedded_cmdline_applied() - Did the embedded cmdline get prepended? + * + * Return true if xbc_prepend_embedded_cmdline() actually prepended the + * embedded "kernel" subtree. setup_boot_config() uses this to avoid + * rendering the same keys a second time. + */ +bool __init xbc_embedded_cmdline_applied(void) +{ + return xbc_cmdline_applied; +} +#endif + #endif =20 /* --=20 2.53.0-Meta From nobody Mon Jun 8 18:55:59 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 080253CAE74; Mon, 8 Jun 2026 16:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935920; cv=none; b=Ucz2vL9ZYWk0vJcU9TlC6CtL+unOWWWoLwqxuyHVlvSvahz0PVTA5AXRKmjBfxERhplH2L0j+E0Xv5xq/Dcni5PHFs6DNYuTKh236x8zsv4OusGg99iLwPsK21AUkQ5zVQYmFObla/aMmqIvhj0enRTxyEUk+npr9a0YLIHApLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935920; c=relaxed/simple; bh=QPhqsebsO3HMrGMEDz9OVg+K2hivuE3EfkbyqQu5hD8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KfzjfgIG4UxAOA5NKdySohaV5cLMfRSd67Oe+kSn138N3ia4axKAYW49yqBtm1gaNIcXOA/vvmtTWW8Ja9nHAHT83YHmP1guKftMCjX+D2f/a7P55krc8w3TPsBdUp8UC2AkkDHu1GgfcwhPK0ztv01OHox+lD4/Er7TnkPoQS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=Y57GJxVy; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="Y57GJxVy" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=k3Cl903UI3FDV6LUKk48+poCJ8NTaQVxa7IZmgH5xJo=; b=Y57GJxVy0Z/3PZerkPoYPQ/glg 3m+yPuxaSBUbeyEdegfqNviDIUfRupRmv8T9OsnFh3gK6AZeuHPcbmOhp5IboKcZS6bl5AwpngRaj SvmHzwxkq43HVzxulK3PuAArB9/Qyx7Go8jhGcwbSTY1sMA5iUjvj4Fo5Ybo9ytYLrIfriuv0MuoT AVI3OJlF0st2BuTcgbwXAvOQI/ZSIqWj207vwC6ov6uxMimRm+SMGwSf89AYBZzc/TPN9OZZMap61 V3efzaWoTbY2Uv8FlbW0Xlczic8i5FG9xK5Ou1lmkk1E0/7udx4txJbppllhNH5vm2+gBN4WSa75r r13yHgsg==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wWcmq-007kkS-1k; Mon, 08 Jun 2026 16:25:16 +0000 From: Breno Leitao Date: Mon, 08 Jun 2026 09:24:03 -0700 Subject: [PATCH v3 6/6] x86/setup: prepend embedded bootconfig cmdline before parse_early_param Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-bootconfig_using_tools-v3-6-4ddd079a0696@debian.org> References: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> In-Reply-To: <20260608-bootconfig_using_tools-v3-0-4ddd079a0696@debian.org> To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4701; i=leitao@debian.org; h=from:subject:message-id; bh=QPhqsebsO3HMrGMEDz9OVg+K2hivuE3EfkbyqQu5hD8=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqJuzKQzotX3VnuQ3pkChLcKjYqne9Rkk/Fise6 5L2G8PWUCCJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaibsygAKCRA1o5Of/Hh3 baulD/4ntC/2wFrwFoTpj+Ekd46/woo3jQHZ2cN4TKhCNemATLVEhbN5SJyc0kVJrGnp2cQ0aYD A07hhnikjrrdJGToNvsxR1O5AzbJG7gWPf23sREIpzPIkOmO98Xr1cMQdhRvJf4rXmetHBtQ0zP W6NeMkBAV3/82ZRRu/HxubNvmE8mQdCInbc3a/3gVYhzbUO2pSIeB53mT8plF5N2q4gO9lvSNd5 7qGQXgLZkMUyzxZeSCn3xZNEFia4mCRseBMdQ7FX5qpJ2+uQcY/sS8thvFk6PCQK5qsJXMKOoHq 03w3fyPdgSOhq9jSCOKklGbv9l8uuuKqyp1zKYqSy3mZv6IuuYXJsPstwGv/4X/wI5NEJ0UHdUr J+gTdMv+lWRZ3BeFLi+RpD68c14bh2xNrVu6BUlcztBTCLv8IYJycewKhs2CDsUSeMrsVRmXJCz 5lIr6LqfQ8JPa6PQs9bMiyLsJEN4EGn1FO5438Gykb0eqV5lY7FRt+A7Vr/OGZ9rzX/no2dCs3n Oaho0VwF3GhTx2B5GFmynW3T0iCEYPgfleYV29orNpJqlz4CZZtU3WwWtAg48LMMmKILhlN94fK faZA4exkX66neesJe9o3g6rm528KCiKHTJcdHq8nicVl1YM/SrOZISddtuDeL7zUhz8GfHUOwQl FK4oqOCzEFaKtNg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Call xbc_prepend_embedded_cmdline() in setup_arch() right after the CONFIG_CMDLINE merge and before strscpy(command_line, ...) so the build-time-rendered embedded bootconfig "kernel" subtree is part of boot_command_line by the time parse_early_param() runs. early_param() handlers (mem=3D, earlycon=3D, loglevel=3D, ...) now see values supplied via CONFIG_BOOT_CONFIG_EMBED_FILE without parsing bootconfig at runtime. Signed-off-by: Breno Leitao --- arch/x86/Kconfig | 1 + arch/x86/kernel/setup.c | 16 ++++++++++++++++ init/main.c | 25 ++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f24810015234..f839795692b4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -126,6 +126,7 @@ config X86 select ARCH_SUPPORTS_NUMA_BALANCING if X86_64 select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP if NR_CPUS <=3D 4096 select ARCH_SUPPORTS_CFI if X86_64 + select ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG select ARCH_USES_CFI_TRAPS if X86_64 && CFI select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 46882ce79c3a..003f8651db6c 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -6,6 +6,7 @@ * parts of early kernel initialization. */ #include +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -924,6 +926,20 @@ void __init setup_arch(char **cmdline_p) builtin_cmdline_added =3D true; #endif =20 + /* + * Match the runtime bootconfig parser's opt-in: only fold the + * embedded kernel.* keys into the cmdline when "bootconfig" is + * present on the command line, or CONFIG_BOOT_CONFIG_FORCE is set. + * setup_boot_config() bails out under the same condition, so the + * early prepend stays in lockstep with what the late runtime parser + * would have applied. CONFIG_BOOT_CONFIG_FORCE defaults to y when + * BOOT_CONFIG_EMBED is set, so on the default config the embedded + * keys are applied unconditionally. + */ + if (IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE) || + cmdline_find_option_bool(boot_command_line, "bootconfig")) + xbc_prepend_embedded_cmdline(boot_command_line, COMMAND_LINE_SIZE); + strscpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p =3D command_line; =20 diff --git a/init/main.c b/init/main.c index e363232b428b..2ecb6aa536dd 100644 --- a/init/main.c +++ b/init/main.c @@ -378,12 +378,15 @@ static void __init setup_boot_config(void) int pos, ret; size_t size; char *err; + bool from_embedded =3D false; =20 /* Cut out the bootconfig data even if we have no bootconfig option */ data =3D get_boot_config_from_initrd(&size); /* If there is no bootconfig in initrd, try embedded one. */ - if (!data) + if (!data) { data =3D xbc_get_embedded_bootconfig(&size); + from_embedded =3D true; + } =20 strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE); err =3D parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL, @@ -421,8 +424,24 @@ static void __init setup_boot_config(void) } else { xbc_get_info(&ret, NULL); pr_info("Load bootconfig: %ld bytes %d nodes\n", (long)size, ret); - /* keys starting with "kernel." are passed via cmdline */ - extra_command_line =3D xbc_make_cmdline("kernel"); + /* + * keys starting with "kernel." are passed via cmdline. When + * this bootconfig came from the embedded source and + * setup_arch() already prepended the rendered "kernel" subtree + * to boot_command_line, rendering again here would duplicate + * the keys in saved_command_line and make accumulating handlers + * (console=3D, earlycon=3D, ...) re-register the same value. Skip + * only when the prepend really happened. + * + * On arches that do not select ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG, + * CONFIG_BOOT_CONFIG_EMBED_CMDLINE is unselectable and + * xbc_embedded_cmdline_applied() collapses to a stub returning + * false, so this path still runs and the embedded "kernel" + * keys reach the cmdline via the runtime parser exactly as + * before this series. + */ + if (!from_embedded || !xbc_embedded_cmdline_applied()) + extra_command_line =3D xbc_make_cmdline("kernel"); /* Also, "init." keys are init arguments */ extra_init_args =3D xbc_make_cmdline("init"); } --=20 2.53.0-Meta