From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Law <objecting@objecting.org>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [GIT PULL] bootconfig: Fixes for v7.0-rc4
Date: Sat, 21 Mar 2026 17:23:07 +0900 [thread overview]
Message-ID: <20260321172307.7fbdd7de328054aa0dca7dca@kernel.org> (raw)
Hi Linus,
Bootconfig fixes for v7.0-rc4
- lib/bootconfig: check xbc_init_node() return in override path
Fix to check error code of xbc_init_node() in override value path
in xbc_parse_kv().
- tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure
Fix to close fd in fstat() failure path.
Please pull the latest bootconfig-fixes-v7.0-rc4 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
bootconfig-fixes-v7.0-rc4
Tag SHA1: a701749c7ddb8ebc9b7a5cd94118b8365bb107ea
Head SHA1: 3b2c2ab4ceb82af484310c3087541eab00ea288b
Josh Law (2):
lib/bootconfig: check xbc_init_node() return in override path
tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure
----
lib/bootconfig.c | 3 ++-
tools/bootconfig/main.c | 7 +++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---------------------------
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index 2da049216fe0..e88d0221a826 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -723,7 +723,8 @@ static int __init xbc_parse_kv(char **k, char *v, int op)
if (op == ':') {
unsigned short nidx = child->next;
- xbc_init_node(child, v, XBC_VALUE);
+ if (xbc_init_node(child, v, XBC_VALUE) < 0)
+ return xbc_parse_error("Failed to override value", v);
child->next = nidx; /* keep subkeys */
goto array;
}
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 55d59ed507d5..643f707b8f1d 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -162,8 +162,11 @@ static int load_xbc_file(const char *path, char **buf)
if (fd < 0)
return -errno;
ret = fstat(fd, &stat);
- if (ret < 0)
- return -errno;
+ if (ret < 0) {
+ ret = -errno;
+ close(fd);
+ return ret;
+ }
ret = load_xbc_fd(fd, buf, stat.st_size);
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next reply other threads:[~2026-03-21 8:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 8:23 Masami Hiramatsu [this message]
2026-03-21 13:59 ` [GIT PULL] bootconfig: Fixes for v7.0-rc4 Josh Law
2026-03-21 17:45 ` pr-tracker-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260321172307.7fbdd7de328054aa0dca7dca@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=objecting@objecting.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox