linux-stable/fs/ext4
Al Viro 2d2d3f1ee7 do d_instantiate/unlock_new_inode combinations safely
commit 1e2e547a93 upstream.

For anything NFS-exported we do _not_ want to unlock new inode
before it has grown an alias; original set of fixes got the
ordering right, but missed the nasty complication in case of
lockdep being enabled - unlock_new_inode() does
	lockdep_annotate_inode_mutex_key(inode)
which can only be done before anyone gets a chance to touch
->i_mutex.  Unfortunately, flipping the order and doing
unlock_new_inode() before d_instantiate() opens a window when
mkdir can race with open-by-fhandle on a guessed fhandle, leading
to multiple aliases for a directory inode and all the breakage
that follows from that.

	Correct solution: a new primitive (d_instantiate_new())
combining these two in the right order - lockdep annotate, then
d_instantiate(), then the rest of unlock_new_inode().  All
combinations of d_instantiate() with unlock_new_inode() should
be converted to that.

Cc: stable@kernel.org	# 2.6.29 and later
Tested-by: Mike Marshall <hubcap@omnibond.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:50:16 +02:00
..
acl.c ext4: Don't clear SGID when inheriting ACLs 2017-10-12 11:51:26 +02:00
acl.h
balloc.c ext4: fix bitmap position validation 2018-05-01 15:13:03 -07:00
bitmap.c ext4: remove unused header files 2015-04-02 23:47:42 -04:00
block_validity.c ext4: add missing KERN_CONT to a few more debugging uses 2016-10-15 09:57:31 -04:00
dir.c ext4: remove unused variable 2016-09-30 02:14:56 -04:00
ext4.h ext4: sanity check the block and cluster size at mount time 2016-11-19 20:58:15 -05:00
ext4_extents.h ext4: fix misspellings in comments. 2016-03-09 23:49:05 -05:00
ext4_jbd2.c ext4: fix potential use after free in __ext4_journal_stop 2015-10-17 22:57:06 -04:00
ext4_jbd2.h ext4: do not perform data journaling when data is encrypted 2017-01-06 10:40:14 +01:00
extents.c ext4: prevent right-shifting extents beyond EXT_MAX_BLOCKS 2018-05-01 15:13:03 -07:00
extents_status.c ext4: remove trailing \n from ext4_warning/ext4_error calls 2016-04-27 01:11:21 -04:00
extents_status.h ext4: move procfs registration code to fs/ext4/sysfs.c 2015-09-23 12:46:17 -04:00
file.c ext4: fix off-by-one on max nr_pages in ext4_find_unwritten_pgoff() 2018-04-13 19:48:06 +02:00
fsync.c ext4: cleanup ext4_sync_parent() 2016-09-05 23:21:43 -04:00
hash.c ext4: remove unused header files 2015-04-02 23:47:42 -04:00
ialloc.c ext4: add validity checks for bitmap block numbers 2018-05-01 15:13:03 -07:00
indirect.c ext4: refactor direct IO code 2016-05-13 00:44:16 -04:00
inline.c ext4: mark inode dirty after converting inline directory 2017-03-30 09:41:25 +02:00
inode.c ext4: fail ext4_iget for root directory if unallocated 2018-04-24 09:34:12 +02:00
ioctl.c Lots of bug fixes and cleanups. 2016-10-07 15:15:33 -07:00
Kconfig ext4 crypto: migrate into vfs's crypto engine 2016-07-10 14:01:03 -04:00
Makefile ext4 crypto: migrate into vfs's crypto engine 2016-07-10 14:01:03 -04:00
mballoc.c ext4: handle the rest of ext4_mb_load_buddy() ENOMEM errors 2018-04-13 19:48:02 +02:00
mballoc.h ext4: add missing KERN_CONT to a few more debugging uses 2016-10-15 09:57:31 -04:00
migrate.c ext4: fix misspellings in comments. 2016-03-09 23:49:05 -05:00
mmp.c fs: have submit_bh users pass in op and flags separately 2016-06-07 13:41:38 -06:00
move_extent.c fs: add i_blocksize() 2017-06-14 15:06:00 +02:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:50:16 +02:00
page-io.c fs: use mapping_set_error instead of opencoded set_bit 2016-10-11 15:06:33 -07:00
readpage.c Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
resize.c ext4: fix overflow caused by missing cast in ext4_resize_fs() 2017-08-11 08:49:30 -07:00
super.c ext4: don't allow r/w mounts if metadata blocks overlap the superblock 2018-04-24 09:34:15 +02:00
symlink.c Merge branch 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-10 17:11:50 -07:00
sysfs.c ext4: check return value of kstrtoull correctly in reserved_clusters_store 2017-07-15 12:16:16 +02:00
truncate.h ext4: fix races between page faults and hole punching 2015-12-07 14:28:03 -05:00
xattr.c ext4: inplace xattr block update fails to deduplicate blocks 2018-03-18 11:18:54 +01:00
xattr.h ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2017-03-12 06:41:41 +01:00
xattr_security.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_trusted.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_user.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00