]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: fix crash on fsync when using overlayfs v4
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 27 Feb 2017 06:21:18 +0000 (22:21 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 05:18:47 +0000 (21:18 -0800)
commit9bce26c80ccde0dd80a7e57bc21519ed7311dbbb
tree7750009a68bea204a94956f9e2cfd95e7914c06a
parentab3ecab07774e6271b2dd46da06de36da72f3abf
Btrfs: fix crash on fsync when using overlayfs v4

Orabug: 25512309

If the lower or upper directory of an overlayfs mount belongs to a btrfs
file system and we fsync the file through the overlayfs' merged directory
we ended up accessing an inode that didn't belong to btrfs as if it were a
btrfs inode at btrfs_sync_file() resulting in a crash.

This fixes the problem by getting the inode from file_inode() and getting
the real dentry for recursively checking up parent directory.

Note that the upstream fix is commit
de17e793b104d690e1d007dfc5cb6b4f649598ca ("btrfs: fix crash/invalid memory
access on fsync when using overlayfs").

But we are not able to use it since it uses a new helper file_dentry() and
the commit that adds the helper would cause KABI breakage.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/file.c