]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ext4: fix use-after-iput when fscrypt contexts are inconsistent
authorEric Biggers <ebiggers@google.com>
Thu, 2 Feb 2017 02:07:11 +0000 (21:07 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 13 Mar 2017 21:20:54 +0000 (15:20 -0600)
commit8cc984fc55bb0080905782b8750826661bb07adc
tree59a6a63e9baf2bb50020a1b92d734ff389285f98
parentfb97071a7db33d96aa1a4b79479f6cbe0a3ded21
ext4: fix use-after-iput when fscrypt contexts are inconsistent

BugLink: http://bugs.launchpad.net/bugs/1672544
commit dd01b690f8f4b1e414f89e5a9a5326bf720d6652 upstream.

In the case where the child's encryption context was inconsistent with
its parent directory, we were using inode->i_sb and inode->i_ino after
the inode had already been iput().  Fix this by doing the iput() in the
correct places.

Note: only ext4 had this bug, not f2fs and ubifs.

Fixes: d9cdc9033181 ("ext4 crypto: enforce context consistency")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/ext4/namei.c