]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ecryptfs: initialize private persistent file before dereferencing pointer
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 3 Dec 2009 18:35:27 +0000 (13:35 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:20:23 +0000 (15:20 -0800)
commit4d3b891bdf8a0cf1ef02938aea9fc353ce2a4b68
treeeadf53d9efab26b1fb7789218571171158a333d2
parentb3f881085c970a6c59d3e594e58278a4a00122da
ecryptfs: initialize private persistent file before dereferencing pointer

commit e27759d7a333d1f25d628c4f7caf845c51be51c2 upstream.

Ecryptfs_open dereferences a pointer to the private lower file (the one
stored in the ecryptfs inode), without checking if the pointer is NULL.
Right afterward, it initializes that pointer if it is NULL.  Swap order of
statements to first initialize.  Bug discovered by Duckjin Kang.

Signed-off-by: Duckjin Kang <fromdj2k@gmail.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Cc: Dustin Kirkland <kirkland@canonical.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/file.c