]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/f2fs: Do not copy file names that are too long
authorSudhakar Kuppusamy <sudhakar@linux.ibm.com>
Wed, 6 Apr 2022 12:47:43 +0000 (18:17 +0530)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 7 Jun 2022 14:39:33 +0000 (16:39 +0200)
commite40b83335bb33d9a2d1c06cc269875b3b3d6c539
tree00d91bb3de8b21ce5d93e49d5f9bd34df4aabf21
parentdeae293f399dde3773cf37dfa9b77ca7e04ef772
fs/f2fs: Do not copy file names that are too long

A corrupt f2fs file system might specify a name length which is greater
than the maximum name length supported by the GRUB f2fs driver.

We will allocate enough memory to store the overly long name, but there
are only F2FS_NAME_LEN bytes in the source, so we would read past the end
of the source.

While checking directory entries, do not copy a file name with an invalid
length.

Signed-off-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/f2fs.c