lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 8/8] security: yama: Use a more current logging style
Date
Convert printks to pr_<level>.
Add pr_fmt to prefix with "yama: "
Convert printk_ratelimited to pr_<level>_ratelimited.

Signed-off-by: Joe Perches <joe@perches.com>
---
security/yama/yama_lsm.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index 13c88fbc..9de0f2b 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -12,6 +12,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/security.h>
#include <linux/sysctl.h>
#include <linux/ptrace.h>
@@ -319,9 +321,8 @@ int yama_ptrace_access_check(struct task_struct *child,
}

if (rc) {
- printk_ratelimited(KERN_NOTICE
- "ptrace of pid %d was attempted by: %s (pid %d)\n",
- child->pid, current->comm, current->pid);
+ pr_notice_ratelimited("ptrace of pid %d was attempted by: %s (pid %d)\n",
+ child->pid, current->comm, current->pid);
}

return rc;
@@ -356,9 +357,8 @@ int yama_ptrace_traceme(struct task_struct *parent)
}

if (rc) {
- printk_ratelimited(KERN_NOTICE
- "ptraceme of pid %d was attempted by: %s (pid %d)\n",
- current->pid, parent->comm, parent->pid);
+ pr_notice_ratelimited("ptraceme of pid %d was attempted by: %s (pid %d)\n",
+ current->pid, parent->comm, parent->pid);
}

return rc;
@@ -425,16 +425,16 @@ static __init int yama_init(void)
return 0;
#endif

- printk(KERN_INFO "Yama: becoming mindful.\n");
+ pr_info("becoming mindful\n");

#ifndef CONFIG_SECURITY_YAMA_STACKED
if (register_security(&yama_ops))
- panic("Yama: kernel registration failed.\n");
+ panic("Yama: kernel registration failed\n");
#endif

#ifdef CONFIG_SYSCTL
if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table))
- panic("Yama: sysctl registration failed.\n");
+ panic("Yama: sysctl registration failed\n");
#endif

return 0;
--
1.8.1.2.459.gbcd45b4.dirty


\
 
 \ /
  Last update: 2014-02-25 22:41    [W:0.522 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site