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 378B33BE657; Mon, 23 Mar 2026 16:27:18 +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=1774283239; cv=none; b=ERFLvAcPqYmckiEm2/+vR+f3JrfoP3Pue2RoZ8v/EzbGWNHwZUFoX27I6OZYRJLtg2ffSY5vjtxDWQy2A/zuuZxv3Fx0NIXOuWlVtt5Xj7AkLyjmDaDCibMsDUvK5BsfND6Lnv3QAErzW4rSp517Y3Urrzbeij8/V2wOb52PO+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283239; c=relaxed/simple; bh=aEeapLI7HYCKoZ0Bp8qsuoL9GxFGPud2JYYLVN6WR9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ze4BuLY10xisS8h0L+YbBzRkxNwZWTfooDKLRlzjV1eJcpHVsb8szMSy2yNyK9izwM03PnDShETgjKCzMNWlUbz4pKrC0e4TPeMUnej4wK4bDQsu1QClv8Ym4yy99e3JGSifxGo/c0VRIhLIU6YUTATzjeAj0EP4UXCqdhRo2pg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q7sLWULG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q7sLWULG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8487AC2BCB0; Mon, 23 Mar 2026 16:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774283238; bh=aEeapLI7HYCKoZ0Bp8qsuoL9GxFGPud2JYYLVN6WR9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q7sLWULGlPz6l26Si6NmIlzf8mRvXysMN08tJ19hPtJWei7XLdlk2tICxRzLJU/vD HdX87xeBn7ILr3ogcAZLK1J9WlAKvYmO+MVtogOthJdchSpHmv8ZK27EJzZDcIrBhs nxKckA6KOLtKYj81GAAgR2xv4M57ZRfe0q/HFYKo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Josh Law , "Masami Hiramatsu (Google)" , Sasha Levin Subject: [PATCH 6.1 452/481] lib/bootconfig: check xbc_init_node() return in override path Date: Mon, 23 Mar 2026 14:47:14 +0100 Message-ID: <20260323134536.229488955@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Law [ Upstream commit bb288d7d869e86d382f35a0e26242c5ccb05ca82 ] The ':=' override path in xbc_parse_kv() calls xbc_init_node() to re-initialize an existing value node but does not check the return value. If xbc_init_node() fails (data offset out of range), parsing silently continues with stale node data. Add the missing error check to match the xbc_add_node() call path which already checks for failure. In practice, a bootconfig using ':=' to override a value near the 32KB data limit could silently retain the old value, meaning a security-relevant boot parameter override (e.g., a trace filter or debug setting) would not take effect as intended. Link: https://lore.kernel.org/all/20260318155847.78065-2-objecting@objecting.org/ Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Josh Law Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin --- lib/bootconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 82f21a9b0aaba..675f34cf32f0d 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -714,7 +714,8 @@ static int __init xbc_parse_kv(char **k, char *v, int op) if (op == ':') { unsigned short nidx = child->next; - xbc_init_node(child, v, XBC_VALUE); + if (xbc_init_node(child, v, XBC_VALUE) < 0) + return xbc_parse_error("Failed to override value", v); child->next = nidx; /* keep subkeys */ goto array; } -- 2.51.0