summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-05-22 10:44:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-05-22 10:44:18 -0700
commit632360e8f5fce2eee720e952fd84e8cefb5749b6 (patch)
treee97c99601ce85d5e65e2bb2d8ce8733a87b10ba1
parent45255ea1ca096b11b1303c9b54502a28f3a31dd1 (diff)
parent3a8389d42bdf4213730f4067f8bfa78bae6564ef (diff)
Merge tag 'zonefs-7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs
Pull zonefs fix from Damien Le Moal: - Avoid potential overflow when converting a zonefs file number string to an inode number (from Johannes) * tag 'zonefs-7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: handle integer overflow in zonefs_fname_to_fno
-rw-r--r--fs/zonefs/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 9b646cb5335d..ff43d6d1ea30 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -610,10 +610,14 @@ static long zonefs_fname_to_fno(const struct qstr *fname)
return c - '0';
for (i = 0, rname = name + len - 1; i < len; i++, rname--) {
+ long digit;
+
c = *rname;
if (!isdigit(c))
return -ENOENT;
- fno += (c - '0') * shift;
+ digit = (c - '0') * shift;
+ if (check_add_overflow(fno, digit, &fno))
+ return -ENOENT;
shift *= 10;
}