Bug 189981
Summary: | md5sum fails with message "Invalid argument" on 4,294,967,295-byte files in FAT32 - tracked down to kernel's fread and stdio stream | ||
---|---|---|---|
Product: | File System | Reporter: | Jaime Gaspar (mail) |
Component: | FAT/VFAT/MSDOS | Assignee: | OGAWA Hirofumi (hirofumi) |
Status: | RESOLVED INVALID | ||
Severity: | low | CC: | |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 4.8.0-30-generic | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Jaime Gaspar
2016-12-09 21:03:26 UTC
Hm, tested on debian/testing with v4.8 vanilla (+ debian gcc PIE fix). However, I couldn't reproduce it. # truncate -s 9G tmp.fs # mkfs.vfat -F 32 tmp.fs mkfs.fat 4.0 (2016-05-06) # mount -o loop,rw,uid=1000,gid=1000 tmp.fs m # cd m # truncate -s 4294967294 file_1 # truncate -s 4294967295 file_2 # md5sum file_1 541249e3205af07b4a03f891185f64a0 file_1 # md5sum file_2 c654ebc4b3472cfa01ade24bbbbc6d3e file_2 Can you try v4.8 vanilla? Thanks. bugzilla-daemon@bugzilla.kernel.org writes: > The outputs should be respectively (notice that the second output is an error > message): > 541249e3205af07b4a03f891185f64a0 file_1 > md5sum: file_2: Invalid argument Hm, tested on debian/testing with v4.8 vanilla (+ debian gcc PIE fix). However, I couldn't reproduce it. # truncate -s 9G tmp.fs # mkfs.vfat -F 32 tmp.fs mkfs.fat 4.0 (2016-05-06) # mount -o loop,rw,uid=1000,gid=1000 tmp.fs m # cd m # truncate -s 4294967294 file_1 # truncate -s 4294967295 file_2 # md5sum file_1 541249e3205af07b4a03f891185f64a0 file_1 # md5sum file_2 c654ebc4b3472cfa01ade24bbbbc6d3e file_2 Can you try v4.8 vanilla? Thanks. > Hm, tested on debian/testing with v4.8 vanilla (+ debian gcc PIE fix). > However, I couldn't reproduce it. ... > Can you try v4.8 vanilla? I tested with kernel 4.8.0-040800-generic from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/ and I cannot reproduce the bug. I tested with kernel 4.8.0-30-generic from an updated Ubuntu 16.10 and I can reproduce the bug. With quick check, ubuntu seems to added incompatible change. This should be reported to ubuntu. @@ -1674,6 +1687,10 @@ unsigned int prev_offset; int error = 0; + if (unlikely(*ppos >= inode->i_sb->s_maxbytes)) + return -EINVAL; + iov_iter_truncate(iter, inode->i_sb->s_maxbytes); + |