From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hongtao Lee <lihongtao@kylinos.cn>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [GIT PULL] bootconfig: Fixes for v7.1-rc4
Date: Mon, 25 May 2026 08:40:53 +0900 [thread overview]
Message-ID: <20260525084053.cccd8df734ae9d866b33d079@kernel.org> (raw)
Linus,
Bootconfig fixes for v7.1-rc4
- tools/bootconfig: Fix buf leaks in apply_xbc
If data memory allocation failed, free the buf before return.
Please pull the latest bootconfig-fixes-v7.1-rc4 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
bootconfig-fixes-v7.1-rc4
Tag SHA1: 0223343010ff4dac13d2edf58f0af3efffc34446
Head SHA1: f42d01aadcedd7bbf4f9a466cabe25c1781dedad
Hongtao Lee (1):
tools/bootconfig: Fix buf leaks in apply_xbc
----
tools/bootconfig/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---------------------------
commit f42d01aadcedd7bbf4f9a466cabe25c1781dedad
Author: Hongtao Lee <lihongtao@kylinos.cn>
Date: Wed May 20 11:01:26 2026 +0800
tools/bootconfig: Fix buf leaks in apply_xbc
If data calloc failed, free the buf before return.
Link: https://lore.kernel.org/all/20260520030126.147782-1-lihongtao@kylinos.cn/
Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Signed-off-by: Hongtao Lee <lihongtao@kylinos.cn>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 643f707b8f1d..ddabde20585f 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -390,8 +390,10 @@ static int apply_xbc(const char *path, const char *xbc_path)
/* Backup the bootconfig data */
data = calloc(size + BOOTCONFIG_ALIGN + BOOTCONFIG_FOOTER_SIZE, 1);
- if (!data)
+ if (!data) {
+ free(buf);
return -ENOMEM;
+ }
memcpy(data, buf, size);
/* Check the data format */
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next reply other threads:[~2026-05-24 23:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-24 23:40 Masami Hiramatsu [this message]
2026-05-25 20:03 ` [GIT PULL] bootconfig: Fixes for v7.1-rc4 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=20260525084053.cccd8df734ae9d866b33d079@kernel.org \
--to=mhiramat@kernel.org \
--cc=lihongtao@kylinos.cn \
--cc=linux-kernel@vger.kernel.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