ovl: fix error handling in ovl_verify_set_fh()
authorAmir Goldstein <amir73il@gmail.com>
Wed, 10 Oct 2018 16:10:06 +0000 (19:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:19:12 +0000 (09:19 +0100)
commit37403ba3c4135da033714bfba42fdc0c23ecbdeb
tree58b84f7ec25b2e214056e79c74514a568d3b1fe4
parentc8099dbf492b565a4f75ae7b8c08b76ca18c4c3f
ovl: fix error handling in ovl_verify_set_fh()

commit babf4770be0adc69e6d2de150f4040f175e24beb upstream.

We hit a BUG on kfree of an ERR_PTR()...

Reported-by: syzbot+ff03fe05c717b82502d0@syzkaller.appspotmail.com
Fixes: 8b88a2e64036 ("ovl: verify upper root dir matches lower root dir")
Cc: <stable@vger.kernel.org> # v4.13
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/namei.c