From: Eric Paris <eparis@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/2] audit: Convert int limit uses to u32
Date: Tue, 14 Jan 2014 14:07:36 -0500 [thread overview]
Message-ID: <1389726456.681.0.camel@flatline.rdu.redhat.com> (raw)
In-Reply-To: <7122d36ffb0d82a660bdf16f0c344d7611a5c1e1.1389724329.git.joe@perches.com>
On Tue, 2014-01-14 at 10:33 -0800, Joe Perches wrote:
> The equivalent uapi struct uses __u32 so make the kernel
> uses u32 too.
>
> This can prevent some oddities where the limit is
> logged/emitted as a negative value.
>
> Convert kstrtol to kstrtouint to disallow negative values.
> diff --git a/kernel/audit.c b/kernel/audit.c
> index f397ab2..902c3aa 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -79,16 +79,16 @@ static int audit_initialized;
> #define AUDIT_OFF 0
> #define AUDIT_ON 1
> #define AUDIT_LOCKED 2
> -int audit_enabled;
> -int audit_ever_enabled;
> +u32 audit_enabled;
> +u32 audit_ever_enabled;
>
> EXPORT_SYMBOL_GPL(audit_enabled);
>
> /* Default state when kernel boots without any parameters. */
> -static int audit_default;
> +u32 audit_default;
Can't figure out why you dropped the static...
I'm putting it back.
>
> /* If auditing cannot proceed, audit_failure selects what happens. */
> -static int audit_failure = AUDIT_FAIL_PRINTK;
> +static u32 audit_failure = AUDIT_FAIL_PRINTK;
>
> /*
> * If audit records are to be written to the netlink socket, audit_pid
next prev parent reply other threads:[~2014-01-14 19:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 18:33 [PATCH 1/2] audit: Use more current logging style Joe Perches
2014-01-14 18:33 ` [PATCH 2/2] audit: Convert int limit uses to u32 Joe Perches
2014-01-14 19:07 ` Eric Paris [this message]
2014-01-14 19:12 ` Joe Perches
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=1389726456.681.0.camel@flatline.rdu.redhat.com \
--to=eparis@redhat.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®