]> Git Repo - J-linux.git/commit
ovl: check whiteout in ovl_create_over_whiteout()
authorMiklos Szeredi <[email protected]>
Wed, 31 Oct 2018 11:15:23 +0000 (12:15 +0100)
committerMiklos Szeredi <[email protected]>
Wed, 31 Oct 2018 11:15:23 +0000 (12:15 +0100)
commit5e1275808630ea3b2c97c776f40e475017535f72
tree0a7d5c43ac0b662ad2822627a6f2dbc371c21530
parent14fa085640a7eb55431eec8a0273bbf0c463ce46
ovl: check whiteout in ovl_create_over_whiteout()

Kaixuxia repors that it's possible to crash overlayfs by removing the
whiteout on the upper layer before creating a directory over it.  This is a
reproducer:

 mkdir lower upper work merge
 touch lower/file
 mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merge
 rm merge/file
 ls -al merge/file
 rm upper/file
 ls -al merge/
 mkdir merge/file

Before commencing with a vfs_rename(..., RENAME_EXCHANGE) verify that the
lookup of "upper" is positive and is a whiteout, and return ESTALE
otherwise.

Reported by: kaixuxia <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Fixes: e9be9d5e76e3 ("overlay filesystem")
Cc: <[email protected]> # v3.18
fs/overlayfs/dir.c
This page took 0.048708 seconds and 4 git commands to generate.