]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ovl: relax WARN_ON() on rename to self
authorAmir Goldstein <amir73il@gmail.com>
Fri, 6 Dec 2019 06:33:36 +0000 (08:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:07:41 +0000 (20:07 +0100)
commite216ed638b04f044bfaa9a791001f2d295e533e0
tree062c67f76f0f1970dbd13338b3cf60a1050e3b3d
parent801a491252c419f262765efed108df8db36d04e2
ovl: relax WARN_ON() on rename to self

commit 6889ee5a53b8d969aa542047f5ac8acdc0e79a91 upstream.

In ovl_rename(), if new upper is hardlinked to old upper underneath
overlayfs before upper dirs are locked, user will get an ESTALE error
and a WARN_ON will be printed.

Changes to underlying layers while overlayfs is mounted may result in
unexpected behavior, but it shouldn't crash the kernel and it shouldn't
trigger WARN_ON() either, so relax this WARN_ON().

Reported-by: syzbot+bb1836a212e69f8e201a@syzkaller.appspotmail.com
Fixes: 804032fabb3b ("ovl: don't check rename to self")
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/dir.c