mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
fs: check for statfs overflow
Adds a check for an overflow in the filesystem size so if someone is checking with statfs() on a 16G blocksize hugetlbfs in a 32bit binary that it will report back EOVERFLOW instead of a size of 0. Acked-by: Nishanth Aravamudan <[email protected]> Signed-off-by: Jon Tollefson <[email protected]> Signed-off-by: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
91224346aa
commit
f4a67cceee
2 changed files with 6 additions and 5 deletions
|
|
@ -64,7 +64,8 @@ static int vfs_statfs_native(struct dentry *dentry, struct statfs *buf)
|
|||
memcpy(buf, &st, sizeof(st));
|
||||
else {
|
||||
if (sizeof buf->f_blocks == 4) {
|
||||
if ((st.f_blocks | st.f_bfree | st.f_bavail) &
|
||||
if ((st.f_blocks | st.f_bfree | st.f_bavail |
|
||||
st.f_bsize | st.f_frsize) &
|
||||
0xffffffff00000000ULL)
|
||||
return -EOVERFLOW;
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue