aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2011-05-26 17:20:14 -0400
committerEric Paris <eparis@redhat.com>2011-05-26 17:20:14 -0400
commitea77f7a2e8561012cf100c530170f12351c3b53e (patch)
tree7302ac1064f4e364aadda84020a176804fb86e22 /security/security.c
parent7a627e3b9a2bd0f06945bbe64bcf403e788ecf6e (diff)
parent61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff)
Merge commit 'v2.6.39' into 20110526
Conflicts: lib/flex_array.c security/selinux/avc.c security/selinux/hooks.c security/selinux/ss/policydb.c security/smack/smack_lsm.c
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/security/security.c b/security/security.c
index 7e34f98bf433..4ba6d4cc061f 100644
--- a/security/security.c
+++ b/security/security.c
@@ -154,29 +154,33 @@ int security_capset(struct cred *new, const struct cred *old,
154 effective, inheritable, permitted); 154 effective, inheritable, permitted);
155} 155}
156 156
157int security_capable(const struct cred *cred, int cap) 157int security_capable(struct user_namespace *ns, const struct cred *cred,
158 int cap)
158{ 159{
159 return security_ops->capable(current, cred, cap, SECURITY_CAP_AUDIT); 160 return security_ops->capable(current, cred, ns, cap,
161 SECURITY_CAP_AUDIT);
160} 162}
161 163
162int security_real_capable(struct task_struct *tsk, int cap) 164int security_real_capable(struct task_struct *tsk, struct user_namespace *ns,
165 int cap)
163{ 166{
164 const struct cred *cred; 167 const struct cred *cred;
165 int ret; 168 int ret;
166 169
167 cred = get_task_cred(tsk); 170 cred = get_task_cred(tsk);
168 ret = security_ops->capable(tsk, cred, cap, SECURITY_CAP_AUDIT); 171 ret = security_ops->capable(tsk, cred, ns, cap, SECURITY_CAP_AUDIT);
169 put_cred(cred); 172 put_cred(cred);
170 return ret; 173 return ret;
171} 174}
172 175
173int security_real_capable_noaudit(struct task_struct *tsk, int cap) 176int security_real_capable_noaudit(struct task_struct *tsk,
177 struct user_namespace *ns, int cap)
174{ 178{
175 const struct cred *cred; 179 const struct cred *cred;
176 int ret; 180 int ret;
177 181
178 cred = get_task_cred(tsk); 182 cred = get_task_cred(tsk);
179 ret = security_ops->capable(tsk, cred, cap, SECURITY_CAP_NOAUDIT); 183 ret = security_ops->capable(tsk, cred, ns, cap, SECURITY_CAP_NOAUDIT);
180 put_cred(cred); 184 put_cred(cred);
181 return ret; 185 return ret;
182} 186}
@@ -196,7 +200,7 @@ int security_syslog(int type)
196 return security_ops->syslog(type); 200 return security_ops->syslog(type);
197} 201}
198 202
199int security_settime(struct timespec *ts, struct timezone *tz) 203int security_settime(const struct timespec *ts, const struct timezone *tz)
200{ 204{
201 return security_ops->settime(ts, tz); 205 return security_ops->settime(ts, tz);
202} 206}
@@ -1103,7 +1107,7 @@ void security_sk_clone(const struct sock *sk, struct sock *newsk)
1103 1107
1104void security_sk_classify_flow(struct sock *sk, struct flowi *fl) 1108void security_sk_classify_flow(struct sock *sk, struct flowi *fl)
1105{ 1109{
1106 security_ops->sk_getsecid(sk, &fl->secid); 1110 security_ops->sk_getsecid(sk, &fl->flowi_secid);
1107} 1111}
1108EXPORT_SYMBOL(security_sk_classify_flow); 1112EXPORT_SYMBOL(security_sk_classify_flow);
1109 1113
@@ -1236,7 +1240,8 @@ int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir)
1236} 1240}
1237 1241
1238int security_xfrm_state_pol_flow_match(struct xfrm_state *x, 1242int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
1239 struct xfrm_policy *xp, struct flowi *fl) 1243 struct xfrm_policy *xp,
1244 const struct flowi *fl)
1240{ 1245{
1241 return security_ops->xfrm_state_pol_flow_match(x, xp, fl); 1246 return security_ops->xfrm_state_pol_flow_match(x, xp, fl);
1242} 1247}
@@ -1248,7 +1253,7 @@ int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
1248 1253
1249void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl) 1254void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl)
1250{ 1255{
1251 int rc = security_ops->xfrm_decode_session(skb, &fl->secid, 0); 1256 int rc = security_ops->xfrm_decode_session(skb, &fl->flowi_secid, 0);
1252 1257
1253 BUG_ON(rc); 1258 BUG_ON(rc);
1254} 1259}