do_last(): fetch directory ->i_mode and ->i_uid before it's too late
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Jan 2020 14:29:34 +0000 (09:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 15:45:31 +0000 (16:45 +0100)
commit454759886d0b463213fad0f1c733469e2c501ab9
treee6ffb85f4b4efb2c7e7ea352d5187a2afee07f9c
parent5d001c4f74e0417c25e1da6fc861e8f9ee0ba290
do_last(): fetch directory ->i_mode and ->i_uid before it's too late

commit d0cb50185ae942b03c4327be322055d622dc79f6 upstream.

may_create_in_sticky() call is done when we already have dropped the
reference to dir.

Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namei.c