]> 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, 1 Apr 2010 22:55:34 +0000 (15:55 -0700)
commit1f19180adb1711a88c9f60bce99d8f8442fa2981
tree431acbf837525938e08a46a4b2d4d27a94fa3112
parent954eec71d4436334622f2549d647c036a8763828
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