zonefs fixes for 7.1-rc5

- Avoid potential overflow when converting a zonefs file number string
    to an inode number (from Johannes)
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQSRPv8tYSvhwAzJdzjdoc3SxdoYdgUCahAOdQAKCRDdoc3SxdoY
 dnxHAPwMJClZOV6J0RtQqK2zxoDMLGIcE+z0MHq3stFbJBcjWgEA9fjB0rklUwaW
 saPUjQUTj/mZJJYmce1MrXI0qYjXxAs=
 =J44t
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2026-05-22 10:44:18 -07:00
commit 632360e8f5

View File

@ -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;
}