]> git.baikalelectronics.ru Git - kernel.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)
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>
Wed, 20 Jan 2010 04:32:54 +0000 (22:32 -0600)
commite4d64550bbdce470c99d4f8de7d002f9f9d52502
tree6181c5f5abe8b2e4b7bdc45f1231c769cc57a403
parentbf7a8470e4d45a382c7dc6a6d69040455f552f0d
ecryptfs: initialize private persistent file before dereferencing pointer

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>
Cc: <stable@kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
fs/ecryptfs/file.c