Skip to content

Commit e4f6822

Browse files
cschauflerpcmoore
authored andcommitted
audit: update shutdown LSM data
The audit process LSM information is changed from a secid audit_sig_sid to an lsm_prop in audit_sig_lsm. Update the users of this data appropriately. Calls to security_secid_to_secctx() are changed to use security_lsmprop_to_secctx() instead. security_current_getsecid_subj() is scaffolded. It will be updated in a subsequent patch. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> [PM: subject line tweak] Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent f4602f1 commit e4f6822

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

kernel/audit.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME;
123123
/* The identity of the user shutting down the audit system. */
124124
static kuid_t audit_sig_uid = INVALID_UID;
125125
static pid_t audit_sig_pid = -1;
126-
static u32 audit_sig_sid;
126+
static struct lsm_prop audit_sig_lsm;
127127

128128
/* Records can be lost in several ways:
129129
0) [suppressed in audit_alloc]
@@ -1473,20 +1473,21 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
14731473
}
14741474
case AUDIT_SIGNAL_INFO:
14751475
len = 0;
1476-
if (audit_sig_sid) {
1477-
err = security_secid_to_secctx(audit_sig_sid, &ctx, &len);
1476+
if (lsmprop_is_set(&audit_sig_lsm)) {
1477+
err = security_lsmprop_to_secctx(&audit_sig_lsm, &ctx,
1478+
&len);
14781479
if (err)
14791480
return err;
14801481
}
14811482
sig_data = kmalloc(struct_size(sig_data, ctx, len), GFP_KERNEL);
14821483
if (!sig_data) {
1483-
if (audit_sig_sid)
1484+
if (lsmprop_is_set(&audit_sig_lsm))
14841485
security_release_secctx(ctx, len);
14851486
return -ENOMEM;
14861487
}
14871488
sig_data->uid = from_kuid(&init_user_ns, audit_sig_uid);
14881489
sig_data->pid = audit_sig_pid;
1489-
if (audit_sig_sid) {
1490+
if (lsmprop_is_set(&audit_sig_lsm)) {
14901491
memcpy(sig_data->ctx, ctx, len);
14911492
security_release_secctx(ctx, len);
14921493
}
@@ -2404,7 +2405,8 @@ int audit_signal_info(int sig, struct task_struct *t)
24042405
audit_sig_uid = auid;
24052406
else
24062407
audit_sig_uid = uid;
2407-
security_current_getsecid_subj(&audit_sig_sid);
2408+
/* scaffolding */
2409+
security_current_getsecid_subj(&audit_sig_lsm.scaffold.secid);
24082410
}
24092411

24102412
return audit_signal_info_syscall(t);

0 commit comments

Comments
 (0)