From: Yifan Zhao <stopire@gmail.com>
To: linux-erofs@lists.ozlabs.org
Cc: Yifan Zhao <stopire@gmail.com>
Subject: [PATCH 1/8] erofs-utils: lib: fix arithmetic overflow in large file handling
Date: Thu, 12 Nov 2026 20:47:18 +0800 [thread overview]
Message-ID: <20261112124725.2774244-2-stopire@gmail.com> (raw)
In-Reply-To: <20261112124725.2774244-1-stopire@gmail.com>
Assisted-by: Codex:gpt-6-astra
Assisted-by: Claude Code:deepseek-v4.1-flash-1017
Signed-off-by: Yifan Zhao <stopire@gmail.com>
---
lib/compress.c | 2 +-
lib/rebuild.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/compress.c b/lib/compress.c
index b079558..e1cfc05 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -560,7 +560,7 @@ static bool z_erofs_fixup_deduped_fragment(struct z_erofs_compress_sctx *ctx)
struct z_erofs_compress_ictx *ictx = ctx->ictx;
struct erofs_inode *inode = ictx->inode;
struct erofs_sb_info *sbi = inode->sbi;
- const unsigned int newsize = ctx->remaining + ctx->tail - ctx->head;
+ const erofs_off_t newsize = ctx->remaining + ctx->tail - ctx->head;
DBG_BUGON(!inode->fragment_size);
diff --git a/lib/rebuild.c b/lib/rebuild.c
index 94dc66d..2fa8feb 100644
--- a/lib/rebuild.c
+++ b/lib/rebuild.c
@@ -262,7 +262,7 @@ static int erofs_rebuild_load_chunk_index(struct erofs_sb_info *dst_sb,
.buf = __EROFS_BUF_INITIALIZER,
};
- map.m_la = i << chunkbits;
+ map.m_la = (erofs_off_t)i << chunkbits;
ret = erofs_map_blocks(inode, &map, 0);
if (ret)
goto err;
--
2.56.0
next prev parent reply other threads:[~2026-11-12 12:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 12:47 [PATCH 0/8] erofs-utils: fix issues found by LLMs Yifan Zhao
2026-11-12 12:47 ` Yifan Zhao [this message]
2026-11-12 12:47 ` [PATCH 2/8] erofs-utils: mkfs: fix incremental superblock stack overread Yifan Zhao
2026-11-12 12:47 ` [PATCH 3/8] erofs-utils: tar: fix out-of-bounds access when trimming PAX paths Yifan Zhao
2026-11-12 12:47 ` [PATCH 4/8] erofs-utils: lib: fix buffer leaks in error paths Yifan Zhao
2026-11-12 23:20 ` Gao Xiang
2026-11-12 12:47 ` [PATCH 5/8] erofs-utils: exclude: fix stack overflow when checking long paths Yifan Zhao
2026-11-12 12:47 ` [PATCH 6/8] erofs-utils: lib: fix gzran EOF handling and state leaks Yifan Zhao
2026-11-12 12:47 ` [PATCH 7/8] erofs-utils: lib: fix metabox inline data reads Yifan Zhao
2026-11-12 12:47 ` [PATCH 8/8] erofs-utils: fix read error and short read handling Yifan Zhao
2026-11-12 23:41 ` Gao Xiang
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=20261112124725.2774244-2-stopire@gmail.com \
--to=stopire@gmail.com \
--cc=linux-erofs@lists.ozlabs.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