From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 18C342772D; Sat, 14 Mar 2026 23:02:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529329; cv=pass; b=rZD5ql+KpRTXA7iFk/lqvZIc054f4Vc0OFJCQGgWe9XZFA4fUTc+wroX0RhYWatbYnnsFGUMIZbWZlXiyvcPVlblQj+yz2V2aw5AV+evxLzV0/EYJAWipMs3vz5HUS6Cep7raLl6mm4Yb7QWJOVI0licCoeDxNPsnPMKlFqfvvU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529329; c=relaxed/simple; bh=Y9mfWQWziz20z1wZlyGCqiydfBbJQNFNO/oywEYrkow=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K7HVlZN/Lx/Efb04qQ2iVnhjSSH1FJqDDN2fBVF5tySHTwXw/Ir0tNKGKU0fFEtDl5y4oIhMruUsYdu7ewsPfjYKS1hk5hyGiKK/MyOre5NFXMaogDUIWpMM5bGjCTwPzE71jz4dMiWHeLXWR40oLNCfB8GUEjvF9gXOuJTiT5I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=BEy7D9OT; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="BEy7D9OT" ARC-Seal: i=1; a=rsa-sha256; t=1773529321; cv=none; d=zohomail.eu; s=zohoarc; b=aspFmIyVsQtEg0NZJS4T7szKsIFxvL4aWndl21Iy1wmx4dLC2MsIf3u8oYKeLT9C95kvxyjpPJfTTX2e/ObrnJwZzER933Hns/scoZZBAlzptzQ6z1lwcbTpSaM/xd0SCJVVVXZdQ5zlETFgvBeVwkGKk0b0Kn0EAHmX6v2GKPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529321; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=hXgtMivk2FUkBDZ0ELim05yAd6enb/8iaNS3/idzO40=; b=jlXiTaxdh++CnHp38vrUNhMs9bGwpOIufJgZ1Nit97RnMvTCVm8qMg0LA2eGX7DST3Vh/5/5f7bFW0UThWV7/t1D6SSoZkwv+Uwerm6DelzxO7ihP2WwTWeBQUO5UnFmxR3sy+GtwV1BeHVYtkPDb8eOCaO3+GM5BgS4oFpP9Bs= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529321; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=hXgtMivk2FUkBDZ0ELim05yAd6enb/8iaNS3/idzO40=; b=BEy7D9OT+KoM/dlj+piOkf14jMDZHGAFd6B+qDse/HDF4DM3jPBsP0qjJsbJ7mTG 3AvlFzrWqj65zAKg7LRZxh5lWuuA4Igr200PyrPjpezzu81LmaD2FcYcf7ODc7ecyDV qnuWhMKTqda1IvbLLkOnRXacMUftMQ1sRW6TyQ1o= Received: by mx.zoho.eu with SMTPS id 1773529318007979.0384381529594; Sun, 15 Mar 2026 00:01:58 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 01/17] lib/bootconfig: add missing __init annotations to static helpers Date: Sat, 14 Mar 2026 23:01:39 +0000 Message-Id: <20260314230155.155777-2-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" skip_comment() and skip_spaces_until_newline() are static functions called exclusively from __init code paths but lack the __init annotation themselves. Add it so their memory can be reclaimed after init. Signed-off-by: Josh Law --- lib/bootconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index b0ef1e74e98a..51fd2299ec0f 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -509,7 +509,7 @@ static inline __init bool xbc_valid_keyword(char *key) return *key =3D=3D '\0'; } =20 -static char *skip_comment(char *p) +static char __init *skip_comment(char *p) { char *ret; =20 @@ -522,7 +522,7 @@ static char *skip_comment(char *p) return ret; } =20 -static char *skip_spaces_until_newline(char *p) +static char __init *skip_spaces_until_newline(char *p) { while (isspace(*p) && *p !=3D '\n') p++; --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 28E42175A6A; Sat, 14 Mar 2026 23:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529331; cv=pass; b=DXoxiS88KCAdX9Yll+kmDcsHN+pxFGq8L3my3+vl2oAKdJKHdZ9i31J6n5+g3y5xnKsHLmIys0eivNLpT98SL965P4scFoC6kCoaElDHA/hhBsiOKZNp2Il7bMtC32rCE5LbB65iyRLJFWuqUyLyW509CKQSOeqQHuJUJ8lzkdA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529331; c=relaxed/simple; bh=6DWvwelCofWZTafeeOC+MPe/vsgZVKorf3Yjc7Dvl8o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=adINWc/yeOw9sQ11lNoI4/cqwgk7r9LeSZ56xEE/uL3PjqvSMizcWJ8YVDBW7zR03SFb0jbJhPOrf2dQcjv0NjuOuRzyMK7HJHvomMQ0xXYgh2A/Ev8mnUz/3jDwiQf/NiJs1rUL23XFtWOLZkyk6xSKtnYHTkzQUVud6C7htbo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=eGIp7clc; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="eGIp7clc" ARC-Seal: i=1; a=rsa-sha256; t=1773529320; cv=none; d=zohomail.eu; s=zohoarc; b=cdQuZSsnQehCEqCXwa5Q6jxH9RyZCTqYcAFVbA6d9gtIoZXYLib49+PpyD11xs8mvEZHUjwForUYSGA72XMXYhBFSoXnmYIxKkrdkcy5x0v6BrYqQ6AJSPU2hdxHqao3tAjV/OmezVoZuyuSj4WP87V5RChrCkM7gQvgmLEI9G8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529320; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=bDLriIlREU+xzs0R4GJSCt1A+bp79GDxd2ijzRVDE9o=; b=H4QjbZrbso5DpOH7RLWCXFHZIsHOO4JaZSgYKElGrpa74LGCU+kCzcKJtZKJanH7jeWeQd++nzPJ/ZIDk6T4fV6p0aUs4JvwP6GclrZ3es7a7h5/h+Pxy392mkZ6Lnz/DAP7y9lTzl1RdqENEs2t7LXk1ouIL9o3yLXiCOlPypg= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529320; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=bDLriIlREU+xzs0R4GJSCt1A+bp79GDxd2ijzRVDE9o=; b=eGIp7clcf7Vq+shJ9uz0+uhR/McMM9xWap/oZZDSTQO/dmoZaFH8emOdQ0IF//bm fny3CSfzsRwLkyj/sx7zvztpRDN4S6a7lSeXZvPsbplcg2VYCfIBOlpS0FbiWbQtf0R 6OS+b2QXfCXdRkxDXZGDKjd186JZq6/4YXOoNqDA= Received: by mx.zoho.eu with SMTPS id 1773529318635755.976375872085; Sun, 15 Mar 2026 00:01:58 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 02/17] lib/bootconfig: fix typo "initiized" in xbc_root_node() kerneldoc Date: Sat, 14 Mar 2026 23:01:40 +0000 Message-Id: <20260314230155.155777-3-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Fix "initiized" to "initialized" in the xbc_root_node() kerneldoc comment. Signed-off-by: Josh Law --- lib/bootconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 51fd2299ec0f..53aedc042f6e 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -112,7 +112,7 @@ static int __init xbc_parse_error(const char *msg, cons= t char *p) * xbc_root_node() - Get the root node of extended boot config * * Return the address of root node of extended boot config. If the - * extended boot config is not initiized, return NULL. + * extended boot config is not initialized, return NULL. */ struct xbc_node * __init xbc_root_node(void) { --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 2C756223336; Sat, 14 Mar 2026 23:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529330; cv=pass; b=uFr39IY6o+Be3bvOnsQZAGlq+BKry5ERJjRWH5gOEEk6EAaTDsGhit2IrItr0kBMVC9hDhBOdtkH5k7vytHhIckLMS1YvSUr/6jJzH7y+S7Ek9kuWdAqIUEaqj3/G8nEipjFpKrdwF0Bt5cJJP9b1qaEi9m7Qp3bkcbYS2wiKgk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529330; c=relaxed/simple; bh=q6VgcWVV8ArVaK6l3wnAuR1kW+gcsKwKbYy06RDfTOs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j39h6rHRwvHeQ+HMlixx1IZmNfws+yUn5FlrAEY9cypU6cWc5ShD3VXF6uNxAJIU+Z/M3/GmyIFuTaFtYMMNklNvplVGSXCPG1UyI/+JGLUGNcDNTqNwMP7FZ1sZ3kQkbmNrqSSlfboGj0s37trW3PveTE03R6YtR1H5LzFbVHk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=M6Egqu9I; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="M6Egqu9I" ARC-Seal: i=1; a=rsa-sha256; t=1773529322; cv=none; d=zohomail.eu; s=zohoarc; b=AkEcVTV98Ed3GIrmMSscUTM+lFecYxM3BaDJYxs7F10nkWla0iRs7ihqJUBMu0LavBzUMIMhUm8xUkA3SsgD5T9UiAC92uldWD/9lMsj2Q3OyN6eyJgO2IZZ//QpTFVW6zoiLBe2vJhKHG8KIP1bW7R6vuk3rit/U4Ys0ZGG89U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529322; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=cenrCW3CIGtKFL1Daz+UsPpEa03fH+pNT1DRvVGGbuI=; b=Yl9m8CekUJuPUqJwIpnCyfvCO+akNcwaaN5Er8XaMyC3pq27oMJhAbC5QjgZx3Y9jyNklY61UaXPjOLF6pscaZ0LBLJVFPUCNbGBl7E0DnNaDwO6rTbxouNmzyYGB65TnWJDH7bjM73OmR/+98AEwRd3GdQMCxaXFn1QRtyPZh8= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529321; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=cenrCW3CIGtKFL1Daz+UsPpEa03fH+pNT1DRvVGGbuI=; b=M6Egqu9IfNRMAEBypfjGE6u221/Km78a8XXCtdW59qvp0rphIEp+802jZ+Iz6nx/ OLDjIQKkm04qsmJCjTIu9mkrj9L6579mm3OJh39rwo9iyuWOSqNlI7zlutOdKVx04Dl XB9JIxwptkUD+dpPwOpYfYWtj2JSAn4WcLrPoq5U= Received: by mx.zoho.eu with SMTPS id 177352931916774.6656976122191; Sun, 15 Mar 2026 00:01:59 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 03/17] lib/bootconfig: fix typo "uder" in xbc_node_find_next_leaf() Date: Sat, 14 Mar 2026 23:01:41 +0000 Message-Id: <20260314230155.155777-4-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Fix "uder" to "under" in the xbc_node_find_next_leaf() kerneldoc comment. Signed-off-by: Josh Law --- lib/bootconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 53aedc042f6e..35091617bca5 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -364,7 +364,7 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct= xbc_node *root, node =3D xbc_node_get_parent(node); if (node =3D=3D root) return NULL; - /* User passed a node which is not uder parent */ + /* User passed a node which is not under parent */ if (WARN_ON(!node)) return NULL; } --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 B4AF138836A; Sat, 14 Mar 2026 23:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; cv=pass; b=LKky6ooUyGX03c9gkGXfuuWBjiE/wwsyS3rkKC/dRTPO+3QVnoi1NgqAWyzdV8OjCK0goQQMH8yRZ5TsrACHwlgujaiEFlgpXPc65ussUMy5d9daeoZd5YsDHlhp7JRQiglNXI3u9nhegD/iWrUeb3MgaE4SiP0KxE30aY+bCdI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; c=relaxed/simple; bh=2jZFhcm65pVh1my7aFVnxTPWIZ+otcDP9/Gf4KWRft0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gKE9gcu8v5+t2PqMbcnzZpe7UClyV3+89cn1QoOtddOQqO0XQjWnn53DC4OuZutrolQ2LoRlOpzhI6XrWgTfapUu8jgvptqNhwbF8dbZobDu1W6Nh3brmCyN62Pza5ohPCRxKpInSYXR6oU8UP9+s/mYpGnHfyKACM92LacpKKY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=T0R7oGpg; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="T0R7oGpg" ARC-Seal: i=1; a=rsa-sha256; t=1773529322; cv=none; d=zohomail.eu; s=zohoarc; b=XrG81q+g0QZvOOqpitVL7TQopFW/ZzxxzfxXCpWDUTKWmMRlDkeRV0g2W1pKJFb5GLWOVgBamJR3K5VQF7kXsB7e09xnIkbOVPxUzPpIGlMEDcuqIUDiVKYV1Qwr7SliddmcVAHMy2P6uU7zIw5wdowI3OWudDVQiDoqYK1F5nA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529322; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=2lprVVDRD4lH3M3PsJ+R627NsZ/o1XOLdXFW/LZVSKM=; b=hmS8LtrjGtjvjNkKCIkJfsqlAXDAqhRMR6Uv7/N3o0YemfWP9jND5m63QMqjsIix8apc6iUTFVXloCFEqhmaDnnt38UuWodXu1EJkwlof6L9QUoksQ38eUjWfKAqfzuzBVBei3b3N1yQVxEnGy/H9p0kY3GEX4LKeYjQoYDvZvc= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529322; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=2lprVVDRD4lH3M3PsJ+R627NsZ/o1XOLdXFW/LZVSKM=; b=T0R7oGpgM3E1avt0Dl8eKkZ/mohgnlJZB+55Q308bP1E70LFQ5Pmwffai7sF+ynD 0AGFGob/X+miQj+KUBq60dKp3y3xl3tNvLQ7n70WGWCHYna12iPz++NIIgc5z7kRumO vrHCbQd2R0W2bOV6HGc6dd9AV/g6qTurgvk9hwJM= Received: by mx.zoho.eu with SMTPS id 1773529319712962.2648996757065; Sun, 15 Mar 2026 00:01:59 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 04/17] lib/bootconfig: add blank line before xbc_get_info() kerneldoc Date: Sat, 14 Mar 2026 23:01:42 +0000 Message-Id: <20260314230155.155777-5-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Add the missing blank line between xbc_free_mem() and the xbc_get_info() kerneldoc block so that documentation parsers do not associate the comment with the wrong function. Signed-off-by: Josh Law --- lib/bootconfig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 35091617bca5..e955d2f7e7ca 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -79,6 +79,7 @@ static inline void xbc_free_mem(void *addr, size_t size, = bool early) free(addr); } #endif + /** * xbc_get_info() - Get the information of loaded boot config * @node_size: A pointer to store the number of nodes. --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 C90C326E71F; Sat, 14 Mar 2026 23:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529453; cv=pass; b=FLTB3FT6ltXEt5eEozeA3A01huWgMVkc94O4iauWG3eZ4cM2WHVh0JnIi5xRZQUK3rLJKZkb1enYDN8ASmpoPD+xtteFVoUNr5DtkKNEJTITv7LhXk41cIB1682yclaqHS6QdcOT5iHq5K52KIGVxt+ovpFeQqwj9PTqWImAhpg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529453; c=relaxed/simple; bh=Ca2yOMLol0eXm8Z93sdZF0uzxBHDnoJJ5YjTb0UjCSg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=O05jbr7AntpHi/mxym0VefBzJNzBS+gE+ACAh6MqKj/Cu9Cb78MoDl9CksSw/rQ/Il6lnRnqkCaR6pOzZRWuem2BtX4JjkskRiTVKd6JdRCh1oTXkKrc2HuC3UXw8SPQh1t6gGbwiKid0N/j1wbcFt6DFXgE2jrvqDeLCAjEonc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=CBIeX0iA; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="CBIeX0iA" ARC-Seal: i=1; a=rsa-sha256; t=1773529323; cv=none; d=zohomail.eu; s=zohoarc; b=V9tiRcNmwthJXnqKnBKzJDBHwBmQIoQjjzjlvkPII1CE/EiZ0GqJXELzpKMgLB+eQ7jfmR8v19en3vzj3fNCr5Vom+qba5CIEyPnoEVVN1xsZqRdgo+dI2Q/yiyGSOY5m1qmAG5bo2kRZHZzMehxQ9uzaELaoClWtMiIgy1xqkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529323; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=M861Pari/lV9kRCqOVfEViiGvsDrnuYG9MG+0z+YaXE=; b=fqhJ9tBVuqIaJbZlZzPbuEKjHtkR42ZMkEpedhNtahHaNEraPSs6H+qFQv0gLPqgrkUO2zlwb9SuwMAgRlSZALjteZEjk7HjlmGVfeWhqDKVuFILsCHuJ+6eL02/Rzo2XL7s/QHgkShnRUGjrwQX/SHj3NPzT3VDonT96F74ffE= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529323; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=M861Pari/lV9kRCqOVfEViiGvsDrnuYG9MG+0z+YaXE=; b=CBIeX0iAc7yDmrWHYnjLO53xJ+ejhClrNb5LYYIV+oI+fhnRZLkVcLuWZmHR9j1B kJxsoRlwRFoTR0pLNVCk3FlijrUT7yYnoRKBtsu0NZSwrDLQdx5CyFzKforEJ2SFCa2 7e4Ylld53ttwQv08me3Ptels/FzfF7VoOPPaYwYc= Received: by mx.zoho.eu with SMTPS id 1773529320220765.7209768440242; Sun, 15 Mar 2026 00:02:00 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 05/17] lib/bootconfig: fix inconsistent if/else bracing Date: Sat, 14 Mar 2026 23:01:43 +0000 Message-Id: <20260314230155.155777-6-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" When one branch of a conditional uses braces, both branches should use them per kernel coding style. Signed-off-by: Josh Law --- lib/bootconfig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index e955d2f7e7ca..45db51bc9cc7 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -473,8 +473,9 @@ static struct xbc_node * __init __xbc_add_sibling(char = *data, uint32_t flag, boo sib->next =3D xbc_node_index(node); } } - } else + } else { xbc_parse_error("Too many nodes", data); + } =20 return node; } @@ -992,8 +993,9 @@ int __init xbc_init(const char *data, size_t size, cons= t char **emsg, int *epos) if (emsg) *emsg =3D xbc_err_msg; _xbc_exit(true); - } else + } else { ret =3D xbc_node_num; + } =20 return ret; } --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 DBB4D30B535; Sat, 14 Mar 2026 23:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529331; cv=pass; b=YplT1LgAO9nMg7gi/g5FzOCsaLaJPJ6yXwfhDjBPgDGY19gb+h2g9UMtYz/h5FcGf49wN0mnKtz5mMWChosVIo6ZfA0gWeiBUew4m50+Kr7xcGGW5xuseXCy3i6KM5U9GIUBY4bWSaIMI9jwIrZhPd8bfa7c1i9V24BI/09GSH0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529331; c=relaxed/simple; bh=DRP0bkR7bPm24iP6Lzhg3tEJBN+s2+Bet778OjDqUXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aFRjGR9u8HADHDWRInEs7/k2s0rEfwEHGo0fpQlRfKjtcl9kLFsBu404rr2uqXUpzub2VGyJywzPC13TXWoO2l/UnTLsYdja0tUvAmG0SipeJdElAd1iK08Fca2yA29Endb1n/fHKk2bfP6k+ki+kTcMx6YRmN1cOUZAKIsm38U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=Cln2clnI; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="Cln2clnI" ARC-Seal: i=1; a=rsa-sha256; t=1773529322; cv=none; d=zohomail.eu; s=zohoarc; b=Fd1Kl23pa4fJNl1sDGkoX3eTVa7tJf5q6CJQ/TSwe+Tcn1kb1JOeAe8sh/JbJfR8yhpBmipwVrle8S2lQwIVGWfdEOSM01jJDS2r7eUuG9N34isOc3sqyveVw6MUZRh9x1u934O3xAQzAq0n83mHlZ06ilUovxkfKlyLVBnWwNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529322; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xeupn9cKPxiPKbISrjkPHMR3deW24vI0PqVo9Jq/DYc=; b=MBxLulm57y1ow3bBBEZO/VOacjuZh+HxR66kDTdKVTNZdDywZ1mDx6F4hlbHojQ598Uy2xb6zPJLhdYLA1Kit6hCwEGMhgOMHHlT4B3ks0ne3r9SYeYKwOT3Adrk90tIRHk4CLavJaWNrEPzMUexdimpS/i5eKtB1+kc5zB8lRw= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529322; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=Xeupn9cKPxiPKbISrjkPHMR3deW24vI0PqVo9Jq/DYc=; b=Cln2clnIqtHuH/Egd57Cgq3UV02tjM9ARoe9mvCtb/Rw4VruWuBXdJt7jRqHHK7r 9Ix7ZYb1PsNmDngrv5D97T93XZAUnlsLy9g9ZryR4mUTMtMOKJxjtl++2lIedpcuebB 5GaBi8Q6/C1+XyeSdRH5Ku3+PalbVRJvWxwKOGzM= Received: by mx.zoho.eu with SMTPS id 1773529320720670.3223273420932; Sun, 15 Mar 2026 00:02:00 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 06/17] lib/bootconfig: narrow flag parameter type from uint32_t to uint16_t Date: Sat, 14 Mar 2026 23:01:44 +0000 Message-Id: <20260314230155.155777-7-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The flag parameter in the node creation helpers only ever carries XBC_KEY (0) or XBC_VALUE (0x8000), both of which fit in uint16_t. Using uint16_t matches the width of xbc_node.data where the flag is ultimately stored. Signed-off-by: Josh Law --- lib/bootconfig.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 45db51bc9cc7..34bdc2d13881 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -408,7 +408,7 @@ const char * __init xbc_node_find_next_key_value(struct= xbc_node *root, =20 /* XBC parse and tree build */ =20 -static int __init xbc_init_node(struct xbc_node *node, char *data, uint32_= t flag) +static int __init xbc_init_node(struct xbc_node *node, char *data, uint16_= t flag) { unsigned long offset =3D data - xbc_data; =20 @@ -422,7 +422,7 @@ static int __init xbc_init_node(struct xbc_node *node, = char *data, uint32_t flag return 0; } =20 -static struct xbc_node * __init xbc_add_node(char *data, uint32_t flag) +static struct xbc_node * __init xbc_add_node(char *data, uint16_t flag) { struct xbc_node *node; =20 @@ -452,7 +452,7 @@ static inline __init struct xbc_node *xbc_last_child(st= ruct xbc_node *node) return node; } =20 -static struct xbc_node * __init __xbc_add_sibling(char *data, uint32_t fla= g, bool head) +static struct xbc_node * __init __xbc_add_sibling(char *data, uint16_t fla= g, bool head) { struct xbc_node *sib, *node =3D xbc_add_node(data, flag); =20 @@ -480,17 +480,17 @@ static struct xbc_node * __init __xbc_add_sibling(cha= r *data, uint32_t flag, boo return node; } =20 -static inline struct xbc_node * __init xbc_add_sibling(char *data, uint32_= t flag) +static inline struct xbc_node * __init xbc_add_sibling(char *data, uint16_= t flag) { return __xbc_add_sibling(data, flag, false); } =20 -static inline struct xbc_node * __init xbc_add_head_sibling(char *data, ui= nt32_t flag) +static inline struct xbc_node * __init xbc_add_head_sibling(char *data, ui= nt16_t flag) { return __xbc_add_sibling(data, flag, true); } =20 -static inline __init struct xbc_node *xbc_add_child(char *data, uint32_t f= lag) +static inline __init struct xbc_node *xbc_add_child(char *data, uint16_t f= lag) { struct xbc_node *node =3D xbc_add_sibling(data, flag); =20 --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 D751039023C; Sat, 14 Mar 2026 23:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; cv=pass; b=uVS5juNtUFH3mDErrDJxxLJRtTNyAZcAYsf8rUOV4204XRmyNUA18nfoKTAx62dAz1PZDIgmE16ZARwfv7Mcy6TPTWinQyEdn4BanDpgZ02R/nuOl60Rued7Cpv0/3AMp3xOrpvnMTdAzRLNKOkJxhTSkoTy2uAq+7w67Q968ZI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; c=relaxed/simple; bh=os0B7i8CIWcvtr1f+9MFrDH43djYT4PHUh8qcbGqh3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PBLVLxUnNRdrvYTFGrMWF6fFVWqaxEhy5/4gP4nGRoLJv91c1C9/EX9vA6a9e5FQ7y1fuB1qlvXT23u2wAWSGzNXg+JYoAWUga6I5K3eYvVfA3QUi0mk9rCWe31ZViRWMCb2p6bxITDiqnoKZW/JMNn1sqtOU2reaxw/FHR9TqA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=HNj4wx6x; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="HNj4wx6x" ARC-Seal: i=1; a=rsa-sha256; t=1773529324; cv=none; d=zohomail.eu; s=zohoarc; b=C81DB/upk4QuKQDzdY1n73CLqi9LHme8nIGWCvxHGYjDHCl81rxayXWZci9QbpTTxABxsoFu+5ojdLrukV2IvXPGdgNfDm1bIFPUgooaqr+C4s0ZCDe7bkO9B9id/npamobT7/oPWrXyftfGJ8N18QQqcPRj+UGS9+qtlG3S05Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529324; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=bT0v2u+9Dqz/pWmeHK/egM9RCBp55B7VxPnClMaL4Oc=; b=Vr1xMR/RIDe4EPCSbPSqnLYV3VpmnLKsnPvN30t3YQIOKbKiy1FYm6PeM7cD9OF0eRifpGj5k99524/XNnBIz0DxMFIyknsVbEvG6EaG2MMS6pdSGAdyAI+MOTnUtsYdxHuzVRAn/cUULiYaZNdsMZKar4b5QAcggkyQS7SCYco= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529324; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=bT0v2u+9Dqz/pWmeHK/egM9RCBp55B7VxPnClMaL4Oc=; b=HNj4wx6xCVEfRy4VNc/ep8uyG2xfE8fbGZQNreY1SniH5SGa5AmghrjrkIi7ZFF2 /vMBDZHDXPhCOJMsRkg8LcCSBpsdEEWLAHBJJKUmnzcdVVOjdproMCNrqTFOxMSfZVh BBnXNn0SEaxyADyxSma9J/FfGrQjaTQhYz0iVKpA= Received: by mx.zoho.eu with SMTPS id 1773529321222628.2460852042352; Sun, 15 Mar 2026 00:02:01 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 07/17] lib/bootconfig: fix inconsistent if/else bracing in __xbc_add_key() Date: Sat, 14 Mar 2026 23:01:45 +0000 Message-Id: <20260314230155.155777-8-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" When one branch of a conditional uses braces, both branches should use them per coding-style section 3.1. Add the missing braces to the if/else blocks in __xbc_add_key(). Signed-off-by: Josh Law --- lib/bootconfig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 34bdc2d13881..58d6ae297280 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -657,9 +657,9 @@ static int __init __xbc_add_key(char *k) if (unlikely(xbc_node_num =3D=3D 0)) goto add_node; =20 - if (!last_parent) /* the first level */ + if (!last_parent) { /* the first level */ node =3D find_match_node(xbc_nodes, k); - else { + } else { child =3D xbc_node_get_child(last_parent); /* Since the value node is the first child, skip it. */ if (child && xbc_node_is_value(child)) @@ -667,9 +667,9 @@ static int __init __xbc_add_key(char *k) node =3D find_match_node(child, k); } =20 - if (node) + if (node) { last_parent =3D node; - else { + } else { add_node: node =3D xbc_add_child(k, XBC_KEY); if (!node) --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 7BD47386566; Sat, 14 Mar 2026 23:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; cv=pass; b=dQbDfZUbIuao+tzb7kC1hW8CabibVhmfmomrlo5I/TGeTpRy7faW5nANWP2C1s8/oYVftzMkjcHsdTypPLwiacK8gJAT0mLyLSgD6Wm+PZxcJwSsfrUjOsVjsfsYlWziwimMYRQIVtC3byouBubKNsvR1kZUhO/S3BUeS9X4uCo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; c=relaxed/simple; bh=Tcy477qCr4zjwSxEbmUVpzCk/GlV5mimINv1mxGanLY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g+oA+wb5R5hBsWOwZcivuLp6WpWPcsqpaADZxOfvLXxhn/dGzdHosU7e0xWFcq1Oad8WTQpiufZawN7SKxDcpuVM36+X8+vQ2bJ/MTcdjt+l78mXSQUz/MyIfBAxmPnCPahtKKCXQHVjjpxTNdL+HSF7VxxJkoj1uIV1BDQtryA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=J4vV9r30; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="J4vV9r30" ARC-Seal: i=1; a=rsa-sha256; t=1773529324; cv=none; d=zohomail.eu; s=zohoarc; b=IoMYccxo81TLHOSoZoeq1P6WtkdBitZHNr/+gOJctEsDHlIesGSBcXlARLA4NiwVM/N4nBIsyzj6Rlq/Sg7BVVAa7VC7UHdOVW6WY/H+YjB7KUgdtVdsO2MLq9tey4v+pxJRxpl6/wVw4McJfg9cBv6H4Qq8aWwjH5KcnlRTRWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529324; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=6J4Zdammh5fpr6R0/8dSlFL0Tel9zMDt6j0TaDyyePc=; b=a+mxImwFr27tdtIMqqW43OvCC1SQyYZD9l4kdndkD+WlJ2xFdnS+bYZFds5kMorurqvcFwMRgEHJxC5KysP/J94teDsaQwjvj7XiBuvQTiOuSuC5alsJqQBs3PXoHnkyMBaqhFkAwPEr641usFC3tcxYpx+HjefDm+hLh9DNriw= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529324; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=6J4Zdammh5fpr6R0/8dSlFL0Tel9zMDt6j0TaDyyePc=; b=J4vV9r3044qW6Q5VvRJvBYhv3WXuGZMaumNDWBqq5G/WfhZGaEhrYqMVhtyVo63g n4gXZ6GzIW6gNW9NES2Rqi5PJb4/xBx2iIO9LixGIw7r2NuiMIo0KVE23Owcqg9yZFF K7P5mHLTMoySwRw2IXSzlp3799Ob+sRt2rgBJwTI= Received: by mx.zoho.eu with SMTPS id 1773529321739979.8573451577365; Sun, 15 Mar 2026 00:02:01 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 08/17] lib/bootconfig: fix off-by-one in xbc_verify_tree() next node check Date: Sat, 14 Mar 2026 23:01:46 +0000 Message-Id: <20260314230155.155777-9-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Valid node indices are 0 to xbc_node_num-1, so a next value equal to xbc_node_num is out of bounds. Use >=3D instead of > to catch this. A malformed or corrupt bootconfig could pass tree verification with an out-of-bounds next index. On subsequent tree traversal at boot time, xbc_node_get_next() would return a pointer past the allocated xbc_nodes array, causing an out-of-bounds read of kernel memory. Signed-off-by: Josh Law --- lib/bootconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 58d6ae297280..56fbedc9e725 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -816,7 +816,7 @@ static int __init xbc_verify_tree(void) } =20 for (i =3D 0; i < xbc_node_num; i++) { - if (xbc_nodes[i].next > xbc_node_num) { + if (xbc_nodes[i].next >=3D xbc_node_num) { return xbc_parse_error("No closing brace", xbc_node_get_data(xbc_nodes + i)); } --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 59141389441; Sat, 14 Mar 2026 23:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; cv=pass; b=BayargRGCA+Xvak9HyW38A4jj6gGRxhqth2PiAH43PgiK7na+dQyyAbuMmN9SzvVRPY7pbscaR2CaYwMxOxj26RbLJX6/62pQTBmw6RAv8Ijv3QXxb51I/0Axw140tVS6cO1W9dQ7KfUaRAbbzAEj4RpGEoBXjgut8JMm2+M6+k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; c=relaxed/simple; bh=43QmyCqjwfaH2eT1ZEPKdFGorS2/96CvQZYCl5EDh84=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pu2DUVEI2raWq7m+zhObqDGUZfT05V/xDoaYYAsOl30dqGsVk/mSmbuToqTSxmjd46AIpbuyhFVhcf43PLhWycZ7WB138KRK3Vkq9d7vhlJ8yLYmTk/e6SMi6DZlN7l5DLDzZtCeIrg07C1xES8agMJVmx2qCPWXp6YjsXV9Dvk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=Z4t7AMtZ; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="Z4t7AMtZ" ARC-Seal: i=1; a=rsa-sha256; t=1773529325; cv=none; d=zohomail.eu; s=zohoarc; b=SHz/fxRiI70pFMpzCbf5d53hqNzXU5oTIFxfpRxoXOr5oaTyir36shOfMd5dfia+zhnV2pJBGRwaZ6KciX0TATt0ve0zd6McXBtoXUm6io/Hkvuh7i3jheJ71UIkSVLPD0hrgtwlhSjSZr4zBAx19dr/k7DGlFaRWeKUArf42Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529325; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=aQ2JC6gJsIOnVLrttsYiOD8t7/HU2uNkLIv1633cFHI=; b=PXUJq1NsmfpkWTy9KqbzRHGagdAFTVRCYoiVkKKC1beTQiIzNucofcEGch7pxMG1G51myAwAnziwSUJ/mgpiM20PEvklJ3dEbZ4Uhs7Vhs9CHIsM/e6XK+yVImPQTputoT2iYRPGluwP3T82rTzV04pmKNc0KUGeeR+DF2q45MA= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529325; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=aQ2JC6gJsIOnVLrttsYiOD8t7/HU2uNkLIv1633cFHI=; b=Z4t7AMtZFtgso6iee2nWrJqQdFIKvWB8LYRIkjbwvdcIp+jdNbSezi9JQCTSJWEb 04rKjsK2CEHiZwndfvyFRGhqmMXFyZuNDP9q2osAEbwlWY2BOFRxTrBZQZikbSorTPF g16ysxSU8yfGiSVP8zKX2wzDvfHN/NMmtARNeDMo= Received: by mx.zoho.eu with SMTPS id 1773529322325236.76599477816933; Sun, 15 Mar 2026 00:02:02 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 09/17] lib/bootconfig: increment xbc_node_num after node init succeeds Date: Sat, 14 Mar 2026 23:01:47 +0000 Message-Id: <20260314230155.155777-10-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Move the xbc_node_num increment to after xbc_init_node() so a failed init does not leave a partially initialized node counted in the array. If xbc_init_node() fails on a data offset at the boundary of a maximum-size bootconfig, the pre-incremented count causes subsequent tree verification and traversal to consider the uninitialized node as valid, potentially leading to an out-of-bounds read or unpredictable boot behavior. Signed-off-by: Josh Law --- lib/bootconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 56fbedc9e725..06e8a79ab472 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -429,9 +429,10 @@ static struct xbc_node * __init xbc_add_node(char *dat= a, uint16_t flag) if (xbc_node_num =3D=3D XBC_NODE_MAX) return NULL; =20 - node =3D &xbc_nodes[xbc_node_num++]; + node =3D &xbc_nodes[xbc_node_num]; if (xbc_init_node(node, data, flag) < 0) return NULL; + xbc_node_num++; =20 return node; } --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 CEE8238839C; Sat, 14 Mar 2026 23:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; cv=pass; b=F0QOg77r5t+2SEHqFu+ApIrmWCGVmpOkVdtqcGOccXjdCuZQolBZGXppkzZz9LoSMqtZiCM7EItQA0WytDYalugFvaw6JIBvAFJdNxiAvZiEZn32vKYi6UEJD+wyESduIQyK7q0R3BBtZCViWBfmGGF27Y/YVQT3F9tY0xBZycc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; c=relaxed/simple; bh=EWCRpZBNHCZU8iztguL/vt47WImiwDpV31hec4mL7Lw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tjMFgSmBgZlmQaGvbQuVSpKH/IkZGkr88I4YekECnWJ1t6YskvLcfKY2K4/ySdD18FhpoFApk34s3wUbfcDAkiV/429hbHJl+HqiklFkSY7P6wJxTaB6PgcSwQqqgn0nBEipo/9KPURDV3okk2RaqjCZbklMVATHVFChVLQxDuE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=JDwhqRb4; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="JDwhqRb4" ARC-Seal: i=1; a=rsa-sha256; t=1773529324; cv=none; d=zohomail.eu; s=zohoarc; b=UpnmB//8o+mcEhztJrECb/qi6PThQPaErgzH1PQUiogj0G61J5UcN+Wn38+XSpX37mX0VhzWISrLBeFUiegTwxiTFIr44MO6Fh1lWCVZon2R/0izrylGn8hH55N7l7409ASgsNIk40J8Dm1Fz3jKFiwhxhRtEGQykPUM7EnzjgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529324; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Y3g/gWcuZygcqvX4QpGo9gnBChjnwRu7NCitJ/yvsXM=; b=kbhPU7PGq1tsFrYovpVKD3mNRUjSzBLwbsZX+7/rtvo7CY/e86qc5qy6Gm+FSN5pYewj9Vyp8LdJ9dkwMDc9I77Wvm+1myNXSdObPNQMNLATMwB1JSaydo8FMSywJWwBfr1ltEDAg251JGrriCk/JOpIN8UM0NkojqEHR7RWSmc= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529324; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=Y3g/gWcuZygcqvX4QpGo9gnBChjnwRu7NCitJ/yvsXM=; b=JDwhqRb4C4KYKlR6hvqOvrDeNHKtN3CdDM3JO5AzwVvbI/0bKer60QWNeR3VT+/4 YIz7YMxFgUDPrwV3K3LXPeevma4kbQAk/0amY44KBlx4KoDF7yv+eno5Mcn6E+gej/v Jf+XNJNVPRtaUUH08Stqsfu0iOb/kjmbkqjvW3Rs= Received: by mx.zoho.eu with SMTPS id 1773529322882862.0718540279187; Sun, 15 Mar 2026 00:02:02 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 10/17] lib/bootconfig: drop redundant memset of xbc_nodes Date: Sat, 14 Mar 2026 23:01:48 +0000 Message-Id: <20260314230155.155777-11-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" memblock_alloc() already returns zeroed memory, so the explicit memset in xbc_init() is redundant. Switch the userspace xbc_alloc_mem() from malloc() to calloc() so both paths return zeroed memory, and remove the separate memset call. Signed-off-by: Josh Law --- lib/bootconfig.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 06e8a79ab472..fe1053043752 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -71,7 +71,7 @@ static inline void __init xbc_free_mem(void *addr, size_t= size, bool early) =20 static inline void *xbc_alloc_mem(size_t size) { - return malloc(size); + return calloc(1, size); } =20 static inline void xbc_free_mem(void *addr, size_t size, bool early) @@ -982,7 +982,6 @@ int __init xbc_init(const char *data, size_t size, cons= t char **emsg, int *epos) _xbc_exit(true); return -ENOMEM; } - memset(xbc_nodes, 0, sizeof(struct xbc_node) * XBC_NODE_MAX); =20 ret =3D xbc_parse_tree(); if (!ret) --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 EC79B388E5C; Sat, 14 Mar 2026 23:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; cv=pass; b=AnKPsCAwFMLUPsn+F5gqSgKzTthRBHF2ertokPMDeRQbQ0j3W17lHG3/2yFQUDaOvx1uqLi8x3wLC1OZ8PAWkTUPSBLLBJgXXqKfXq0IrFBOFLyJeVx0izjMVCGEKZ0vOcK+oYIBmx9wtDaQkvjxJYrloCZ+kXilydV5m7/97rw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529333; c=relaxed/simple; bh=FXNMbqg55SqbPOuJegAqlqm+AJvfK6co4zCLBLrw5Q0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BlGsPY3CE7Ea3EjOaDyoY1QKFKfoFb4bJGHpttI1c5K/PkiGV2immYRjYeuxrbf4zX5rO0XUm7BGNcEwyHjaLntGpLzOwQ6IG2tsxk6ADZr+qJmzaRLEbaJj3sGa3/G5OhwgFu3cdvDJwp+ljcJjlOETOlvLPHXZedINleU9sFA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=nrKMmyAp; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="nrKMmyAp" ARC-Seal: i=1; a=rsa-sha256; t=1773529325; cv=none; d=zohomail.eu; s=zohoarc; b=Zz96mI/uAzrxojsyzp7yKUDxntkdvifcztTS0f4d2uVEHj2GAOQLL3e7vHtiFnm/aAicIS0gbnQtsC7FgTgrFC/Jbe+AUJ7/48RXmttW7wHDKLIqGNLdmt1/VQnud7KSBYf6Nj6Ip6YuzHkceO8izXDV0/qZaMRfHblZSqx2+ME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529325; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=WR9vliQJfdjZlPD0h9WaXzdDRa+2M90wAFjtK+1BE/I=; b=jgPfJ+/pVqF5uatVbrjs8zOroawcBHT4mdZ1tiCicrstYCCcuHepiU0aL898fI1uvWO8QgRTsQFd0JwpGF6db7SXsZP1YYqPUCdqOOdJ8XH2sG/oZtagEOvLVChScqP1UyZXvwv+ulQXz6Up2sMes0/7lPl8FJzL+AJW+32FbAU= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529325; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=WR9vliQJfdjZlPD0h9WaXzdDRa+2M90wAFjtK+1BE/I=; b=nrKMmyAp3UGibYz0q2UCVdOWoxNKVs0Eo7AQpA0TSUZjN3ovLN6QHtwVJhCvJseV Syy1ukjqlVprZG8b+dQUnyUeKNP9ba8oZHVmu81mEGuH0N/ZFmFOUmUR7EpE4hR4yTQ mNkYb6GmNEgDqV4moUxT2jO5P2JilCEj+Yyfq/4s= Received: by mx.zoho.eu with SMTPS id 1773529323455990.8955846772761; Sun, 15 Mar 2026 00:02:03 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 11/17] bootconfig: use __packed macro for struct xbc_node Date: Sat, 14 Mar 2026 23:01:49 +0000 Message-Id: <20260314230155.155777-12-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Replace the open-coded __attribute__((__packed__)) with the kernel __packed macro for consistency with the rest of the kernel. Signed-off-by: Josh Law --- include/linux/bootconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h index 25df9260d206..c37e0096c4f1 100644 --- a/include/linux/bootconfig.h +++ b/include/linux/bootconfig.h @@ -53,7 +53,7 @@ struct xbc_node { uint16_t child; uint16_t parent; uint16_t data; -} __attribute__ ((__packed__)); +} __packed; =20 #define XBC_KEY 0 #define XBC_VALUE (1 << 15) --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 DD53638A73B; Sat, 14 Mar 2026 23:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; cv=pass; b=a0N9cT1s15tZmRNZAreEoYtvuEVRXo3XmHp/dwIlyGawqgnH+c1KDl7fMzAlYhyPTQ2PcCub9wjbfe7pBIULDLnkFE35NbP78lv9AfpS5smDtXFaOLhI3bt9j6L+T/v/ext6Ou5IYHwc/Px9BqVJdMgeUdCrLtl12dmqaMoUhbw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; c=relaxed/simple; bh=g0gLOzGvGgBaDelQ1nQAH+bFpUg7Z1FFbkCEaYNyQHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J/RD9OWqBh+gYQBAZaIQYtEIm9oBLV+SepcwfiS4mT5vc/DHUV3vLb9UStg3i4TG6gYIy5dAleZJ73gFoM+hVgMbGX2omQj9VkoOGu5e/3D0QGC0rI6hMm54ZeJJJ48Pa5hhpllCr6pkWPk6HlXlw0NrVJbQWraQetv5uREr+kk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=TgtnwPSE; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="TgtnwPSE" ARC-Seal: i=1; a=rsa-sha256; t=1773529326; cv=none; d=zohomail.eu; s=zohoarc; b=LVmd4T9/wEhNcmbXNcwu2t0jjcRn6Yn+p20zhYNeDQujIgOolwtzoSIENhjvh1qYisYrN8eCq8Pq+B1jvU4b3AeeF8v+a5QXDYo7mRxRhm8pCZXs4HvhZqwaQBdkd847aoX2Q2yCA0f8pCKijkiUoSTCV1y3QBT2tPU0hZSirIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529326; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=/qCjNtdUtGuqj2pRl8MUrYP2ntfBCQat1rATubD3gRk=; b=B9PCn8odiAWviXZfkwc7S88OzxemVlSLtuJ/MRpNJqOvYGvxhF0BgLduiKrXzfOrpfolmOsoIaSlKKIRq27mzs7a1AG1Hfj6IvgyV4YmalNpxVjse8xHqg3hxnB9Hu5GPusB1qhfySMQHPsWHI7mBnEORjuAA+GUzz12fhk+y1Q= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529326; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=/qCjNtdUtGuqj2pRl8MUrYP2ntfBCQat1rATubD3gRk=; b=TgtnwPSEZqM5UtJcSt+VfvbT7MMpcCr+J8FZwMK/HLhWxeXM2qO82vPS8CFvh8QN 0RZbbM7CbwZBOxxyx0i3eB4vVl4h3SsQcYTfvZwzqtCr3Tpm3xfGzyY3YUcb7AYRbYH T8gQmVkFfTZDuVhHjung4K7HvysDoWFlaM/sax8M= Received: by mx.zoho.eu with SMTPS id 1773529323996483.49049098865214; Sun, 15 Mar 2026 00:02:03 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 12/17] bootconfig: constify xbc_calc_checksum() data parameter Date: Sat, 14 Mar 2026 23:01:50 +0000 Message-Id: <20260314230155.155777-13-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" xbc_calc_checksum() only reads the data buffer, so mark the parameter as const void * and the internal pointer as const unsigned char *. Signed-off-by: Josh Law --- include/linux/bootconfig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h index c37e0096c4f1..d78c2b62debf 100644 --- a/include/linux/bootconfig.h +++ b/include/linux/bootconfig.h @@ -36,9 +36,9 @@ bool __init cmdline_has_extra_options(void); * The checksum will be used with the BOOTCONFIG_MAGIC and the size for * embedding the bootconfig in the initrd image. */ -static inline __init uint32_t xbc_calc_checksum(void *data, uint32_t size) +static inline __init uint32_t xbc_calc_checksum(const void *data, uint32_t= size) { - unsigned char *p =3D data; + const unsigned char *p =3D data; uint32_t ret =3D 0; =20 while (size--) --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 143EA38AC7D; Sat, 14 Mar 2026 23:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; cv=pass; b=mUcmzbdUXgjdW4uRneQoW+jM5bA10bad/QyIqp5Xot5keZdxGeuDe0kXRhYS8gJsiXitIBzpZLesNOCmrzocf+ZgSXND1NqJtbB0Y/MDsLk3D9gbTxobMUMOZ7ZUxajRAcN2uHL3JlS80coboCLLS+Y7koot/MUbEUm5PUpJvwQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529334; c=relaxed/simple; bh=5jHlNQbA4ax5oxWy6TmNNrMnctsyCd5kWbRwYKqDhJE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sWNtt1aABgxhiNSHDfEn3smpyJtjZoShic9rV/uAVTnlQHf5aHZDsoN8D2XwjU2sTdGCexOXjvUEmLE8q89FBRVjtr0ekXV+Z7FB65try7DmaWkaf7ujIv5+H9314j73fOs5fc7mTBXpUI9aMK30H2yCVgOsMVwJ8OV+Y1kgXU0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=HsM4+0kD; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="HsM4+0kD" ARC-Seal: i=1; a=rsa-sha256; t=1773529327; cv=none; d=zohomail.eu; s=zohoarc; b=DN5HsVZLsnF/bKV5TVQMYcNivt9cgVQ6eKoFNSokYwbH8oUvk1CXTn0XbxUyDVjS1gVg6PDf2AHN0DcYlLhfWOImHj6olXtwtpQjApA7NO064/1ccu2WGzKuuLLQuMxy/+kB/cnAd+HJ1SaIjg2ZdQC1jIXtNe37tKwTbNUCmlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529327; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=RAInAapaPEVVIMyMy0xQq48ym4WbDouBno9PBv2kGos=; b=IOGTMqynrzy/kGDeBu+6LosBFFAmHPKgV6fSUyVvjg0RDNREoeIbkdFBVj3PlUOtJKcx0Kae3oB+F0rhGxnYrjlhsYcIUetQY+RjGAOEE1fCqAe9ajU9VI/oB60ZOVLhVsOG3AOwxh5ED0MBIby5Qgj+hMi8PSbktuENoMP4rQI= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529327; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=RAInAapaPEVVIMyMy0xQq48ym4WbDouBno9PBv2kGos=; b=HsM4+0kDH5gbW7wnW/SDO92uksAzEH/ir2Ynbv7Qymd6/bojSyMw8jyvHGPmHBiN TBmit3jbQVXuM5H+Ys1M2yawL6lQLml0XZ0Po6B+6PcrU2TYNdw72vxuVIgTdqeCRsx bd/X1eeEymSK7XTapa62KGJF1+1aXu159jEwLpHA= Received: by mx.zoho.eu with SMTPS id 1773529324550686.8899954035314; Sun, 15 Mar 2026 00:02:04 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 13/17] lib/bootconfig: replace linux/kernel.h with specific includes Date: Sat, 14 Mar 2026 23:01:51 +0000 Message-Id: <20260314230155.155777-14-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" linux/kernel.h is a legacy catch-all header. Replace it with the specific headers actually needed: linux/cache.h for SMP_CACHE_BYTES, linux/compiler.h for unlikely(), and linux/sprintf.h for snprintf(). Signed-off-by: Josh Law --- lib/bootconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index fe1053043752..0823491221f4 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -17,7 +17,9 @@ #include #include #include -#include +#include +#include +#include #include #include =20 --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 7C10938839C; Sat, 14 Mar 2026 23:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529338; cv=pass; b=ApBy5ktNFzHGu41GKFYDxBRZpq0VpiKhmjiRiNpHu+BYOeeW7omF/fJur+PuvQxRossEde4zH/O9lgVXJUFjcb6E0PFZbwGK37uv/o8B0TVmw8uSelXFgrQtXcz/tn1ponhDBtiFfYwqMM/qoBl9EEvc/sZ48QuFB5thSYBTZ68= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529338; c=relaxed/simple; bh=6I0hpTbxvzM0MrqqhLwejv2QuzQNDU3b1q7ISIjV9Vw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WS2odPHyc53Dd2OEEIAxhU8TS9dkWnBuul/EGm5OdC/ql3wZsTgthOmMxgLJ4vAf0NKMMfMw/W7kJ1Mk3in0cVTlRONRe0TUgvmQLgmYiGvCtR//NKv7/bQepekMbAH54Xsebk3dWFzruOfKnEEfZuAwwTMn7F3KrMnDfZdVq/Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=RFU1dNgS; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="RFU1dNgS" ARC-Seal: i=1; a=rsa-sha256; t=1773529327; cv=none; d=zohomail.eu; s=zohoarc; b=EyKnvh8/G/FvOvb1WM4zCzdgRjO0v5frsFbJTSy8jvTzp0qViYBuOjpLth8kMSKho9aRWruGaf3nERI3+sE6sqLWhYbgxWROT22q0QeebIIJUhjwa9LhIqwdXAZuUSHSBJQBs5zkMoDW4ffYuYxf3XhAkD1+bQQ3l4BhUGV/goQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529327; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1AD6D9MidV6Fkfxyg/iT9A9sDWNhqE7cnbV+HIFl0WI=; b=Z4HdrJurjsVGd674ORDgumdreQ7JVqloiWd5AxAwqV6zKb0zG2Pjng5pebEI3LxiW2dDA86eqN9ryamnS97qXnAq3I76HfqGuneBHZ+GL4bdoPRNKh7fpQe1vPn9/5CTxM4qaFD1EiLGFrlxynTsRNLeZMGjQwb8iE/4hadcTyE= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529327; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=1AD6D9MidV6Fkfxyg/iT9A9sDWNhqE7cnbV+HIFl0WI=; b=RFU1dNgSaQbKkfVY4R5eYrAMjAGRkHV0PV8KfPPNlVeMAdxcgKr/WSQxZbNgl/WB rQ9f7BKBdT9ApqMQGT1Bg2fVTF5bj+7x41Hki401HcEnLQ83jsKuIpsMBZ/+m2OIhi8 2hwyp9m+8qJvPOGtCTpyLOvzTATOzVlWvqNbt+Gc= Received: by mx.zoho.eu with SMTPS id 1773529325080225.05753336855594; Sun, 15 Mar 2026 00:02:05 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 14/17] bootconfig: add __packed definition to tools/bootconfig shim header Date: Sat, 14 Mar 2026 23:01:52 +0000 Message-Id: <20260314230155.155777-15-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The tools/bootconfig userspace build includes the main bootconfig.h via a shim header that defines kernel macros for userspace. Add the __packed macro so the struct xbc_node declaration works after the conversion from open-coded __attribute__((__packed__)). Signed-off-by: Josh Law --- tools/bootconfig/include/linux/bootconfig.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bootconfig/include/linux/bootconfig.h b/tools/bootconfig= /include/linux/bootconfig.h index 6784296a0692..41c50ab95ba5 100644 --- a/tools/bootconfig/include/linux/bootconfig.h +++ b/tools/bootconfig/include/linux/bootconfig.h @@ -48,6 +48,7 @@ static inline char *strim(char *s) =20 #define __init #define __initdata +#define __packed __attribute__((__packed__)) =20 #include "../../../../include/linux/bootconfig.h" =20 --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 C2C99390C91; Sat, 14 Mar 2026 23:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529338; cv=pass; b=Cfa3nGcUQ8dpKreD5pqebeCAWR44qNBWAzMGOnTSizo2ecnstc+cESMaj96Uwf1GFSteOp6SMDefwcdczGR/xgDty6gGRn7mUMOGq4XT7lDohdX5dIlC+CoTTSAtaK1je3B99RWlcRzN/RCH4Cl5Uinr0b+KjBJ19iuRSD3Exs4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529338; c=relaxed/simple; bh=ZuUlVeCERGWi0kiPXUflzzixT8Dr5l8GMnBPX34kkGY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=smyfpY7Ceu9MTwq86baqZBmYXc/pH+e2jZaRlxjH36ZfeJRK+gQtKVZuD/s3x+kcdOAitps9G7YVVZxkbRgVHPcaT4y15jjANTY2amvx78BaMRmz3CjyQMMrXhXxlaEW5WZrWRLl4DqkC3AVOSOLhoLDc6Xynz7KKEzQINyU+rs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=hfwwwIXe; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="hfwwwIXe" ARC-Seal: i=1; a=rsa-sha256; t=1773529328; cv=none; d=zohomail.eu; s=zohoarc; b=DPWSjSWhe7hHUpZCpHxRDCLBabInn46gB+NWS0C2HNHHH1HifdY0W8zt2zReQANI4z66aWOrb2R+WWpWbLcdcnZkcA00tL9imOFxmoUO38vhO2z+FBwEQ0gXaObYufLMTyJgibWZTIPHpnLQP2Rq9UvYMEnCHjxkG54wmhG6aLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529328; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=jQa+d6xwRxy5WvG4jIfj7hMRpG3HkL2h6UH+aTlgbd4=; b=SmFrXpaktJLjtqy1t8l3rtb37Q3L8tFRkrffZKECoRurbjg4GaGI7mm/UkydORPGMnFZC0Kh/RO75CFVfFnPIVoC4FPyjDVHRvWfT1rhR+Gj9Ia7HgxT2m8kJjdmyXhvSC860vhY+Oot0byK0m6uTRThAmAyQ2JvgaP+qE/Q3wY= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529328; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=jQa+d6xwRxy5WvG4jIfj7hMRpG3HkL2h6UH+aTlgbd4=; b=hfwwwIXe3nKqGYcixLrRvff6SBB+WAjOfX47U9QfiUJpI3qUPMB5qp3bYtCAFob7 I8f6r80n0Ri1Oj60lLXVVD//Cxox17R9/Vh1A/9EnkgXcNqbQNMBd8iRIaNBm/Bflg8 erv8WvBc+muxuE1BruzMjOkx0inz5uncisErA9CA= Received: by mx.zoho.eu with SMTPS id 1773529325618279.67470949743495; Sun, 15 Mar 2026 00:02:05 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 15/17] lib/bootconfig: validate child node index in xbc_verify_tree() Date: Sat, 14 Mar 2026 23:01:53 +0000 Message-Id: <20260314230155.155777-16-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" xbc_verify_tree() validates that each node's next index is within bounds, but does not check the child index. Add the same bounds check for the child field. Without this check, a corrupt bootconfig that passes next-index validation could still trigger an out-of-bounds memory access via an invalid child index when xbc_node_get_child() is called during tree traversal at boot time. Signed-off-by: Josh Law --- lib/bootconfig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 0823491221f4..038f56689a48 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -823,6 +823,10 @@ static int __init xbc_verify_tree(void) return xbc_parse_error("No closing brace", xbc_node_get_data(xbc_nodes + i)); } + if (xbc_nodes[i].child >=3D xbc_node_num) { + return xbc_parse_error("Broken child node", + xbc_node_get_data(xbc_nodes + i)); + } } =20 /* Key tree limitation check */ --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 336973909B1; Sat, 14 Mar 2026 23:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; cv=pass; b=RtRAoNfMeoqVeHZzloYPDoONYOP2qCMx2Cc0MGt8p4QunKGnMxcF45fOQW5Ptlk4XEdWfM07mei/y4FWuAYeD8s9PqXbX3jgd0Q4y5OKlB1wVeLHHVbIlP51PViZo8UGMqmA1W+5RdZ8zQ4R3THUGxjeJxIJ97rFFC/6YwVTJU4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; c=relaxed/simple; bh=V7ReOpjvgKpqLyMe87lV2El6zoCxd9xHdzcToswP9A4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GV3KqOHEV/ZhHdoPpKJ4t9CnTGwzy+HZAbYozilG6bLihEnG9vjccfpLjn9IN9IxsAzc5OHkCTGEk+Y3HpuDKS13U7+vgJfQr/l1b5iQdtqgppzs9YvDYaHcRelT1evRcSyZX1yxX8LlG9vw0XSV7kJvouqa9ZvYOsgTlti3Gwg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=KczknU7D; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="KczknU7D" ARC-Seal: i=1; a=rsa-sha256; t=1773529328; cv=none; d=zohomail.eu; s=zohoarc; b=MuoJpKfseca+d4EuijvxY9jtiXwHjlINhuaflPwRzV0LIrz2tLZ+irBgN50JwGehc3fkGPaQBVoz5BZgDwOUQqUh802TDreJ0gO0r0AQOBIA0MTOfoLLeA176OD83VHHvY1lEJHPnpZJkhsVUabwJEZEHeDTBJ9XbCukfd/Sa5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529328; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=AWTtpdsy4qWl6puGZW7KMyBkMjPa87avwV40la3Leew=; b=k0TfFEYeUnp+tWvOc8UjXyL5KLfruXAeJrOUwUDhhdn8QyAI1fTUpKAljq1vfGC3OPz/3fCuuPCBh/dVf7K1IL8zjmbIrh+VI6q1FssGXUDY2HOdoXZeQRJ5y5+XeRuja/6J7E5dq0P4BvkfoiOsJWqQl3CaG0M0THOW3BB1gmE= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529328; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=AWTtpdsy4qWl6puGZW7KMyBkMjPa87avwV40la3Leew=; b=KczknU7DRzr+KG4Fzf2DmsV1+fFlGIy4odBWuijEx9sF9U1UUvZktqPgJkJzu/II 3WkEOcqnNtzW9mygGNVja697lkKtEIcRJIzUMsGwu77fc/IghGyxMisPGaAhTGsnhPP l3alkJMVsD4j6JrcUdW9boBEIkj4B8kV2ueYNN9A= Received: by mx.zoho.eu with SMTPS id 1773529326162947.6157472151848; Sun, 15 Mar 2026 00:02:06 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 16/17] lib/bootconfig: check xbc_init_node() return in override path Date: Sat, 14 Mar 2026 23:01:54 +0000 Message-Id: <20260314230155.155777-17-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The ':=3D' 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 ':=3D' 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. Signed-off-by: Josh Law --- lib/bootconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 038f56689a48..182d9d9bc5a6 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -728,7 +728,8 @@ static int __init xbc_parse_kv(char **k, char *v, int o= p) if (op =3D=3D ':') { unsigned short nidx =3D child->next; =20 - 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 =3D nidx; /* keep subkeys */ goto array; } --=20 2.34.1 From nobody Tue Apr 7 07:29:20 2026 Received: from sender-of-o55.zoho.eu (sender-of-o55.zoho.eu [136.143.169.55]) (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 5B9D538F634; Sat, 14 Mar 2026 23:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; cv=pass; b=NL2UagwU/tVwtZwq5EXoBdaeK6SrrR35VGfpynGrz/iL7Yq3Zbq5xrK1ESc5RNwEhfjmzBOuC6wLZ6iq2wHVyr1QdRNueao0wLlwsZWw+ItfMj9S72C4VZRYJDIA7ii2+1AmcY/0TpxzI1n+/eEq+8zKcc6K/ZQlufUA4+M4tX4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773529337; c=relaxed/simple; bh=4hvIdsyU/LaVH9Cl+UZr7yonHlF2t2i6TR6b+vGdeIY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UwwGUw5jU9OTJqT+4Z56X7gdHT5+DTDEP7DdNSP77QklzDZi9USCKtNUBRtiCqf2UGfUktGEavuHMcV9gI8HmIm6iXvx/0brw20Kz2l16p1qksyXUVPwAD/+xaCYyEv9GII7vPLhqUajPr5/x8TUKW0r0i6gIDHxTzgAXnFhAa8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=JW+ZUJGw; arc=pass smtp.client-ip=136.143.169.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="JW+ZUJGw" ARC-Seal: i=1; a=rsa-sha256; t=1773529329; cv=none; d=zohomail.eu; s=zohoarc; b=kMXz7kgQEJpPvK/4x5BTloXSp1BIlCKhpRwJkvhjjEN2WTW3/CN3yIJWLT4bOkw0Y4Z1MmG6Cai7xXRNogXX8lanZjgsk30yLQ+xkCPcJk6wRN8/vkZFPidIbIR3draQLMwNJheHXn6/qLOw3gB6NBZwidW/fyvd3xeF0lVeh5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773529329; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZmbCE6oHGMaPEvykEN4WTjS/8fklO687Fi9eR6U7ss0=; b=AeCEUDTjxsqdSXk8rXnrI0P3df4aQ0QOIKco0gd8nRHJumnBKinitBwj6GHwgzxGouuXTUkyc6JYP8f1OqoXEazU4QPwk0SFPe+D7szAPf198LisXoRsBc+7nmJ0jNxloQg5VTur1+VRIMUIy3kog6JyDc3QGVUxsOBiIdI8b/8= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773529329; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=ZmbCE6oHGMaPEvykEN4WTjS/8fklO687Fi9eR6U7ss0=; b=JW+ZUJGwDqjG+GAWkofmh90GOLKs6FS/c/+DUe335Z92TLaumLKA+9dVQ4EF5qfW oHtPeJDnXvJu27pDIl4Zp0x2UQ4ykF33neb1dCFrh1mG66nI90J+JnqhdBeSXZz8jB2 OzWls6VtvLzZYsYEI7IeuqmLtrGI17VieOguguPc= Received: by mx.zoho.eu with SMTPS id 1773529326700324.3068439281609; Sun, 15 Mar 2026 00:02:06 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Subject: [PATCH v4 17/17] tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure Date: Sat, 14 Mar 2026 23:01:55 +0000 Message-Id: <20260314230155.155777-18-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314230155.155777-1-objecting@objecting.org> References: <20260314230155.155777-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" If fstat() fails after open() succeeds, load_xbc_file() returns -errno without closing the file descriptor. Add the missing close() call on the error path. Signed-off-by: Josh Law --- tools/bootconfig/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c index 55d59ed507d5..8078fee0b75b 100644 --- a/tools/bootconfig/main.c +++ b/tools/bootconfig/main.c @@ -162,8 +162,10 @@ static int load_xbc_file(const char *path, char **buf) if (fd < 0) return -errno; ret =3D fstat(fd, &stat); - if (ret < 0) + if (ret < 0) { + close(fd); return -errno; + } =20 ret =3D load_xbc_fd(fd, buf, stat.st_size); =20 --=20 2.34.1