From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,ekffu200098@gmail.com,mhiramat@kernel.org,akpm@linux-foundation.org
Subject: + bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh.patch added to mm-nonmm-unstable branch
Date: Fri, 11 Sep 2026 15:59:27 -0700 [thread overview]
Message-ID: <20260911225928.100E31F000FF@smtp.kernel.org> (raw)
The patch titled
Subject: bootconfig: move BOOTCONFIG_FOOTER_SIZE to include/linux/bootconfig.h
has been added to the -mm mm-nonmm-unstable branch. Its filename is
bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Subject: bootconfig: move BOOTCONFIG_FOOTER_SIZE to include/linux/bootconfig.h
Date: Fri, 11 Sep 2026 23:13:33 +0900
BOOTCONFIG_FOOTER_SIZE was defined locally in tools/bootconfig/main.c.
Move it to include/linux/bootconfig.h so that it can be shared with the
kernel and user-space tools. Also, use it in init/main.c instead of the
hardcoded (BOOTCONFIG_MAGIC_LEN + 8) expression when checking the initrd
size.
Link: https://lore.kernel.org/178913601321.248794.4786502771058559887.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Suggested-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/bootconfig.h | 4 ++++
init/main.c | 2 +-
tools/bootconfig/main.c | 4 ----
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/include/linux/bootconfig.h~bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh
+++ a/include/linux/bootconfig.h
@@ -27,6 +27,10 @@ bool __init cmdline_has_extra_options(vo
#define BOOTCONFIG_ALIGN (1 << BOOTCONFIG_ALIGN_SHIFT)
#define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1)
+/* Bootconfig footer is [size][csum][BOOTCONFIG_MAGIC]. */
+#define BOOTCONFIG_FOOTER_SIZE \
+ (sizeof(uint32_t) * 2 + BOOTCONFIG_MAGIC_LEN)
+
/**
* xbc_calc_checksum() - Calculate checksum of bootconfig
* @data: Bootconfig data.
--- a/init/main.c~bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh
+++ a/init/main.c
@@ -278,7 +278,7 @@ static void * __init get_boot_config_fro
int i;
if (!initrd_end || initrd_end < initrd_start ||
- initrd_end - initrd_start < BOOTCONFIG_MAGIC_LEN + 8)
+ initrd_end - initrd_start < BOOTCONFIG_FOOTER_SIZE)
return NULL;
data = (char *)initrd_end - BOOTCONFIG_MAGIC_LEN;
--- a/tools/bootconfig/main.c~bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh
+++ a/tools/bootconfig/main.c
@@ -17,10 +17,6 @@
#define pr_err(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
-/* Bootconfig footer is [size][csum][BOOTCONFIG_MAGIC]. */
-#define BOOTCONFIG_FOOTER_SIZE \
- (sizeof(uint32_t) * 2 + BOOTCONFIG_MAGIC_LEN)
-
static void show_xbc_error(const char *data, const char *msg, int pos)
{
int lin = 1, col, i;
_
Patches currently in -mm which might be from mhiramat@kernel.org are
tools-bootconfig-fix-integer-overflow-and-truncation-in-size-checks.patch
bootconfig-fix-integer-overflow-in-initrd-size-check.patch
bootconfig-reject-unexpected-data-after-null-character.patch
tools-bootconfig-consolidate-xbc_init-to-error-message-wrapper.patch
bootconfig-skip-internal-tree-sanity-checks-in-kernel.patch
bootconfig-move-bootconfig_footer_size-to-include-linux-bootconfigh.patch
reply other threads:[~2026-09-11 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260911225928.100E31F000FF@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=ekffu200098@gmail.com \
--cc=mhiramat@kernel.org \
--cc=mm-commits@vger.kernel.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