mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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:
+5
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user