lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e3c505c1b807c150a49e95d442d9fea2e77bdd6c.1416167046.git.joe@perches.com>
Date:	Sun, 16 Nov 2014 12:09:11 -0800
From:	Joe Perches <joe@...ches.com>
To:	Ionut Alexa <ionut.m.alexa@...il.com>, linux-kernel@...r.kernel.org
Cc:	Al Viro <viro@...IV.linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [UNNECESSARY PATCH 04/16] signal: Use pr_<level>

Use the more current logging style.

Add pr_fmt to prefix messages with "signal: "
Remove local use of DEFINE_RATELIMIT_STATE and __ratelimit and
use pr_info_ratelimited instead.

Signed-off-by: Joe Perches <joe@...ches.com>
---
 kernel/signal.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 969c6ba..0efde2d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -10,6 +10,8 @@
  *		to allow signals to be sent reliably.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/export.h>
 #include <linux/init.h>
@@ -216,16 +218,11 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
 
 static inline void print_dropped_signal(int sig)
 {
-	static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
-
 	if (!print_fatal_signals)
 		return;
 
-	if (!__ratelimit(&ratelimit_state))
-		return;
-
-	printk(KERN_INFO "%s/%d: reached RLIMIT_SIGPENDING, dropped signal %d\n",
-	       current->comm, current->pid, sig);
+	pr_info_ratelimited("%s/%d: reached RLIMIT_SIGPENDING, dropped signal %d\n",
+			    current->comm, current->pid, sig);
 }
 
 /**
@@ -1147,10 +1144,10 @@ static void print_fatal_signal(int signr)
 {
 	struct pt_regs *regs = signal_pt_regs();
 
-	printk(KERN_INFO "potentially unexpected fatal signal %d.\n", signr);
+	pr_info("potentially unexpected fatal signal %d\n", signr);
 
 #if defined(__i386__) && !defined(__arch_um__)
-	printk(KERN_INFO "code at %08lx: ", regs->ip);
+	pr_info("code at %08lx:", regs->ip);
 	{
 		int i;
 
@@ -1159,10 +1156,10 @@ static void print_fatal_signal(int signr)
 
 			if (get_user(insn, (unsigned char *)(regs->ip + i)))
 				break;
-			printk(KERN_CONT "%02x ", insn);
+			pr_cont(" %02x", insn);
 		}
 	}
-	printk(KERN_CONT "\n");
+	pr_cont("\n");
 #endif
 	preempt_disable();
 	show_regs(regs);
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ