From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 6405E38AC7A; Sat, 14 Mar 2026 23:33:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531237; cv=pass; b=tgjTXp+j4lYA/pqeiaPQVYaovOtv3+PJS53HEGD2esTDNfhEA2SM6zTyKe32Wen1E69z2klzGjve6WhsWD6gE0WCFwmOJnhc4BjaUI7osuSWWhIcx10YcyWZTdjwxB61SifweNmujXZDfuSRJZ447qUtH3Ra+xq3atb5lQ10Zh0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531237; c=relaxed/simple; bh=Y9mfWQWziz20z1wZlyGCqiydfBbJQNFNO/oywEYrkow=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f/7BipYhWphSJY0ocG9UQ0VcMnwwSBs1H/BtFtEuDvQDiC95ICsUAYMrPMhxRf3SJ6i249vWrYOxgXX+NPELIsEFI4IqhGgXAAiMbhXVIMVoc8hZWgfnRhXy5ZKjjry9huXLXVUN5jECLQZVgCm1ZmtXFaS0JXUtAQwda6Grf9Y= 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=HU1fmhDi; arc=pass smtp.client-ip=136.143.169.57 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="HU1fmhDi" ARC-Seal: i=1; a=rsa-sha256; t=1773531107; cv=none; d=zohomail.eu; s=zohoarc; b=W1Qgo+4Lp74LECw8K1Apcvhqkr6wxf7KU/ZkPJ0QjSvsbMq/TyIIuwW8x9j6ZWo4oSyl683boUXhA4nT13QqGnDKJ6nboX5UKMgDPjtibM4R4SkGjGxMSEWsQowyqkCUip/WCFRZb+fj3BSIaQdY1c7bZRcDOkt21oakwbeRBOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531107; 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=HeSt+EE2W1y2waarZiw9TWssCv5UNHc4XLYfo/t4qZmMEeUx6MLwgV5RFQGI8yjWGji07xFbSQL4SxsWbkUJtC92aMcjB7me9WZnszC7HcULozTIjeqcV4I57dcWP60KpW/CDsl3n4r5wAXppxzrbICFwtRyCXhm4Fjts/xem/M= 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=1773531107; 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=HU1fmhDic8v0jfKGC6SSF9n0NWODSHI1no51QxFS3TUM+rU5OvhMJnX7Eh4AFTBZ kUkg92BnKRTxdBsNnrub1T3dKXSMvc7yIvn2DJiRFw0Wy2a2oAueuWLtIJjgaUmBlo7 YV0fWMZ8ColmZerQJz8VgeOdPAWtrf+iw6hXFoa4= Received: by mx.zoho.eu with SMTPS id 1773531106259112.30339605381914; Sun, 15 Mar 2026 00:31:46 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 01/23] lib/bootconfig: add missing __init annotations to static helpers Date: Sat, 14 Mar 2026 23:31:22 +0000 Message-Id: <20260314233144.187273-2-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A1AB738C2B1 for ; Sat, 14 Mar 2026 23:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531131; cv=pass; b=a+Cwrj6IHd+VKI6/FXwXHbQ7XRzS60DSazlkx57PclRlz8DJvKDUxXBcB4JDetG84T189UjYdznllJEvw5Ec2CfYrY0CqyilgqxjYIG9ors1/9WOISRHRo0cUIkdiPRnZVQ7RRyTjFntpp+X+afXUKNWhDYukleuOdrCBI8Z0ZM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531131; c=relaxed/simple; bh=6DWvwelCofWZTafeeOC+MPe/vsgZVKorf3Yjc7Dvl8o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UziCt65CDIBASKe33TJQ4FS7hS3B2bw/sJAiLB0VoYTqTSWIkp1meCuJHK650rJN3JwwOfMSNv58KKXBNdZSrKieqhPRQJ/MhVjKo8UG7ObSahDMw/fANTnqZGJdGYVVvkNfNAlQ8SSzRDRWo65iU2l9q/VVmA+zrUAvSNnYVag= 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=b6537lRX; arc=pass smtp.client-ip=136.143.169.57 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="b6537lRX" ARC-Seal: i=1; a=rsa-sha256; t=1773531108; cv=none; d=zohomail.eu; s=zohoarc; b=NrnPBRS29Dg1Fmre3ddEbUumSpv2yg9nJ02qmwoLFlieGwUrvaA6FiNP8Q5M8sWzJ578NAtCBqN0cXv+opSV6LrEa11SuSnX8XMy+BEw3C6on1vOB4Hig6s5BMnouvdRocd8k1Kk68pvU2nA+hOK73B8LGMoO5ip4v4vmzrHc5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531108; 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=B8uSMbqfd1ALEtERkQVd6ufQv1Ac3z1IW49yfC6RNHOfm1eKH0ZV8MTn1BalsTfX9OidwzAEdU9Dc9SllwpOLx91FQUndc9Pj7StvOL7KJTCn8QNRV3DIKMwBRlm8TBPi1HJlGTmbMuZJp4eJa1lD4jibAVRCWfifMWSRYRdYEo= 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=1773531108; 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=b6537lRXpSuiNh5apOfy31XZP9taATTxqzLmoH7KfC+sIvx4aTUo2E3LDXKhNYrP A8th9R13+jy5HtMIWujJgKAYFANw7d63XPFBNaplVlMLgjO7HdW/anQtjeh8dkvwG+u Nvx1MqrPibL896Y/ZLwNLvZOx7mqfU8LafzpiXcw= Received: by mx.zoho.eu with SMTPS id 1773531106802632.4046790401114; Sun, 15 Mar 2026 00:31:46 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 02/23] lib/bootconfig: fix typo "initiized" in xbc_root_node() kerneldoc Date: Sat, 14 Mar 2026 23:31:23 +0000 Message-Id: <20260314233144.187273-3-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 B3764378800 for ; Sat, 14 Mar 2026 23:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; cv=pass; b=u9n4Fesd6PGnRfva9H6FLPCrRDFEmdD54HF9VvBiWkl5W7d6y8KWks3lGb/evErAtM7ulS7/ZP86GtpzDRDKgwBFeyLyguoz459sHxDZpAPbeJdS3c56BUffgaPhrmxGCIR0CwiUT/cryvMD5Z02o+uSF8HpYAhDBuBqhX+CRFY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; c=relaxed/simple; bh=q6VgcWVV8ArVaK6l3wnAuR1kW+gcsKwKbYy06RDfTOs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZdHM+8DCzTrx/TcaXkeUjB+xv9wAkYkEiPOiMWQmCrhIvuHKbH+9j3DlDhLBU9gdovrZdCOytrOYQqdQe9Ry2AxCGSV+K4Tyi0T+uFvTnhZ9v/4jT5Ev79VZ8QnJ8U3egxtO/C7KEGParInJNhQomHPe7InagQC1+yGcXQT52K8= 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=mJkuWQQI; arc=pass smtp.client-ip=136.143.169.57 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="mJkuWQQI" ARC-Seal: i=1; a=rsa-sha256; t=1773531109; cv=none; d=zohomail.eu; s=zohoarc; b=fnnkA9pc5dGPtxeAeTGq1iQYemP8+M0M9PMyN0XtiHd4Af02frDlyBek+hid5bWupJVd1EnlYVuz/t/bgK/kpQ1LVtcJdAvSAiR28/EsV+ibnYz14bIyV/xfw+N6ftnZ75lRd95zuyPbGhJRwe8yKb2n5JBVkx4eTCh+2swccSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531109; 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=YdNjBlw3gzKuNKv1zbwyQKIumkpHMd95e8tIDcsbmlgwaN70+do+kkqPq2W2jCTr8txi7TwbhqbCstZxXhPbVauJ+aYASNttzSVw4UDqv1FhoYzbS3vJnyegywHS6b94ciLlB+NrrYJFYYeG4sUGObwRJulIraORQclRQm+uhj4= 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=1773531109; 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=mJkuWQQIaD6lEqY4urh8HuX24S3nenrvJ1FtG6pCVKW3rGZMDgi2xtejaLuwzUxB f/c+4ACBFWDt0bLXuqx0AXyXPl/gVtpPRo3W8frN3I8CaKKgJrJww1lM5Kn9b8UdaVe K2CfSs3RH4qkz/itHOxXZVfVrsUAhmgXaWfa/AnA= Received: by mx.zoho.eu with SMTPS id 1773531107328536.1014627594224; Sun, 15 Mar 2026 00:31:47 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 03/23] lib/bootconfig: fix typo "uder" in xbc_node_find_next_leaf() Date: Sat, 14 Mar 2026 23:31:24 +0000 Message-Id: <20260314233144.187273-4-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A1A2938C2AF for ; Sat, 14 Mar 2026 23:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; cv=pass; b=GWYHCZ146VikPB15EF6qSLtKyipeEF7K1Qr0Nij4MN4XH/O5zdOi4ehdzWCuzM4tou4MD4UdG3gGRJi5gkibjxRfXPM9z7tDY8XvY2I/LAUyGN2qgko0kGN2Omql9mBqQh5tmIUjPuxOS5G0nDbrLk+vf5+jFUe7arRytP+GcYE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; c=relaxed/simple; bh=2jZFhcm65pVh1my7aFVnxTPWIZ+otcDP9/Gf4KWRft0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SeA4Oy5TZEOHoQwmP4Haw71ha/iDMzGqj7oP5J8RLt0dFYUENP5nbdOP2bC1rtboB5HCEsVwjERau19Ez1YUyGXZZoVTozp6uYJi390sIusbzsgdjKMOryEosH+qjtA0xSrhgfKKC5qv7GWXmsxAYfqPWm5jD0RzbxVMBsAaGNM= 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=LmYHNEDz; arc=pass smtp.client-ip=136.143.169.57 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="LmYHNEDz" ARC-Seal: i=1; a=rsa-sha256; t=1773531110; cv=none; d=zohomail.eu; s=zohoarc; b=fPTShrVEZFH01B1Yi2nFL/ch8aF6L3O3HRTYprGCeCbZ4+bB8y6K6POdWDFERD9s3c4GjKS6vJn7C/3KJ7kv4ZQvssbHiggbhZvzZLVwt9F84X9/aSmPqMotfWBnvGpLEvpEf2REwnHRGRYvvsuPHo3p0dnUC0hpWq2D4MQ1/iw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531110; 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=OuQ3AqNAuPBN43fOEdqHaalb0+9Zyg5Ocz27WvcpCyEvPekTrSsBh1/uk6EJuyWOGd8TrJh1TLm21H8AumNUBmBBukoaulMYOiyN4cV6wktLAdF7isiOL75wKGxpIyUcmTYf9q+CPyo2g+P6Mgnom3441joPnw8tpil7nn3Y96c= 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=1773531110; 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=LmYHNEDz7yc/FGbmG8jfJy85KZpp233pIL6UjCLUwUxplyT632GnQfbCQwkdMMGd Q8CohF+0s1JfD0/HIkI+FU7j8/HFvknxEJDlRewH6xlGn71yi5WcfXgYgYua5PYOGXt a0XAEMm5E78YT9ZLvSHKcH3wCW2/mDY8WaJmf+ac= Received: by mx.zoho.eu with SMTPS id 1773531107838857.2882704036346; Sun, 15 Mar 2026 00:31:47 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 04/23] lib/bootconfig: add blank line before xbc_get_info() kerneldoc Date: Sat, 14 Mar 2026 23:31:25 +0000 Message-Id: <20260314233144.187273-5-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A1BF138C2B8 for ; Sat, 14 Mar 2026 23:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; cv=pass; b=c9vGO0aiOxMsOBPeyQL60zfmSMIeQ/P0IPpALmbcSi8u9S6+VVyd7QDsvlcD3QkShr5ajl61nuZVmxn1csmDuiUGn5nZdKNA2T5k0phL3oXzJWbj5IWnBIzV4gEjbE5UCprjviS6B/v0RzU6ogIxqCnEKlbCHEkMtpnUwUKi3/o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; c=relaxed/simple; bh=Ca2yOMLol0eXm8Z93sdZF0uzxBHDnoJJ5YjTb0UjCSg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fdZ84bCprP8ljN+TCSMZ2UVBG+ETpJDmyn0wP0E32h9CKPvVFmegGjJnUk+2uW7yJyTuLayp6qC5+pvPwtikWDGdhXldeI62c0FqYoBW8aSkfxNJT5ueN0gezvUsk/aTKG2NDDU2bsmi42+mvbBG5TTDMaA+MPK79n55Voha1wQ= 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=hW1JAhZe; arc=pass smtp.client-ip=136.143.169.57 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="hW1JAhZe" ARC-Seal: i=1; a=rsa-sha256; t=1773531109; cv=none; d=zohomail.eu; s=zohoarc; b=hMZSA5ESQ7mBhRBd5Yo9LS/ET6xAXilp9UdxWHug0cxKCLzEH8SAbff/Md/Z7RnZwbyHTRzq1+cC8KDAkSPDMUEALFGUBjsDmQLEyRP+3q5s8okPXfCP8nL5fpc8p3+LDWdnLw1iXyykAkJVWHRyF7yGDPpYiIW6zKspnwSUxV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531109; 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=LBtjrjmLhJbXErFE9pluF0ehnG2K+B6aR3cJZCPkSII7XTUND6wWZdL/BJ/8j1/ZSLb4fRWfGbSLm33lXcfkziC4fGUqOsy7+xTFaUKx5nKx6fH0zvMdVR9gUiWx/F4Xz2LIO20HAfOgTbmxOZSXUBHooJpjglb+v1wz+INg7qE= 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=1773531109; 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=hW1JAhZee2gLVD0GNUtJtDkgGNdFN9hyZrJImVMwGam2l/VLF6Ncw6+SO42m60os hbZUHP2YR0Eegx0Ar0dxIU4x10l1DckSTRq1blytbSy1kYqSN+Qwa930JXAx8IMWNxk 6QqQtBZ2jreGDe9rYqwwFtKPi4AN1iXkRO/qFjCI= Received: by mx.zoho.eu with SMTPS id 1773531108321498.7403371186034; Sun, 15 Mar 2026 00:31:48 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 05/23] lib/bootconfig: fix inconsistent if/else bracing Date: Sat, 14 Mar 2026 23:31:26 +0000 Message-Id: <20260314233144.187273-6-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 6CBB238CFE8 for ; Sat, 14 Mar 2026 23:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; cv=pass; b=SC4OH7QAt7JTKSSCmMszcxLOBLhEZRr+0Of977Eqnh7Z47VJs6Ui9MASnKCoJx3jKfRWjtegrRPR+n91uu47y+NWq3mo9q+2MBrA+j2sSbnEWz85jGPAzbHMQ9f5UY3f9/aMAX+1o74gp0AN3j4nYVorEPk1WzBLEDa3t6r8WXM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; c=relaxed/simple; bh=DRP0bkR7bPm24iP6Lzhg3tEJBN+s2+Bet778OjDqUXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LHOi6QDkBiKMMXG+phhrpVd06lPSzVX3v41GyENJUTFhYl04KR4q2/mmJChNc+7TfNn4xYprorU17YhhqgX+TnCflEy3OJpUpBwTW2VVXBJnmtkvr2K4HLARpVSSYRCBGblphYMCfKzAUjHEPbLdtkQkcHjGwOl4/KBN4e+JE7M= 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=YWHtNSm+; arc=pass smtp.client-ip=136.143.169.57 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="YWHtNSm+" ARC-Seal: i=1; a=rsa-sha256; t=1773531110; cv=none; d=zohomail.eu; s=zohoarc; b=WcKQFweUWijBt2SvRxM8QRXyWrikxHh4ZMSGo/dhMW1TP56KZKklnBwK2GlwgDz066zwby6vmwIkeTWxGSify5cdGN/bexzEzZyZqElpWaNxIEKWFqf0hyWDdI6Gmv3S3CDE942H60HLoL/fTXo3M615Ta7jBNedEKbgdEC28OE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531110; 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=hyEldJbxHhQj5WNDqTZSHgiQYBVclqURR5ykH3ohP0T/4GyHUJwCE9Q8WljR972bosnaz/H6BxLR2RsdOVjZu2ReAMyH3Ox3j5GtwSkRB0nKcwzbB1J3Ooy+Xmh/5ut1L4SWCvE6/ZBYVlS6S8p+/BGvFKK0fXeJy15KL0YA0Rc= 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=1773531110; 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=YWHtNSm+vJ7glu7RIRgIS6SCSRj1mTkgCAiFT1Wgtg+9pqKBLOAnRVbyzo4DTQjO yfnwZz3b41fplv/xzgDPlwD75WsFJUDseYhquxdcKRstbGwzzVpDZQ7Xld+prbUN8eL Ivd4ah2CrjwQ+XY9Q+INGGSDfBzRooRyhP0h3RqI= Received: by mx.zoho.eu with SMTPS id 1773531108799283.4619488222643; Sun, 15 Mar 2026 00:31:48 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 06/23] lib/bootconfig: narrow flag parameter type from uint32_t to uint16_t Date: Sat, 14 Mar 2026 23:31:27 +0000 Message-Id: <20260314233144.187273-7-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A1B6738C2B2 for ; Sat, 14 Mar 2026 23:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531131; cv=pass; b=Ip0x6MQ3a45QGiXm0DLyw1akyeWE1hZqgwizEzC9C7CPCvFyS90GDPxbAnAqCWsxSUVECOio94cVFfDBu0mKQNK7QyFo75R+pPt3BrCAeZNwVlpa9L98C5Bm+yZaoo1gYRejX3B/TPLzytEQeBsPah1Qt7WBUkhxJgfVy4h7a0I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531131; c=relaxed/simple; bh=os0B7i8CIWcvtr1f+9MFrDH43djYT4PHUh8qcbGqh3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cwu4UTXdOOiH/wrNGd0ldTTkq40WxLAgbvLI1uqDbdzjxXBVIhL0sOnacvoO/Pnm5B3XG8ztXQJOzyygq3zgivZJpdixNThpGGt2VsBcwyIUTt3ZUjZ0Ay3E0aL6Tk9ruI4s0vZmFTVFd3tsRJoIS98YOdKWj3pNu1yQnIn0ScA= 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=FfYRdYII; arc=pass smtp.client-ip=136.143.169.57 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="FfYRdYII" ARC-Seal: i=1; a=rsa-sha256; t=1773531111; cv=none; d=zohomail.eu; s=zohoarc; b=PzSEk4ReaGsA8YpKLOme0uTletY+ycwljSvND+mh2jjga8kELt6ZFXyfO3YEIczJG/LJ6b+00YZNmoY+1Q2142YzQ+2NlieXQT0zdEiaF9CQogNUPZ2/8S84odUKYvQrTsiUBPx49irTSpxQhcmsSXNAcF+0awTjPX04YZ/xjFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531111; 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=kL9+dr2UfIG3ckWn3u0YCCHhhuXT6jy9H9meBO5f9JI3oW6kyuccBSrX1q4IqsrR2iyzv0Ko1RVkTZdSjLVhlfMRx4zRaaxPtdE5jbBpwJAhWtk6nfP/jwsN9Y52DKA2uzf8xB4S0w4yiLW1LTpQH5naSRCCZqKlzj6d61nlge0= 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=1773531111; 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=FfYRdYII08HyfVUdQpFjD8jArYnQvW2FgX5xSq9h/LRICGN21MctLqBfbLQoUIqy VyceXGJCZyRmm1ML8QVAsLH331dTO3Bv/tA7G5jgao0mYM5xILmZxmw94eed/63AZrl 4rJ/zsq1knpGu7lqRqogcjobadQ+//fZZ2M/4KRQ= Received: by mx.zoho.eu with SMTPS id 1773531109260908.2127530925259; Sun, 15 Mar 2026 00:31:49 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 07/23] lib/bootconfig: fix inconsistent if/else bracing in __xbc_add_key() Date: Sat, 14 Mar 2026 23:31:28 +0000 Message-Id: <20260314233144.187273-8-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A27B138E130 for ; Sat, 14 Mar 2026 23:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531134; cv=pass; b=Hs4NPIvAkkwz4mnXu+Q0cnGzC4mrdQ6OX7kfNnZsCUYLfn46Kedk4959934Lc/7N9w885GHyXWcBTQr3AEt6ZPhqoYMGAT1lsPDxbvqkcDC14g1g2g+aQw83xuuKoennuPXY5bpfSMUVhl9426+4Vt13R4HKGi2jc7OLyd6qct4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531134; c=relaxed/simple; bh=Tcy477qCr4zjwSxEbmUVpzCk/GlV5mimINv1mxGanLY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hGP+u+k7BeV3a5YgM2wIpUjChYWO0h+IpMvajC9QJE7ZoITupPNYTGnwFYUIK1ZZTG2fmjCra1jd+v9r4ITPUQwCFidYlxSRLRNV0RnKe5zEkTuKau4TfhiyJlfxuy1FBz/eIgS7OynWrPcglfueT0v5J6qxSS97hIByjZbmzpI= 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=Tvl7aQKa; arc=pass smtp.client-ip=136.143.169.57 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="Tvl7aQKa" ARC-Seal: i=1; a=rsa-sha256; t=1773531112; cv=none; d=zohomail.eu; s=zohoarc; b=BWCY2u756rJWEOZyey3b6FFQ48O/FoAVZbiMTpOP88FXBPHoN+zFK/GHMv123jBoPkFzoNzXI8Rr6YEKOweQiY5nHE/Nq+/DBt+sD/n7/SWkiZDiONohcWsjeEcKIumSZJHUcAni6Oe9AsjWz2QZtFAsJ3N/pXvC8bN0IY0lDxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531112; 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=U6rnsuoTX04iSYlDJf9t87WxG+ms86Al17zev76256/i0A0Cf02947gMkag5vUzPp7CZvSFXOLVY3vuEHBLSIWPiZIh/pldPk2tLk3TCZo/7hroJGLmNerEihNr9nRfYIO6dArI/1eyKBErENXuQBikFf2tqBvxCwE8maJPY1pk= 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=1773531112; 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=Tvl7aQKa722gMcZYpTrz+6FHU9vlmyO7gnavXYRyvsOoLiTXxuDJIDbd/Q574NkP Q3wgNWgEw2gN36sSBV/Wrd2iUXKL/R+rHRVLblJGLnxoFpGQvemps0yymlNPdhV5Oja q7ci6leQ3wbh+30xgpmqc+0Nk5UhtvVV+FehRGBU= Received: by mx.zoho.eu with SMTPS id 1773531109785703.4886853322048; Sun, 15 Mar 2026 00:31:49 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 08/23] lib/bootconfig: fix off-by-one in xbc_verify_tree() next node check Date: Sat, 14 Mar 2026 23:31:29 +0000 Message-Id: <20260314233144.187273-9-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 328A938D6A6 for ; Sat, 14 Mar 2026 23:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; cv=pass; b=T+BIp2GFkJjBeuMHzHIDZ3ElpbGesqML9JQTCq4Vb5u1XXBmTVYHy7MLVDV5gcrJ2bjTwXDIUAk1GmFH9VwYCBPb5bgIqGS87tb8DvP5y9gKWlGC+LDSHMtWtnoL4prB0fJnkR8T/zUpq9pmSDWrSHe9ZRm5Hx0N8k5D1NQkyQM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; c=relaxed/simple; bh=43QmyCqjwfaH2eT1ZEPKdFGorS2/96CvQZYCl5EDh84=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pUoN09KuHhwcVDGK5NPAAHbn7xzYUS6PR2tqUL/eTHpYn33WoMin9hs00G8a7cXC7q1jdDXvh70VGd4GYPgJki2ueH/SJqrGWXjCiaO3WmsEBp1uczAV5R56LxFcRF4x5VT5hNu2shpD+dMC40Se+VhnOol6eJa2mUsSiLIWJcg= 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=Qo83bWZf; arc=pass smtp.client-ip=136.143.169.57 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="Qo83bWZf" ARC-Seal: i=1; a=rsa-sha256; t=1773531111; cv=none; d=zohomail.eu; s=zohoarc; b=TpceQrG+krriAPhMezAyQggA2hvWcFfBtoiAK4L14v1Uz+seeq38DXcJisI5haqTRz4yOvzY46BtF050WmRcNKHMoENoiTHOlIrBRzzik9QcgPxHOcW4o9a7PWNrS0XeCVIjJUtXxFJX9jjVtwowcZ94xfPwm/VLT5tgYDloevo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531111; 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=An0rN8aysCKT7kaCjoF8Or6Dy+X5tnTASkGrbdsSR5L3Wcp89dSNuFYloAw5wQ3lWxQolh9OZdIrV+baqKYZZvd8XhfWU8emCCp0qUhlc0U8zoVQj718RApo6b+P9yTVSudi+lfuW1Zozdpu/5ZV+W43vZL+35TkwSDOQZSNFnU= 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=1773531111; 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=Qo83bWZfaFBr6K7VS+AcoEI+cJiaGC7zl6wAmj9WrsHMlXXyitkCT5iPAtlfWNv8 za072yGVNEuoeUgaAbQ8xsqap2RHUdgP/LJRjZIdulHQ27hURPwaKPxDY/VrMWCmS+j Bwz7qgHhzHfA6dughX6jr8GYPs7jBAePYclWUqvU= Received: by mx.zoho.eu with SMTPS id 1773531110269803.3104059146178; Sun, 15 Mar 2026 00:31:50 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 09/23] lib/bootconfig: increment xbc_node_num after node init succeeds Date: Sat, 14 Mar 2026 23:31:30 +0000 Message-Id: <20260314233144.187273-10-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 6C9CA38C42D for ; Sat, 14 Mar 2026 23:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; cv=pass; b=cDOyJDkuNznEl986z4Q3lOGTXy2nVvPBbe11bI6Iz7XR7LKbcyUJ93ej6qjG7fs+YCqQnnqZ7uj92kBoIM51YeGNJksMTO1919dCAeZeeRWk4ukMuQPzOVn230MRVhOtcREuxvL0KpaH5SK/C92dooR9h4Zxtq1OBJoI2vJ7fLA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; c=relaxed/simple; bh=EWCRpZBNHCZU8iztguL/vt47WImiwDpV31hec4mL7Lw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gA/WrmhWl46fOfVHlrWLGrVvu3+QEGHQdnFydsdH2zfIwgV+S0sRobiFs/vhNovfu39Zxmc3n4i0A47ZvVB0gq0jDtmV6I6lSOrfkaxsVmlyulnLFyBY/I4pKWd6YdDkExPL8AU+FOCPrDKPOtgkL0unA/IySsytjHp00+1JVqk= 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=jzd05A+y; arc=pass smtp.client-ip=136.143.169.57 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="jzd05A+y" ARC-Seal: i=1; a=rsa-sha256; t=1773531112; cv=none; d=zohomail.eu; s=zohoarc; b=h+jfA8RKb/1u06doJpxSqRQj4qnmHsYlHaBakczmZOFCZZ3sxm5ufUiwin8F8RSbfPtxccCJIGoZXf/BAUHVZMVh0tFjEgjWX2tvZ0YN7MX8xDQOpY2sSBXnlZiUoHTwpHSLYFe7GrkT12FmxWB+dH5yier1iDFGya7JVEX14y0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531112; 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=gb/RAkniRpBE+KFJ8n64OHLTqJQ9uvb4mIs1Ca7IIvAShosECXX1/1h4qqVD+Heof10nQnPHjnE5VD0CW0zS/EVFsfJ4U28LFJaamH1uwbIsUXWlwc2AJrEDYZARoaPQ1syNCq3bES9uGUPW/ynCC9m7clKwfghZJqRu4tEn/e8= 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=1773531112; 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=jzd05A+yZrWf3ZhXra07dSt8C2iEksG3IOauAmdB4CQUxUfNaCzVnsVobvGwLr5v U1EL2fowdh3Q3axXbjs30oa6qjaKtFPmo8FzpUPC6UCtr2oFmSI4Yq9wlADNCPFkFPL wrUyBllngJqxyxmvzR0erTIFMtzortzINmQ+lNlY= Received: by mx.zoho.eu with SMTPS id 1773531110764519.5091208133796; Sun, 15 Mar 2026 00:31:50 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 10/23] lib/bootconfig: drop redundant memset of xbc_nodes Date: Sat, 14 Mar 2026 23:31:31 +0000 Message-Id: <20260314233144.187273-11-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A249E38D6B0 for ; Sat, 14 Mar 2026 23:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; cv=pass; b=qddKazLLT9CTKnu1wqtLcQI8PPlG++rkWvXjF86SAk4iuxhTitA44hMDJKGvppp8JNAQwaPunHvdvT3Q0vFCZ0odeM3Wq+N1EKi3cHhLID2Brfp9iPlZuEuvYYqF7GMvwbcp3OgHBz2FFCq97SZifyLzJzxlvT00hCBf463bWj0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; c=relaxed/simple; bh=FXNMbqg55SqbPOuJegAqlqm+AJvfK6co4zCLBLrw5Q0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K/Ni5hGTj6BM8hH0RZUZ0zqpzac1XeY93AYp9XSeLfiEEuwoGxHZ7b1wP5i/x7FrTgNUVcvuBkHL+fx23CSKsUMUfU/ZYxjuuWiJ7Pshcx6Pjnnn99AP9U4nDA+21t3ZQXLTwADnK9F6o4i/iQMjvURgPgKb2H1vCtPWv0JlKjc= 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=W2tSOsyv; arc=pass smtp.client-ip=136.143.169.57 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="W2tSOsyv" ARC-Seal: i=1; a=rsa-sha256; t=1773531113; cv=none; d=zohomail.eu; s=zohoarc; b=HJx+/wAjF1FwjSlTRxQU72L9P9H52zWX91FfVqdmGWFypV2C8L69zAVcUsStFZWpRUCYXlYjjvXnltzTtRGKhdcOjymCOphiPuqqBkKzBY71zMMSSR/riQAHgj1Idw+N413/HoQvJKZ18yfZkYBBjXQ8Lpj/Y3Z4qlJSKPt5YlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531113; 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=fo1uVUM1eEKl/bNm+AcW2ukLxt2I1WSw6xwwY3q2XJt52rrQ/D1GP8S4Ci/VAEggW/b+fiuvT6lwlTWxQbXhfaSwkDeIaS7mqFOhiUVwQLkqLRC0EKy/iqbMOr9eyQ6PY7KBy1qJYE7iHktRllO7EBWz9huEQns7IqjXTjcte7M= 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=1773531113; 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=W2tSOsyvt99z88vEL5G/UbQJop/rScxUQWH9nxhZ5sMMQ1wjQks2H5dwLRVH1wK9 0eQdUq4nim3UZFd8yk93xlwy1fMLcXKmUhl88F4wQvP1/Ye9GM3ScXpLynKY6uO9JKR HVjllUM71zj5ajBVWFttc80motl7AimkK+4sjp9c= Received: by mx.zoho.eu with SMTPS id 1773531111299626.1583483874036; Sun, 15 Mar 2026 00:31:51 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 11/23] bootconfig: use __packed macro for struct xbc_node Date: Sat, 14 Mar 2026 23:31:32 +0000 Message-Id: <20260314233144.187273-12-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 B3888389E02 for ; Sat, 14 Mar 2026 23:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; cv=pass; b=KDFKmGXoUY5WU+TBHvFgxVVjndbfjA41QH3UhG+7dL02ZIc6YNPctaZBcVwCFEPGaPS6X181hOrJ+iRYC85OvxZ3uiMGQkyQOstXobQ/QxpJOVOqBQdnjqxk5FVFs9rwZDbfw3wWyHqbAcole913hkeW6mIvSZHHGsRR/WgT+K4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; c=relaxed/simple; bh=g0gLOzGvGgBaDelQ1nQAH+bFpUg7Z1FFbkCEaYNyQHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=czY3YcyctUGgmcGJGT5+vpKGJLGLb7HJ6LFPmWeHnyn5drKZkKypxm6LID/tWmVJ2J16pkT/ded4YiWl03cmtd8xPSZPdaaWAnTPquv7C1AZVzjlkEgd3e6PSecVwASpZlBDA/Brq0Y61oEJrEUQs8JbWorbdhYagpk/tBSso/A= 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=jYEOYsV4; arc=pass smtp.client-ip=136.143.169.57 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="jYEOYsV4" ARC-Seal: i=1; a=rsa-sha256; t=1773531114; cv=none; d=zohomail.eu; s=zohoarc; b=LkQBCURi8M3shwM8QAS/MvzKm48ybOddZwBB4CGDhpwAPXWKkupRaHI7wfOz+4nSyJYdHC/dlWBFpwAZoI16dvABysvsrFCLvSdjIfV88tr6QzTk56dlP9A0W1vTG6fvNaewRWOM2Fw/J4tGYU/Z27JKXbQO3Gwq1dz/olhjqfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531114; 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=jIVwvGDcztwvG34HACN3aga1jBf3BBMldzU55NSQowZ/0mVvp3hW4abaa0j5QaoAnFRPHRp7U7kAOv85m/9d4R3NTUhkhfnlCoTA2wP+2WAPVS8YhFdrwUi80/bzTMmSfwBKSjVYlFK7r8OlIUXHDU3/ndXUTVndazm3Fjd1xUE= 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=1773531114; 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=jYEOYsV4HPnf/dPiTM6l7Z+L+q1GzrbbAdhNLjDDiL8KGR5hlY4PCegNRekrDBP3 XcQkRb0m59wtcspoFjl0qTO/XjiI/rKQLkeJkqK0ZpgtPLCNjln/2F+15GycWlsy0us Spey7Kk4ezQtSyUr9pDztr+o8nI682ZexfpFAtIs= Received: by mx.zoho.eu with SMTPS id 1773531111798991.6404906147902; Sun, 15 Mar 2026 00:31:51 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 12/23] bootconfig: constify xbc_calc_checksum() data parameter Date: Sat, 14 Mar 2026 23:31:33 +0000 Message-Id: <20260314233144.187273-13-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 B37F538911C for ; Sat, 14 Mar 2026 23:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; cv=pass; b=ZLT4NKBxTIBUTpvg7wH5FiMkH5xJvtetUxi5f+1h0B77pqLropodjl8CIi9KFsDcAk5NE09s7AF8cIyAT83LsWuRPJYPZwy2gB0cwsx7aEVnBAHC1jI0lS9Nw2FVaH0bjnpdSC2zR/C0Z6IDWhkUZRA2UAwqAzh/AKKNYuFg414= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; c=relaxed/simple; bh=5jHlNQbA4ax5oxWy6TmNNrMnctsyCd5kWbRwYKqDhJE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GbEfY8oWWlARjECnjWCCSqd/9zlUSS6DE054VodXSXERyU0uYVZEmxLtYSioyb0R+ntiA4bjh8sitD2tpbvSxLT11vM/0sfRvmrTtKX9eiD9JkArU9UNGNvDnb7HQ4o6VXK8PYRe3ZNoB2D+gL+NZxQW0ojjM5x5gjspegT/mwg= 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=V7LsRD3K; arc=pass smtp.client-ip=136.143.169.57 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="V7LsRD3K" ARC-Seal: i=1; a=rsa-sha256; t=1773531113; cv=none; d=zohomail.eu; s=zohoarc; b=NCpRS/rr3da9nU2ULvTx75NcGWZp1DToft61+WibyuPjNU2plIaA+0CzXWP/i7zOw9rrHsfIoFqlrk5PrqYWjyJaG41DjvyE3soYzBgJPfHX3BJqlsDcvNCorGzHpjjrDomfcK2k3AoqR5EhNd+U5H08JBBu0R19Px8I3sCBabk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531113; 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=LcY9EJD08xu4Ppp3rs3LhBvmn8JE+TYYTtLOVMvdi7U/pLd/V1QaTWykGIEv7uAJtEHH+VvLfdqgaT7FBtUW32u4lXAYtwQf3sIvEtfZdNic4YtjA1vHLJ0ojuML7XdJMTF5Mc54F4qsWhevs4GccuuXV3YpisHrsxS2+MpHBc4= 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=1773531113; 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=V7LsRD3K3Axr+Tmo2CUeEkIxjIf72KLanRHbMyVV7P3D5aUtYcQB0JQuPlo9wVUV 4/AiypghK8ioBAji/LldrqWb8P/xx7ukxFHec6WmiuPj275uqz3SwLUlmYK+xquEgFv 3IpbOKbpeG/FKX21rHDIUmTy4BSYnA5+TXSYa9ps= Received: by mx.zoho.eu with SMTPS id 1773531112291582.2193221121778; Sun, 15 Mar 2026 00:31:52 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 13/23] lib/bootconfig: replace linux/kernel.h with specific includes Date: Sat, 14 Mar 2026 23:31:34 +0000 Message-Id: <20260314233144.187273-14-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 2CB4638A713 for ; Sat, 14 Mar 2026 23:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531130; cv=pass; b=IO9SgB4acxjq+h5GL8oimfSUTqi89yYfiB1tXbkPSZJK91iTNrnk7LrxvOKt3SOMC3SJ8xGAbnHP/3l08GHDv3nnro2dVQ/4wedwzZN485TzqmCAwjjrcFM2SdjN/m8qNu0L4N+DtvWz50sdMoNwmZR5uWswN3ydj5G0HXtJJQQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531130; c=relaxed/simple; bh=6I0hpTbxvzM0MrqqhLwejv2QuzQNDU3b1q7ISIjV9Vw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iuNryOhDgUHMcS+9YP1vEkR/izA8M9CmGsioBMoSV56JdV5aSCNwFSlN328WpCmQI8JmksSZmlFvKOhy4GSKZzUJzOxDBrJr7IDzpaJjEUoqwDm5aAJ3rHVotX9Lw3yPVUI8VxdJaNs8TQgwRj/EkN/Tk0EBZSv5503FnXtfNrM= 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=WTrft1Cr; arc=pass smtp.client-ip=136.143.169.57 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="WTrft1Cr" ARC-Seal: i=1; a=rsa-sha256; t=1773531114; cv=none; d=zohomail.eu; s=zohoarc; b=FeDbs7bBmA/Wm/tjvsz3aexsZHuEf0+CRyE1HnqsNS/3TEHqgwxk9Iuio4J+RJ7bc7GPysnerxfJs+yGAe55/1sYYTHiH6IpER2OEwhXNbZ7f291Z6n4AzOKISyfQdNQdO7tIi8yyFPCbANQEXovO3HuryqsOehXd3uv3tlQmJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531114; 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=howIif/ds/RHh4IH0qYMKx3KvNAbODmaFt9K5i6rJyNqBdf53+PiDeNt/PSzPfe+/OVFbIB30S6cJg/x7oDLN+f3rDhfSXDew3bR3SWVe1w7O+Lxs3oCB1Yyy3MvF36WFLBNsYAFaOdfBxxKei13cMHIX0+hNul/Hzoi6im9Zgs= 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=1773531114; 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=WTrft1CrAHNxvr2Vw1Tl3h0VHu6y1Jg/s9NPZgG39t9skrbuhPIQh5okXTSAY1n/ WGoq0NL6VvX6tvVpe8NClIsKDjrwXfwfsyqcJahFS+wtH08BWB75mlJVjVT5j+k//3P tJcDC1/pavSSwmXAboi5Bd4oXplE9BnzkvPxUfHU= Received: by mx.zoho.eu with SMTPS id 1773531112775550.8326207466157; Sun, 15 Mar 2026 00:31:52 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 14/23] bootconfig: add __packed definition to tools/bootconfig shim header Date: Sat, 14 Mar 2026 23:31:35 +0000 Message-Id: <20260314233144.187273-15-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 B392538A29A for ; Sat, 14 Mar 2026 23:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531130; cv=pass; b=D2u/TMTKwFnCl4XyzrMROp7JDHXs324dlQT3lA0pYsXCqj+UfTmFLnl2pSwJiON2ijVEsjyZL2fMYPfkBK0ZvZ821dYyuYvhHfd2EstXrjP/WBZRgjpjQNa7PsWTaV8Vb19YyhTicrIyqbq/+SFJ8tZSFV0w4R/QWc62lX4ESxM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531130; c=relaxed/simple; bh=ZuUlVeCERGWi0kiPXUflzzixT8Dr5l8GMnBPX34kkGY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gqpaaMGBJw6aoN70tx+aHNWb5xr/vJq3IHLkwCNTpvCZmAvkUlrlO3GjWCPUqdsB+wDcWZo1wnnBpAGDNEa2gGyeoTOxdJsdhhy1V5RF4FDVRGTp5FEliWqZBZTHbNjY4duse0jXTEsZOMLnvQPgZZxIz1DUcfru6ADfYwITJF0= 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=OHnt1awj; arc=pass smtp.client-ip=136.143.169.57 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="OHnt1awj" ARC-Seal: i=1; a=rsa-sha256; t=1773531115; cv=none; d=zohomail.eu; s=zohoarc; b=dVO00tCoJAM3avhXg7BxxTc/S+bTBh5/4HCYKCRq/aT4w7adROVYfW3zKvGGQj4SoxxQTTy1Q9wrKG3HvoCz6/M0Yvkl+0qnKC/ZK6olxsaO5w305CZlLQdZYpYU2M2Li7hJrFLumEPLDe1Tkil3CcrveMHGAAmGM7mK28Lc/sE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531115; 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=kc8ww+IqsF3P9cccIBIHmdXcMkCS4WyX80SFKCC9OlNiKxG0Hm3GJgnR53ZjbdQMAa+R9ke5Ic5Nf0snkD42SQRtH+Lpg5i9QBMti0Bzqhhjm5qyedxCVrEMS+RhjfH9k3rN2BjOoKLDQjjG86EyQ6KwZnuQHN2rB56PaKrJ5Hg= 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=1773531115; 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=OHnt1awjlSeilp0O50LYket7NYn2tatyPOfCvPvooJyR2ZRAJBgflESNscoKrSVS VAiZSS22BULDRWehu3qu8o4M4qEZgQ54MH4aJnD1t4+mwcTQLPnISPXaRRj6C4zB9z9 ITpZ1sMpUoUs0LG91dUELTbIenaR+tSyx46FGgCk= Received: by mx.zoho.eu with SMTPS id 1773531113256141.62583018923783; Sun, 15 Mar 2026 00:31:53 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 15/23] lib/bootconfig: validate child node index in xbc_verify_tree() Date: Sat, 14 Mar 2026 23:31:36 +0000 Message-Id: <20260314233144.187273-16-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 6CAD238CFE7 for ; Sat, 14 Mar 2026 23:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; cv=pass; b=qtyvv2E5wTd1yDD+aUJ7YziNYB5qYx8LzsjNpTKqOm/6qMFWpivDSEPGeiRGSizTmGYCUCndc4H2wdJWdnMePWl15blJxF7rGiD7Y0amHv3PcC177XR3aCKJTs0rrx0PI5SiRM9pKcBdj9u84VEcOeO0jynKIuyZ85j6J/pkXXM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531132; c=relaxed/simple; bh=V7ReOpjvgKpqLyMe87lV2El6zoCxd9xHdzcToswP9A4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HV6iGfLUx5aLapKlsCJDhMx14LHtQ2TtRbkcJZz1v7cyunJgopYpDzqoPVs/Ifl/XDYhbX4ZMJQIxvyAs1CZXb/sOY2u5IfVS7w3lthJc1iht/RA2NyDSyaTxOU015d4DcnFvmc6QTSiexYUQtp0Cb7yUSthAf7WtSjQAcQjafM= 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=huSbb3xC; arc=pass smtp.client-ip=136.143.169.57 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="huSbb3xC" ARC-Seal: i=1; a=rsa-sha256; t=1773531116; cv=none; d=zohomail.eu; s=zohoarc; b=DQlJIBi8i6vj92RLNeegKLZnI3cEMEoZNPxR5GugGM0zEiiotKA/l3Uo9lnYlb+v71/Yq1bhCFV5wpiQol7QreFfj8spD75EQPAOxQF4ihsySE6TsipVK0LtGtTBhDE5QkuzI4Uq5dqFjxQDElmMn3k1K0yNQ6GFMbhDP81LpUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531116; 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=cd6qaPoymqJ87g62wiQFAdXAu88g1/3ESsWDVzgyEduCMw4c6Nx8UoY724B7LKOIS6nGMbILKG7pIVIRjLPy95S2do+0Jcfo9ymDgxeaOYuS3MP/22jvYGS5rurzs8Fsz1EOT3zcM6HONZmiP8XclKLKj6XntmI7MUGw6szeoFc= 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=1773531116; 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=huSbb3xCkXqGOojf01LrSJJ2XgRzxLEYQ08F9zyOqhsIlqfCJmML6xb9K2s6C+Nf ei6J74X5UMnjaFqwLY3edLlrLkHyjbjl4QFlC23/wxCBgp06GkkMf75MKTH3nHThpYJ QKwhKhk6OHWV9NLdeY/zc6OpSb1mL7b2Hlonw8mY= Received: by mx.zoho.eu with SMTPS id 1773531113731902.1726274425757; Sun, 15 Mar 2026 00:31:53 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 16/23] lib/bootconfig: check xbc_init_node() return in override path Date: Sat, 14 Mar 2026 23:31:37 +0000 Message-Id: <20260314233144.187273-17-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 68A7438A711 for ; Sat, 14 Mar 2026 23:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; cv=pass; b=LAG+7SwohOzvhQwKyd1A2PweYlnHLW8j5gVrfrQJYAaZKtit4P2eHY8sHZoVCZSgNdlx9ME6gsnWppYETdVFnmN8Wm+oCPv+7YfGeYCfWoQWhhmI5F/o7vrbnzRz+/iZryqBHlAd+sxTMysIBKjvWNyXWYhyXMqVGVMKH9NoKjk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531129; c=relaxed/simple; bh=4hvIdsyU/LaVH9Cl+UZr7yonHlF2t2i6TR6b+vGdeIY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sLQfTMlsuRP0qaOxrpQ3EcpFT/zgdigUVFrwS6eNEmojGJXhS+ywgcKRYpt58Ukz9n4XdSFfFHAS3KtP+LB7BsIsKrZSBuUlH/lnrFxjrBkMTBVChrDS7rtgB9bs7s5ngPXtGBOZNIz7S0qw2JqPeqsSG2VhzxoVBMBpi8IXBaQ= 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=V3MCeogC; arc=pass smtp.client-ip=136.143.169.57 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="V3MCeogC" ARC-Seal: i=1; a=rsa-sha256; t=1773531115; cv=none; d=zohomail.eu; s=zohoarc; b=Uq6QWo/wAMZAKBQR81cXyLXZHv+sitQRUlqnvN8AJ3FcYsUpU/vL1+PO8wOIVxR6tAYVFAPEPeggR87GvZwAR4yhXBHUEGsrCvvNp93LtyX6BjMyjoic15r2cI8nG9mbUJvnwEZS1UCXvYvwOA72BPmR8/ouL6I5vEnpDJkEITo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531115; 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=QgSHfwVkbUuIUDRPAptHXJ+tAUBFEYuhkLjQNaWxrKgo/JhNI3ivRiRIF3xUGkdjY+O6OxsFt8Uw7+DJQHe/TW8fq7+8EuAKgUWqMjDag+8ZqJNYclYe2APCqWRwg4022A6A4M8yUr8tpHWKm74lsXby594fXYC4WFVuE7vwGME= 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=1773531115; 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=V3MCeogCJJpkk12dbqjmRjcYKxqMuyPCyCqNGsFN8PIpzFAypNJ5hsPgVe5AHIWE lCGcRD4tkDoi7OtPYlvCt7a1uMDLP0Qw1UEEiOKwcJOAV0fmrLcW3a43dpclOo28fxg wa6IEdFFvDfEsSEA9o0eq5ByTaNPwSwq1x958RTI= Received: by mx.zoho.eu with SMTPS id 1773531114266430.4311543275114; Sun, 15 Mar 2026 00:31:54 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 17/23] tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure Date: Sat, 14 Mar 2026 23:31:38 +0000 Message-Id: <20260314233144.187273-18-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 A594338E132 for ; Sat, 14 Mar 2026 23:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; cv=pass; b=WdZ7OB0+RSADZX8c1MLVHBezqnOcl0L26NI2nX6+jo0ALBwcI4LU7bhsZN6AOiSe4vfyE6NoPE7LXuj9u1eIqrxEEtX4u0N0h6ABAotyj3i5b2/b6JFBE8QADQkxkx7xEDwHY9CJCiniPAiiwwdFsnL/H+a8BfJibW3q0IIjzuM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531133; c=relaxed/simple; bh=BT2q2siZTg8dVM/8aVNchawHfLA2jp863lq7U7GCyhw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z73XpjJom5VbO1gq7ToXC0fHfAgyp+GW4lm2pVk15h/AUg5rT22yGB+7MiV5AIdk1JW+fDjExOLu6rLOQHSj4wNdBQQG4GJlVXmfF4CuqNtzCoEkJRI/VKB0+sMxnSRoZKhQzGSEvOdyVyt9L4PPdTmVYIiAPFq6rDQtHDK3iUo= 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=ACs0/6J5; arc=pass smtp.client-ip=136.143.169.57 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="ACs0/6J5" ARC-Seal: i=1; a=rsa-sha256; t=1773531116; cv=none; d=zohomail.eu; s=zohoarc; b=BCIZ2pHVBLfalEkCBCp76qEXYr2rppve36JujtT+YN61dWCylZzq/BxwXO9YwtyJo1mdQoY8tUc+MVBAqU0X0A+xntz16jUT9DnGf1I4ujjECOkDZbn/Rcu+eiTJPobrplrp8ebjmoCWh+1chxEWuMGStn3Wk9I9oV45o554evQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531116; 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=2W9qWDSpL3vKX3csZlcWzL71BWBE3j2mAMm1BmTvlg8=; b=NUvqP70bgKemvyC4krnzjC9Ls1qre1SW9dhwMvTyAMAlH2o7q1LZJQqzg4fojHVE7bHj7wnoVtytslxSibKDUxux5fhcrf7q4rTzssuBFFmtZ+uQ8RK4RadPkHAKG6mZ7J09nkEWjS6kQ7lsfrnYQqeWnXEWJ22IsiKvBRSruww= 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=1773531116; 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=2W9qWDSpL3vKX3csZlcWzL71BWBE3j2mAMm1BmTvlg8=; b=ACs0/6J5dCtZoxQkHbOL2zVZMHzCLZyZk/ySP3FPvSIHiNNuqYX7VY/ln5pU2ZLp LsolkX8DeBQLzC8Iq5IG3vmUjbOSo8nfLhEPoRCCWW7eek1U4GrsPkzVgShhrhQv85I Ka45NKNTUBqj/jwU7dYEkw/PYUNPgFgFZxp+pAYA= Received: by mx.zoho.eu with SMTPS id 1773531114749601.4293110619426; Sun, 15 Mar 2026 00:31:54 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 18/23] lib/bootconfig: fix signed comparison in xbc_node_get_data() Date: Sat, 14 Mar 2026 23:31:39 +0000 Message-Id: <20260314233144.187273-19-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:188:28: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' [-Wsign-compare] The local variable 'offset' is declared as int, but xbc_data_size is size_t. Using ~XBC_VALUE as the mask also involves integer promotion rules that obscure intent. Change the type to unsigned int and mask with XBC_DATA_MAX (which is the 15-bit data mask) instead of ~XBC_VALUE, making the expression self-documenting and eliminating the signed/unsigned comparison. 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 182d9d9bc5a6..806a8f038d24 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -183,7 +183,7 @@ struct xbc_node * __init xbc_node_get_next(struct xbc_n= ode *node) */ const char * __init xbc_node_get_data(struct xbc_node *node) { - int offset =3D node->data & ~XBC_VALUE; + unsigned int offset =3D node->data & XBC_DATA_MAX; =20 if (WARN_ON(offset >=3D xbc_data_size)) return NULL; --=20 2.34.1 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 49B1138A711 for ; Sat, 14 Mar 2026 23:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531135; cv=pass; b=nODvds24ZnbNBnXhyKzAEdlQLRLrlgyDfpzdym1PtLxV2wLlsUgXT9BeExxF//TgVS0xhrTLxqwzSQ0+xuUpgrdJVmG1voLgzCA79kXVzoTsTwkJLpwbhZHJY3vNmmOInaxzmJrDmMiotG1qu6jnx9zTGyltVW/Wyho+r2FtyKc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531135; c=relaxed/simple; bh=JDJDCRXv0WDR5QTOFLbH+ZVs0fEY0qu7uRZpAINLGYI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qada9+drvq+mp4I0xJodUMJ6zwqKC0bSC1b3EHLfP23u0af97qF1AD8snmSicHIZty/9okHPLZOa/mciI35w9j03EQ9zYbxSq3lTXX0WvCP15x2DGLuQsIjCm/9PuCKMX0aM8vmwSDzpQRU28pRGjyBYdYmhfR3XQAHH//sRhHY= 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=J00uUaCr; arc=pass smtp.client-ip=136.143.169.57 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="J00uUaCr" ARC-Seal: i=1; a=rsa-sha256; t=1773531117; cv=none; d=zohomail.eu; s=zohoarc; b=X74onS2N+hvrNYCQcabNBM4s/T35fat5L774Sq7TF4MXJZVwHwHplL4NIr2GpcdCSHI3VOCgnD0aj6Xu6G1Ih+LKvWOMppD0K/j+YWm3jUqwI9Hv8Tg1IjdBuwpoNzTTBuYbcK/aIFqgyTHLU94Nh1emKYt0S2xPYrxhM50I9vM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531117; 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=c0YHvSlmLDD7UQSPU1JDzf6Bfaf0j0xk6wf6t7LSyAU=; b=Za4Z8evndBxCMV/y1kxt43u4JFfXSf+O8BgplTJ0v3fWfPaW6sPuyB+jzOjxL60BRcqMYLcKUrpviYVGk6A5TUWaAFMsgHu3+gGJ/ZHZn983PscaTfTW/oFJWmDZ/T7GVxYk5ZKpOddRWhn1nJutFz68ol2wimJI4JvZz9hWk5M= 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=1773531117; 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=c0YHvSlmLDD7UQSPU1JDzf6Bfaf0j0xk6wf6t7LSyAU=; b=J00uUaCrC7xHAq9HhYiJZuEYfX6PVXKsFutnNAR6eKLBwCfouAfkOOa8ahJkcSa4 WMD1bz6JcPQqfLX43hKVyQ2mmw4EL7tc/A3LPHyAtWGEgXqKjcFoB8VUa7AGVgSiAFu 4s5x7IcTu6J6SFVrsHTvZghOyl9t1PWxP3SOWypA= Received: by mx.zoho.eu with SMTPS id 1773531115243700.8454415412016; Sun, 15 Mar 2026 00:31:55 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 19/23] lib/bootconfig: use size_t for strlen result in xbc_node_match_prefix() Date: Sat, 14 Mar 2026 23:31:40 +0000 Message-Id: <20260314233144.187273-20-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:198:19: warning: conversion from 'size_t' to 'int' may change value [-Wconversion] lib/bootconfig.c:200:33: warning: conversion to '__kernel_size_t' from 'int' may change the sign of the result [-Wsign-conversion] strlen() returns size_t but the result was stored in an int. The value is then passed back to strncmp() which expects size_t, causing a second sign-conversion warning on the round-trip. Use size_t throughout to match the API types. 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 806a8f038d24..995c2ec94cbe 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -195,7 +195,7 @@ static bool __init xbc_node_match_prefix(struct xbc_node *node, const char **prefix) { const char *p =3D xbc_node_get_data(node); - int len =3D strlen(p); + size_t len =3D strlen(p); =20 if (strncmp(*prefix, p, len)) return false; --=20 2.34.1 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 B09E4390C93 for ; Sat, 14 Mar 2026 23:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; cv=pass; b=mVkl6LYkUAMlWGCWuBDguXIn8bMZv0VVbMlV5l5w0j4Ep11Q4pY7yTmV375q/eCdoQtjFN3TzK0FgqwrukKOHH7LMSrpiQRtZozlXOL5snFOx/DxnRz97to7RJi6J7HozKrtrq/lPy8e/LWj/0iEV+3qP8/XjsSzQRn0ccgiGAw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; c=relaxed/simple; bh=VKHopRg8IGdNLejmjRomK8lHiFXp7Lb7z8zk3mjsIxM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P5BiaxsmCezMOr6weHRxYjgTRjOvO9RNClP0FVIU5hidfoIwvd2nP0jI9ZcliYQt09quTmfZ9EKUfiasyiDnmNvLh/Sj5eICdGMiWQhK5smNlBI4h3Q6yurXjlMerwzxlrm8k79vP8QAW6bCdvq85F07PmZtPF5Cwsuqqo9M1V8= 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=bJJn7jhG; arc=pass smtp.client-ip=136.143.169.57 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="bJJn7jhG" ARC-Seal: i=1; a=rsa-sha256; t=1773531118; cv=none; d=zohomail.eu; s=zohoarc; b=KFxnMOQLJUNTTWPQKc+viIJVQswKzTkgndeSJNHcMdAO6Rx9jTaIgGLk81vovQP8J/tf1s8DcFLa5bZw5pqAhCP1UzldeiJ4lGyeL4pRF9Cof45O7AhjuZ5Ig1V0R0DVbUoEGB9aXsRMuzrEckd0DTmnx0eJvfjeeOuWd5c/EfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531118; 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=t+zefJeSRi22Rvky/gfXxqncChjmAVugRoXXQsGEHR0=; b=jfIkn1Tlnopnl2ho5PoVT4MtbXl9tjaseqkqbcz/WYcX0CV+elTuaZP70Kr3UJ1nio31ZXukmGTv6YPVCexs9qUCbPaW8reMfGMrmeJ4Vq04/jZ0tAPR65bD/SdxHSZIBzyLAgzIp/Bxskl9GupsSTYcThhDkgSnC/SfeyHCEnA= 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=1773531118; 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=t+zefJeSRi22Rvky/gfXxqncChjmAVugRoXXQsGEHR0=; b=bJJn7jhG2wn1MvlGXdOxhFLKTjTdqEXRwXARL3Uw7tMkZiqGt5z6qj4/kmnl33wV 6Alvn155dFp4QdjO+sbhn/Zl+tTnvkc21RCEUNkAM2bn7Yn1p/9ocqRFDRlDxNaBfof zkNXdqKwPiIRkPxFCsuqKT0P911C4KG7E1z0JqlE= Received: by mx.zoho.eu with SMTPS id 1773531115740323.89994253598684; Sun, 15 Mar 2026 00:31:55 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 20/23] lib/bootconfig: narrow offset type in xbc_init_node() Date: Sat, 14 Mar 2026 23:31:41 +0000 Message-Id: <20260314233144.187273-21-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:415:32: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion] Pointer subtraction yields ptrdiff_t (signed long), which was stored in unsigned long. The offset is immediately checked against XBC_DATA_MAX (32767) and then truncated to uint16_t, so unsigned int is sufficient. Add an explicit cast on the subtraction to suppress the sign-conversion warning. 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 995c2ec94cbe..7296df003459 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -412,7 +412,7 @@ const char * __init xbc_node_find_next_key_value(struct= xbc_node *root, =20 static int __init xbc_init_node(struct xbc_node *node, char *data, uint16_= t flag) { - unsigned long offset =3D data - xbc_data; + unsigned int offset =3D (unsigned int)(data - xbc_data); =20 if (WARN_ON(offset >=3D XBC_DATA_MAX)) return -EINVAL; --=20 2.34.1 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 6DC55391518 for ; Sat, 14 Mar 2026 23:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; cv=pass; b=mYIF1zYCvYrvGWKyEE1TZzPOTOZgCchksBblcZyqLp0WM+CfFz9ttF6Zr/Fk3+qM0x7RVRq6kq7y1Tc5qkMfQPftAzuUVASdUpjRg2UIXuDGkL7+GlT38CfEopE2nPlPyGseZTDX24ZapJ6BUIfVYmmfVp2KOifJVWdKMQES+ms= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; c=relaxed/simple; bh=J0dWEtL7oD28UFrLKGwL9fzqAkzoGMhBDWffJqXgq8s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qAAx3gptdi7WcOtWTtPCblZ0MYN+EwI0fuy23eGq6PTGMmD1zp3ipQY/RB7FuXVHTCWAIw5hNpBeb0P/BbOGIWrtZLYcg589xQR4w6sAMc/f7apuif8DXAkXo+mKQ/IdL0YDWv8Sam0vIi02hJumdUipjkAk1WxC00MszCojB7k= 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=LwN4SzHE; arc=pass smtp.client-ip=136.143.169.57 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="LwN4SzHE" ARC-Seal: i=1; a=rsa-sha256; t=1773531117; cv=none; d=zohomail.eu; s=zohoarc; b=Y59CRj85uieu5ha7og1uwtWkwRrjqPtWuBRn0WcY2fDaLGhZxPAFEg+LqJhOsz9ByrG+GmfZxTAs663/+pqtiNZpPVJ+Ea8clGNRu6mST07a8SlRXlFBnokVjrCRw8ClH5aOK8MUbkXAcr5qJL9DRDPENGpX32QOVkROkNHCbwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531117; 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=DAmDK/t7v3VayM2/oeJKOAUQv25rBNApZIKdk5FaALE=; b=KYnE/9XFnfq0mpqBqFOSbscNdELQlngHN3Z5jfBmOsHdbG51ChfFi1LvhkBSgw2awo7r63TBpyEPTys45ynBQZypnxC/Wlb2a3ZjsAAzvNSowlku1I4cK3AT+Gt3ZuKwF1FxAOnQ+uOX7Jyu0vfRsNmUOw2xr/D7cb8k6Hep8zQ= 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=1773531117; 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=DAmDK/t7v3VayM2/oeJKOAUQv25rBNApZIKdk5FaALE=; b=LwN4SzHEx0m7IRO4Kq22JrAxGzEGyHkB2SLlJAqIRtao1pFQjwUWRLetfOFlzuMz cWT+cZBMUvuWb8aK5pnYdNk3OgkfRtnlz40BCy+8rBPjSB7TbVhyuwxwhrRrOYjPuJV wcu9SCgoWaEoDikKIcR8V1nhT7HXUtz8mGECfgT8= Received: by mx.zoho.eu with SMTPS id 1773531116233231.17178676526726; Sun, 15 Mar 2026 00:31:56 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 21/23] lib/bootconfig: use size_t for key length tracking in xbc_verify_tree() Date: Sat, 14 Mar 2026 23:31:42 +0000 Message-Id: <20260314233144.187273-22-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:839:24: warning: conversion from 'size_t' to 'int' may change value [-Wconversion] lib/bootconfig.c:860:32: warning: conversion from 'size_t' to 'int' may change value [-Wconversion] lib/bootconfig.c:860:29: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] The key length variables len and wlen accumulate strlen() results but were declared as int, causing truncation and sign-conversion warnings. Change both to size_t to match the strlen() return type and avoid mixed-sign arithmetic. 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 7296df003459..e318b236e728 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -803,7 +803,8 @@ static int __init xbc_close_brace(char **k, char *n) =20 static int __init xbc_verify_tree(void) { - int i, depth, len, wlen; + int i, depth; + size_t len, wlen; struct xbc_node *n, *m; =20 /* Brace closing */ --=20 2.34.1 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 81C3B39151E for ; Sat, 14 Mar 2026 23:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; cv=pass; b=tDVIBB7IbongAJb3Ltov7nNxuLb78WyVVOVAJMCL+Vdz9+jUdzEz7IxK0KVsZJVW0R4tl9Sk+2PdPZ1ILG8HM4lre/1QLh0sdj5ejkgQDz8Ie3iX4c6PnqIKjtvw+jP9BexTHEyBP1ICcuxxTvt+mwWS7O+ln++JkBrOtoFpiH8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; c=relaxed/simple; bh=aXdlizYwRg/M1AMKSbsJalT/nUfz1oUAK6W0OZTfMtI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jTNdGOiQNVHVCSk1C8PIe/4gcCyaCmRt/Jt9PFvlQnOQp7XzGoWXiOtbXca8xo1JZ690jOAFUEzIOI0Zekj9xyFuvYZReM3kva0ZdYKrkbgLxr29mCX5QuHMmEEStxMLnU5KRDIdH74ppuDc9xkiDqrcNgyzuSF9mWQjLRIPk9Q= 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=calelIUx; arc=pass smtp.client-ip=136.143.169.57 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="calelIUx" ARC-Seal: i=1; a=rsa-sha256; t=1773531118; cv=none; d=zohomail.eu; s=zohoarc; b=ItuO7o+c2ms26nNF4bw2ECtzmncFSiJTbbeGIUJf1ckGtnya98tFrWdyhKHJVU0SaiX8OH6M3AVIQtPoDNq8TpbhKGq8RUi9V3cA5fx3w6wWldZ1Q7c8BbG1Kb/UyvcVcHpM7QUP/L30rGvABWOMtiarxNiCbJKVSTeI5UlEuio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531118; 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=ga7f0GX5euej9Ul7YTpyJfwhI+upMhqgl4lvCxDD7gQ=; b=h7BW3R6HPl44kDgHXrEWtugnLNpzypF3YcUQp9I8UWlGy4IPJA08eMZCzXQIRaFgV7pI9U6xGTHiHmwhA9AL8gA5+nmH/63qxLDQ9lpMGddEIDZcABHuSC4EAbAM/5dc0YD7Q1lrhku7Bum8SxTXgWPC4FfXoOlNTnuAkNRmruw= 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=1773531118; 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=ga7f0GX5euej9Ul7YTpyJfwhI+upMhqgl4lvCxDD7gQ=; b=calelIUxnZdz9jwrEhvJX/P9zV+UpAxB0et8eljE+95D8ZlnSE2SzB+Aq6BlVy8T rRN0Bx7GyDEwtAFXc0zrk1KFvO3FAvGOn92WcONeVyBApIEmXPOTs5Ls2hnLtLQ6Sk8 mRn88Ula3lYlS43xSDESKtftEnF9ivl+HK9828H0= Received: by mx.zoho.eu with SMTPS id 1773531116718381.2769720153352; Sun, 15 Mar 2026 00:31:56 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 22/23] lib/bootconfig: fix sign-compare in xbc_node_compose_key_after() Date: Sat, 14 Mar 2026 23:31:43 +0000 Message-Id: <20260314233144.187273-23-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:322:25: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' [-Wsign-compare] lib/bootconfig.c:325:30: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] snprintf() returns int but size is size_t, so comparing ret >=3D size and subtracting size -=3D ret involve mixed-sign operations. Cast ret at the comparison and subtraction sites; ret is known non-negative at this point because the ret < 0 early return has already been taken. 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 e318b236e728..68a72dbc38fa 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -319,10 +319,10 @@ int __init xbc_node_compose_key_after(struct xbc_node= *root, depth ? "." : ""); if (ret < 0) return ret; - if (ret >=3D size) { + if (ret >=3D (int)size) { size =3D 0; } else { - size -=3D ret; + size -=3D (size_t)ret; buf +=3D ret; } total +=3D ret; --=20 2.34.1 From nobody Tue Apr 7 07:29:21 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 990FA390C90 for ; Sat, 14 Mar 2026 23:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; cv=pass; b=lbhk+iYaplEHqPXj7KqXpNkK1JYmZ8zn/VHVvD8o/I7Ml05bHWnu7zqFF9arGBEMPvS7OoFTGSlXUA3o3dpDW5z2BypwtYAlg4ETlfOiMNWq8CONlV/Y2L/LNIMYoZoolN9bC08J6jOsBv8ka0uMq/gEFl3OqzdY14jPWwdoDYU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531136; c=relaxed/simple; bh=fpDiP5KK6o/eaCzTwQJnTyMGJ0EUlFRoORNRjkvPGzs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PSIeT18j7spO7QU1NrTS8y8Srsn2bhI3jYxey7C5qw+4CNlQWBy0sQEbDWoSiawHL6FwYsrNSAYJMaUGusndtqGGb6DF7lFpkJJFgWGR5ZCTBMlOulAyKVwyZGfZTYPhRJdcappz00/J0L+ucgmJAVckM7fCDtIPsXDoFEKx1ZQ= 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=cnarV8Dx; arc=pass smtp.client-ip=136.143.169.57 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="cnarV8Dx" ARC-Seal: i=1; a=rsa-sha256; t=1773531119; cv=none; d=zohomail.eu; s=zohoarc; b=SDC6d9WjgxzfjTByDp+OcpMtSiEKkSum0g0v1uE6lWht5bl8SXaSG9q6dJJqzCRUBy9jC1/FgEpcXpDxnVAqfTVV3ATQKaRAK1ilyqrXecOBSk2jZXyNoPUMALl7rzCoPC4m4fl4r1FUhde7Ak201+ZdeYNkDp51vWg8nxZO+tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773531119; 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=okeqBuqJ5Pkpz8tC88YJ+8yeMMAsnw/SNdzaHg6pf0Q=; b=gTAZE2HmkgAQNOn0IZq15cq1dpGWmBvz5eZyqA/2K5t/mi1QWNZrhQb9F+gk17C00Y99X7T258SFnIqMQh7eCaM++si9kRv6BVRV2pY388+n+M4oSX5tTrOPOVVTdGxSkzZDBInOkZHPcGRWpr8gRZcPIix/IBaoc2SYGo0nsKM= 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=1773531119; 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=okeqBuqJ5Pkpz8tC88YJ+8yeMMAsnw/SNdzaHg6pf0Q=; b=cnarV8DxcTA4q3Q4bNu7ThyrItpjFEcjwmGv2Q8hRkyEG2/9STsqXIo7LaLqDO6l 6HW30nRvUVBsThZca8g7/hmvzVLCKyqK3WmUd2vHaPm9R5lWYCcImI3aG6cK94U9zwa vgihLErzIgb86HVGXJPvhqKO9PMHrN6T9KekrDMc= Received: by mx.zoho.eu with SMTPS id 1773531117191642.1015927295734; Sun, 15 Mar 2026 00:31:57 +0100 (CET) From: Josh Law To: Masami Hiramatsu , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v5 23/23] lib/bootconfig: change xbc_node_index() return type to uint16_t Date: Sat, 14 Mar 2026 23:31:44 +0000 Message-Id: <20260314233144.187273-24-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260314233144.187273-1-objecting@objecting.org> References: <20260314233144.187273-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" lib/bootconfig.c:136:21: warning: conversion from 'long int' to 'int' may change value [-Wconversion] lib/bootconfig.c:308:33: warning: conversion from 'int' to 'uint16_t' may change value [-Wconversion] lib/bootconfig.c:467:37: warning: conversion from 'int' to 'uint16_t' may change value [-Wconversion] lib/bootconfig.c:469:40: warning: conversion from 'int' to 'uint16_t' may change value [-Wconversion] lib/bootconfig.c:472:54: warning: conversion from 'int' to 'uint16_t' may change value [-Wconversion] lib/bootconfig.c:476:45: warning: conversion from 'int' to 'uint16_t' may change value [-Wconversion] xbc_node_index() returns the position of a node in the xbc_nodes array, which has at most XBC_NODE_MAX (8192) entries, well within uint16_t range. Every caller stores the result in a uint16_t field (node->parent, node->child, node->next, or the keys[] array in compose_key_after), so the int return type causes narrowing warnings at all six call sites. Change the return type to uint16_t and add an explicit cast on the pointer subtraction to match the storage width and eliminate the warnings. Signed-off-by: Josh Law --- include/linux/bootconfig.h | 2 +- lib/bootconfig.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h index d78c2b62debf..e5bd46ca7a51 100644 --- a/include/linux/bootconfig.h +++ b/include/linux/bootconfig.h @@ -66,7 +66,7 @@ struct xbc_node { =20 /* Node tree access raw APIs */ struct xbc_node * __init xbc_root_node(void); -int __init xbc_node_index(struct xbc_node *node); +uint16_t __init xbc_node_index(struct xbc_node *node); struct xbc_node * __init xbc_node_get_parent(struct xbc_node *node); struct xbc_node * __init xbc_node_get_child(struct xbc_node *node); struct xbc_node * __init xbc_node_get_next(struct xbc_node *node); diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 68a72dbc38fa..148084abae12 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -131,9 +131,9 @@ struct xbc_node * __init xbc_root_node(void) * * Return the index number of @node in XBC node list. */ -int __init xbc_node_index(struct xbc_node *node) +uint16_t __init xbc_node_index(struct xbc_node *node) { - return node - &xbc_nodes[0]; + return (uint16_t)(node - &xbc_nodes[0]); } =20 /** --=20 2.34.1