All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: linux-audit@redhat.com
Subject: Re: [PATCH] Audit: do not print error when SELinux disabled
Date: Tue, 23 Oct 2012 20:53:43 -0700	[thread overview]
Message-ID: <50876647.4050204@schaufler-ca.com> (raw)
In-Reply-To: <1350997115.3801.5.camel@dhcp137-49.rdu.redhat.com>

On 10/23/2012 5:58 AM, Eric Paris wrote:
> RHBZ: 785936
> About to be posted upstream
>
> If the audit system collects a record about one process sending a signal
> to another process it includes in that collection the 'secid' or 'an int
> used to represet an SELinux label.'  If SELinux is disabled it will
> collect a 0.  The problem is that when we attempt to print that record
> we ask the LSM to convert the secid back to a string.  Since there is no
> LSM it returns EOPNOTSUPP.

Err, what about Smack?


>
> Most code in the audit system checks if the secid is 0 and does not
> print LSM info in that case.  The signal information code however forgot
> that check.  Thus users will see a message in syslog indicating that
> converting the sid to string failed.  Add the right check.
>
> Signed-off-by: Eric Paris <eparis@redhat.com>
>
> ---
>
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index 857f2e2..1f5cc03 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -1195,12 +1195,14 @@ static int audit_log_pid_context(struct audit_context *context, pid_t pid,
>  
>  	audit_log_format(ab, "opid=%d oauid=%d ouid=%d oses=%d", pid, auid,
>  			 uid, sessionid);
> -	if (security_secid_to_secctx(sid, &ctx, &len)) {
> -		audit_log_format(ab, " obj=(none)");
> -		rc = 1;
> -	} else {
> -		audit_log_format(ab, " obj=%s", ctx);
> -		security_release_secctx(ctx, len);
> +	if (sid) {
> +		if (security_secid_to_secctx(sid, &ctx, &len)) {
> +			audit_log_format(ab, " obj=(none)");
> +			rc = 1;
> +		} else {
> +			audit_log_format(ab, " obj=%s", ctx);
> +			security_release_secctx(ctx, len);
> +		}
>  	}
>  	audit_log_format(ab, " ocomm=");
>  	audit_log_untrustedstring(ab, comm);
>
>
>
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit
>

  parent reply	other threads:[~2012-10-24  3:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 12:58 [PATCH] Audit: do not print error when SELinux disabled Eric Paris
2012-10-23 15:46 ` Paul Moore
2012-10-24  3:53 ` Casey Schaufler [this message]
2012-10-24 16:10 ` Casey Schaufler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50876647.4050204@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.