git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CacheFiles: Fix error handling in cachefiles_determine_cache_security()
[pandora-kernel.git]
/
fs
/
cachefiles
/
security.c
diff --git
a/fs/cachefiles/security.c
b/fs/cachefiles/security.c
index
b5808cd
..
039b501
100644
(file)
--- a/
fs/cachefiles/security.c
+++ b/
fs/cachefiles/security.c
@@
-77,6
+77,8
@@
static int cachefiles_check_cache_dir(struct cachefiles_cache *cache,
/*
* check the security details of the on-disk cache
* - must be called with security override in force
/*
* check the security details of the on-disk cache
* - must be called with security override in force
+ * - must return with a security override in force - even in the case of an
+ * error
*/
int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
struct dentry *root,
*/
int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
struct dentry *root,
@@
-99,6
+101,8
@@
int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
* which create files */
ret = set_create_files_as(new, root->d_inode);
if (ret < 0) {
* which create files */
ret = set_create_files_as(new, root->d_inode);
if (ret < 0) {
+ abort_creds(new);
+ cachefiles_begin_secure(cache, _saved_cred);
_leave(" = %d [cfa]", ret);
return ret;
}
_leave(" = %d [cfa]", ret);
return ret;
}