CacheFiles: Fix error handling in cachefiles_determine_cache_security()
commit5e54866e4de87f3eedcadd96fe12cf1544f374b5
authorDavid Howells <dhowells@redhat.com>
Wed, 12 May 2010 14:34:03 +0000 (12 15:34 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:32:11 +0000 (26 14:32 -0700)
treed471bff0a72670dd2feb9d511729f8c4f31d039f
parent4c55f33e52794d882f7f210841abb3a5e558a024
CacheFiles: Fix error handling in cachefiles_determine_cache_security()

commit 7ac512aa8237c43331ffaf77a4fd8b8d684819ba upstream.

cachefiles_determine_cache_security() is expected to return with a
security override in place.  However, if set_create_files_as() fails, we
fail to do this.  In this case, we should just reinstate the security
override that was set by the caller.

Furthermore, if set_create_files_as() fails, we should dispose of the
new credentials we were in the process of creating.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cachefiles/security.c