From 398037eb27f120eff8b951628951dcf64cb0562f Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 23 Sep 2009 13:46:00 -0400 Subject: [PATCH] --- yaml --- r: 165857 b: refs/heads/master c: 939cbf260c1abce6cad4b95ea4ba9f5132b660b3 h: refs/heads/master i: 165855: 9d78fc877349052bc735df94c08dfe495b3d688d v: v3 --- [refs] | 2 +- trunk/kernel/audit.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 664bd6c68402..566a4f58320f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44e51a1b7852bd421ff5303c64dcc5c8524c21ef +refs/heads/master: 939cbf260c1abce6cad4b95ea4ba9f5132b660b3 diff --git a/trunk/kernel/audit.c b/trunk/kernel/audit.c index defc2e6f1e3b..5feed232be9d 100644 --- a/trunk/kernel/audit.c +++ b/trunk/kernel/audit.c @@ -855,18 +855,24 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) break; } case AUDIT_SIGNAL_INFO: - err = security_secid_to_secctx(audit_sig_sid, &ctx, &len); - if (err) - return err; + len = 0; + if (audit_sig_sid) { + err = security_secid_to_secctx(audit_sig_sid, &ctx, &len); + if (err) + return err; + } sig_data = kmalloc(sizeof(*sig_data) + len, GFP_KERNEL); if (!sig_data) { - security_release_secctx(ctx, len); + if (audit_sig_sid) + security_release_secctx(ctx, len); return -ENOMEM; } sig_data->uid = audit_sig_uid; sig_data->pid = audit_sig_pid; - memcpy(sig_data->ctx, ctx, len); - security_release_secctx(ctx, len); + if (audit_sig_sid) { + memcpy(sig_data->ctx, ctx, len); + security_release_secctx(ctx, len); + } audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_SIGNAL_INFO, 0, 0, sig_data, sizeof(*sig_data) + len); kfree(sig_data);