[PATCH] security: Fix security_old_inode_init_security() when CONFIG_SECURITY is not set

From: Jan Kara
Date: Tue Jan 03 2012 - 07:14:29 EST


Commit 1e39f384bb01b0395b69cb70c2cacae65012f203 makes
security_old_inode_init_security() return 0 when CONFIG_SECURITY is not set.
But that makes callers such as reiserfs_security_init() assume that
security_old_inode_init_security() has set name, value, and len arguments
properly. But security_old_inode_init_security() left them uninitialized
which then results in interesting failures.

Revert security_old_inode_init_security() to the old behavior of returning
EOPNOTSUPP since both callers (reiserfs and ocfs2) handle this just fine.

Reported-by: Jorge Bastos <mysql.jorge@xxxxxxxxxx>
CC: James Morris <jmorris@xxxxxxxxx>
CC: Mimi Zohar <zohar@xxxxxxxxxx>
Signed-off-by: Jan Kara <jack@xxxxxxx>
---
include/linux/security.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/security.h b/include/linux/security.h
index 19d8e04..e8c619d 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -2056,7 +2056,7 @@ static inline int security_old_inode_init_security(struct inode *inode,
char **name, void **value,
size_t *len)
{
- return 0;
+ return -EOPNOTSUPP;
}

static inline int security_inode_create(struct inode *dir,
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/