From: John Johansen <john.johansen@canonical.com>
To: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Cc: James Morris <james.l.morris@oracle.com>,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH 2/8] security: apparmor: Use a more current logging style
Date: Tue, 25 Feb 2014 23:31:46 -0800 [thread overview]
Message-ID: <530D9862.1070108@canonical.com> (raw)
In-Reply-To: <ff8a7d422cfa605de40dc64c103f27ed7a76e0cf.1393279025.git.joe@perches.com>
On 02/24/2014 01:59 PM, Joe Perches wrote:
> Convert printks to pr_<level>.
> Add pr_fmt.
> Coalesce formats.
> Remove embedded prefixes from logging.
>
you missed one place,
--- a/security/apparmor/include/apparmor.h
+++ b/security/apparmor/include/apparmor.h
@@ -50,7 +50,7 @@ extern unsigned int aa_g_path_max;
#define AA_DEBUG(fmt, args...) \
do { \
if (aa_g_debug && printk_ratelimit()) \
- printk(KERN_DEBUG "AppArmor: " fmt, ##args); \
+ pr_debug(fmt, ##args); \
} while (0)
#define AA_ERROR(fmt, args...) \
other than that looks good.
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: John Johansen <john.johansen@canonical.com>
> ---
> security/apparmor/apparmorfs.c | 2 ++
> security/apparmor/crypto.c | 2 ++
> security/apparmor/include/apparmor.h | 2 +-
> security/apparmor/lib.c | 4 +++-
> security/apparmor/lsm.c | 2 ++
> security/apparmor/match.c | 5 +++--
> security/apparmor/policy.c | 2 ++
> security/apparmor/procattr.c | 2 ++
> 8 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 7db9954..d4b65cc 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -12,6 +12,8 @@
> * License.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <linux/ctype.h>
> #include <linux/security.h>
> #include <linux/vmalloc.h>
> diff --git a/security/apparmor/crypto.c b/security/apparmor/crypto.c
> index 532471d..9506544 100644
> --- a/security/apparmor/crypto.c
> +++ b/security/apparmor/crypto.c
> @@ -15,6 +15,8 @@
> * it should be.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <crypto/hash.h>
>
> #include "include/apparmor.h"
> diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h
> index 8fb1488..3065025 100644
> --- a/security/apparmor/include/apparmor.h
> +++ b/security/apparmor/include/apparmor.h
> @@ -56,7 +56,7 @@ extern unsigned int aa_g_path_max;
> #define AA_ERROR(fmt, args...) \
> do { \
> if (printk_ratelimit()) \
> - printk(KERN_ERR "AppArmor: " fmt, ##args); \
> + pr_err(fmt, ##args); \
> } while (0)
>
> /* Flag indicating whether initialization completed */
> diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
> index 6968992..432b1b6 100644
> --- a/security/apparmor/lib.c
> +++ b/security/apparmor/lib.c
> @@ -12,6 +12,8 @@
> * License.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <linux/mm.h>
> #include <linux/slab.h>
> #include <linux/string.h>
> @@ -73,7 +75,7 @@ void aa_info_message(const char *str)
> aad.info = str;
> aa_audit_msg(AUDIT_APPARMOR_STATUS, &sa, NULL);
> }
> - printk(KERN_INFO "AppArmor: %s\n", str);
> + pr_info("%s\n", str);
> }
>
> /**
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index 9981000..49f0180 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -12,6 +12,8 @@
> * License.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <linux/security.h>
> #include <linux/moduleparam.h>
> #include <linux/mm.h>
> diff --git a/security/apparmor/match.c b/security/apparmor/match.c
> index 727eb42..688482a 100644
> --- a/security/apparmor/match.c
> +++ b/security/apparmor/match.c
> @@ -12,6 +12,8 @@
> * License.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <linux/errno.h>
> #include <linux/kernel.h>
> #include <linux/mm.h>
> @@ -140,8 +142,7 @@ static int verify_dfa(struct aa_dfa *dfa, int flags)
> if (DEFAULT_TABLE(dfa)[i] >= state_count)
> goto out;
> if (base_idx(BASE_TABLE(dfa)[i]) + 255 >= trans_count) {
> - printk(KERN_ERR "AppArmor DFA next/check upper "
> - "bounds error\n");
> + pr_err("DFA next/check upper bounds error\n");
> goto out;
> }
> }
> diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
> index 705c287..4e20c1f 100644
> --- a/security/apparmor/policy.c
> +++ b/security/apparmor/policy.c
> @@ -73,6 +73,8 @@
> * FIXME: move profile lists to using rcu_lists
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/string.h>
> diff --git a/security/apparmor/procattr.c b/security/apparmor/procattr.c
> index b125acc..c105fc5 100644
> --- a/security/apparmor/procattr.c
> +++ b/security/apparmor/procattr.c
> @@ -12,6 +12,8 @@
> * License.
> */
>
> +#define pr_fmt(fmt) "AppArmor: " fmt
> +
> #include "include/apparmor.h"
> #include "include/context.h"
> #include "include/policy.h"
>
next prev parent reply other threads:[~2014-02-26 7:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 21:59 [PATCH 0/8] security: Use a more current logging style Joe Perches
2014-02-24 21:59 ` [PATCH 1/8] " Joe Perches
2014-02-25 19:10 ` Serge Hallyn
2014-02-25 19:34 ` Joe Perches
2014-02-25 19:41 ` [PATCH V2 " Joe Perches
2014-02-24 21:59 ` [PATCH 2/8] security: apparmor: " Joe Perches
2014-02-26 7:31 ` John Johansen [this message]
2014-02-26 14:43 ` Joe Perches
2014-02-24 21:59 ` [PATCH 3/8] security: integrity: " Joe Perches
2014-02-25 2:59 ` Mimi Zohar
2014-02-24 21:59 ` [PATCH 4/8] security: keys: " Joe Perches
2014-02-24 21:59 ` [PATCH 5/8] security: selinux: " Joe Perches
2014-02-24 21:59 ` Joe Perches
2014-02-25 20:05 ` Paul Moore
2014-02-25 20:05 ` Paul Moore
2014-02-25 20:20 ` Joe Perches
2014-02-25 20:20 ` Joe Perches
2014-02-24 21:59 ` [PATCH 6/8] security: smack: " Joe Perches
2014-02-24 22:16 ` Casey Schaufler
2014-02-24 22:23 ` Joe Perches
2014-02-24 22:33 ` Casey Schaufler
2014-02-24 22:35 ` Casey Schaufler
2014-02-24 23:01 ` Casey Schaufler
2014-02-25 7:47 ` James Morris
[not found] ` <17D2BA68-5581-4326-B6DD-5EC959235B71@aol.com>
2014-02-26 0:56 ` Joe Perches
2014-02-24 22:00 ` [PATCH 7/8] security: tomoyo: " Joe Perches
2014-02-25 12:58 ` Tetsuo Handa
2014-02-24 22:00 ` [PATCH 8/8] security: yama: " 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=530D9862.1070108@canonical.com \
--to=john.johansen@canonical.com \
--cc=james.l.morris@oracle.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
/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.