[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)
committerPDO SCM Team <hudsoncm@motorola.com>
Fri, 5 Jun 2020 06:23:39 +0000 (01:23 -0500)
commit3b938c79c2852401c3f8453e25a302adc547a3f5
treed98b32bf7f7ae3d3c931b3db266b31794d3f606c
parent2b71e5d242b5a8b20ea4bcd524134cbf5c42ab24
[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>
(cherry picked from commit e6bdd445f7b580a8e28e33ef16f9c86ccf8730d4)
fs/namei.c