[lkml]   [2018]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.19 063/205] vfs: fix FIGETBSZ ioctl on an overlayfs file
4.19-stable review patch.  If anyone has any objections, please let me know.


From: Amir Goldstein <>

commit 8f97d1e99149a7f1aa19e47a51b09764382a482e upstream.

Some anon_bdev filesystems (e.g. overlayfs, ceph) don't have s_blocksize
set. Returning zero from FIGETBSZ ioctl results in a Floating point
exception from the e2fsprogs utility filefrag, which divides the size of
the file with the value returned by FIGETBSZ.

Fix the interface by returning -EINVAL for these filesystems.

Fixes: d1d04ef8572b ("ovl: stack file ops")
Cc: <> # v4.19
Signed-off-by: Amir Goldstein <>
Signed-off-by: Miklos Szeredi <>
Signed-off-by: Greg Kroah-Hartman <>

fs/ioctl.c | 3 +++
1 file changed, 3 insertions(+)

--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -669,6 +669,9 @@ int do_vfs_ioctl(struct file *filp, unsi
return ioctl_fiemap(filp, arg);

+ /* anon_bdev filesystems may not have a block size */
+ if (!inode->i_sb->s_blocksize)
+ return -EINVAL;
return put_user(inode->i_sb->s_blocksize, argp);


 \ /
  Last update: 2018-11-19 19:05    [W:0.547 / U:18.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site