[RAMEN9610-21564]do_last(): fetch directory ->i_mode and ->i_uid before it's too...
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Jan 2020 14:29:34 +0000 (09:29 -0500)
committerchenyt9 <chenyt9@lenovo.com>
Wed, 14 Oct 2020 07:32:47 +0000 (15:32 +0800)
commit75530dbc62f9ccbdedab30bbd94f5f3ecce71b36
treef9a8144bb0aa04ad3268ac5677fd7fab584fd222
parentc94f5c5b47f1b2ff5fcad05675a7506b50bf0aa8
[RAMEN9610-21564]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.

Change-Id: Ied338ffbf1c0ab7a9ed65dfb25fc44bde879d64b
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