All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] bootconfig: Fixes for v7.0-rc4
@ 2026-03-21  8:23 Masami Hiramatsu
  2026-03-21 13:59 ` Josh Law
  2026-03-21 17:45 ` pr-tracker-bot
  0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2026-03-21  8:23 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Josh Law, Steven Rostedt, Masami Hiramatsu, linux-kernel

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>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-21 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21  8:23 [GIT PULL] bootconfig: Fixes for v7.0-rc4 Masami Hiramatsu
2026-03-21 13:59 ` Josh Law
2026-03-21 17:45 ` pr-tracker-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.