diff options
| author | Patrick McHardy <kaber@trash.net> | 2011-03-03 13:55:40 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-03-03 13:55:40 -0500 |
| commit | c53fa1ed92cd671a1dfb1e7569e9ab672612ddc6 (patch) | |
| tree | 9bb539a7731af94cac0112b8f13771e4a33e0450 /kernel | |
| parent | 06dc94b1ed05f91e246315afeb1c652d6d0dc9ab (diff) | |
netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parms
Netlink message processing in the kernel is synchronous these days, the
session information can be collected when needed.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/audit.c | 6 | ||||
| -rw-r--r-- | kernel/auditfilter.c | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 162e88e33bc9..939500317066 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -673,9 +673,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
| 673 | 673 | ||
| 674 | pid = NETLINK_CREDS(skb)->pid; | 674 | pid = NETLINK_CREDS(skb)->pid; |
| 675 | uid = NETLINK_CREDS(skb)->uid; | 675 | uid = NETLINK_CREDS(skb)->uid; |
| 676 | loginuid = NETLINK_CB(skb).loginuid; | 676 | loginuid = audit_get_loginuid(current); |
| 677 | sessionid = NETLINK_CB(skb).sessionid; | 677 | sessionid = audit_get_sessionid(current); |
| 678 | sid = NETLINK_CB(skb).sid; | 678 | security_task_getsecid(current, &sid); |
| 679 | seq = nlh->nlmsg_seq; | 679 | seq = nlh->nlmsg_seq; |
| 680 | data = NLMSG_DATA(nlh); | 680 | data = NLMSG_DATA(nlh); |
| 681 | 681 | ||
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index add2819af71b..f8277c80d678 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
| @@ -1238,6 +1238,7 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb, | |||
| 1238 | for (i = 0; i < rule->field_count; i++) { | 1238 | for (i = 0; i < rule->field_count; i++) { |
| 1239 | struct audit_field *f = &rule->fields[i]; | 1239 | struct audit_field *f = &rule->fields[i]; |
| 1240 | int result = 0; | 1240 | int result = 0; |
| 1241 | u32 sid; | ||
| 1241 | 1242 | ||
| 1242 | switch (f->type) { | 1243 | switch (f->type) { |
| 1243 | case AUDIT_PID: | 1244 | case AUDIT_PID: |
| @@ -1250,19 +1251,22 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb, | |||
| 1250 | result = audit_comparator(cb->creds.gid, f->op, f->val); | 1251 | result = audit_comparator(cb->creds.gid, f->op, f->val); |
| 1251 | break; | 1252 | break; |
| 1252 | case AUDIT_LOGINUID: | 1253 | case AUDIT_LOGINUID: |
| 1253 | result = audit_comparator(cb->loginuid, f->op, f->val); | 1254 | result = audit_comparator(audit_get_loginuid(current), |
| 1255 | f->op, f->val); | ||
| 1254 | break; | 1256 | break; |
| 1255 | case AUDIT_SUBJ_USER: | 1257 | case AUDIT_SUBJ_USER: |
| 1256 | case AUDIT_SUBJ_ROLE: | 1258 | case AUDIT_SUBJ_ROLE: |
| 1257 | case AUDIT_SUBJ_TYPE: | 1259 | case AUDIT_SUBJ_TYPE: |
| 1258 | case AUDIT_SUBJ_SEN: | 1260 | case AUDIT_SUBJ_SEN: |
| 1259 | case AUDIT_SUBJ_CLR: | 1261 | case AUDIT_SUBJ_CLR: |
| 1260 | if (f->lsm_rule) | 1262 | if (f->lsm_rule) { |
| 1261 | result = security_audit_rule_match(cb->sid, | 1263 | security_task_getsecid(current, &sid); |
| 1264 | result = security_audit_rule_match(sid, | ||
| 1262 | f->type, | 1265 | f->type, |
| 1263 | f->op, | 1266 | f->op, |
| 1264 | f->lsm_rule, | 1267 | f->lsm_rule, |
| 1265 | NULL); | 1268 | NULL); |
| 1269 | } | ||
| 1266 | break; | 1270 | break; |
| 1267 | } | 1271 | } |
| 1268 | 1272 | ||
