diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
commit | 36b8d186e6cc8e32cb5227f5645a58e1bc0af190 (patch) | |
tree | 1000ad26e189e6ff2c53fb7eeff605f59c7ad94e /fs/xfs/xfs_iops.c | |
parent | cd85b557414fe4cd44ea6608825e96612a5fe2b2 (diff) | |
parent | c45ed235abf1b0b6666417e3c394f18717976acd (diff) |
Merge branch 'next' of git://selinuxproject.org/~jmorris/linux-security
* 'next' of git://selinuxproject.org/~jmorris/linux-security: (95 commits)
TOMOYO: Fix incomplete read after seek.
Smack: allow to access /smack/access as normal user
TOMOYO: Fix unused kernel config option.
Smack: fix: invalid length set for the result of /smack/access
Smack: compilation fix
Smack: fix for /smack/access output, use string instead of byte
Smack: domain transition protections (v3)
Smack: Provide information for UDS getsockopt(SO_PEERCRED)
Smack: Clean up comments
Smack: Repair processing of fcntl
Smack: Rule list lookup performance
Smack: check permissions from user space (v2)
TOMOYO: Fix quota and garbage collector.
TOMOYO: Remove redundant tasklist_lock.
TOMOYO: Fix domain transition failure warning.
TOMOYO: Remove tomoyo_policy_memory_lock spinlock.
TOMOYO: Simplify garbage collector.
TOMOYO: Fix make namespacecheck warnings.
target: check hex2bin result
encrypted-keys: check hex2bin result
...
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r-- | fs/xfs/xfs_iops.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 673704fab748..28856accb4fa 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -102,37 +102,38 @@ xfs_mark_inode_dirty( | |||
102 | 102 | ||
103 | } | 103 | } |
104 | 104 | ||
105 | |||
106 | int xfs_initxattrs(struct inode *inode, const struct xattr *xattr_array, | ||
107 | void *fs_info) | ||
108 | { | ||
109 | const struct xattr *xattr; | ||
110 | struct xfs_inode *ip = XFS_I(inode); | ||
111 | int error = 0; | ||
112 | |||
113 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { | ||
114 | error = xfs_attr_set(ip, xattr->name, xattr->value, | ||
115 | xattr->value_len, ATTR_SECURE); | ||
116 | if (error < 0) | ||
117 | break; | ||
118 | } | ||
119 | return error; | ||
120 | } | ||
121 | |||
105 | /* | 122 | /* |
106 | * Hook in SELinux. This is not quite correct yet, what we really need | 123 | * Hook in SELinux. This is not quite correct yet, what we really need |
107 | * here (as we do for default ACLs) is a mechanism by which creation of | 124 | * here (as we do for default ACLs) is a mechanism by which creation of |
108 | * these attrs can be journalled at inode creation time (along with the | 125 | * these attrs can be journalled at inode creation time (along with the |
109 | * inode, of course, such that log replay can't cause these to be lost). | 126 | * inode, of course, such that log replay can't cause these to be lost). |
110 | */ | 127 | */ |
128 | |||
111 | STATIC int | 129 | STATIC int |
112 | xfs_init_security( | 130 | xfs_init_security( |
113 | struct inode *inode, | 131 | struct inode *inode, |
114 | struct inode *dir, | 132 | struct inode *dir, |
115 | const struct qstr *qstr) | 133 | const struct qstr *qstr) |
116 | { | 134 | { |
117 | struct xfs_inode *ip = XFS_I(inode); | 135 | return security_inode_init_security(inode, dir, qstr, |
118 | size_t length; | 136 | &xfs_initxattrs, NULL); |
119 | void *value; | ||
120 | unsigned char *name; | ||
121 | int error; | ||
122 | |||
123 | error = security_inode_init_security(inode, dir, qstr, (char **)&name, | ||
124 | &value, &length); | ||
125 | if (error) { | ||
126 | if (error == -EOPNOTSUPP) | ||
127 | return 0; | ||
128 | return -error; | ||
129 | } | ||
130 | |||
131 | error = xfs_attr_set(ip, name, value, length, ATTR_SECURE); | ||
132 | |||
133 | kfree(name); | ||
134 | kfree(value); | ||
135 | return error; | ||
136 | } | 137 | } |
137 | 138 | ||
138 | static void | 139 | static void |