]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.1/kmod-prevent-kmod_loop_msg-overflow-in-__request_module.patch
Drop watchdog patch
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / kmod-prevent-kmod_loop_msg-overflow-in-__request_module.patch
1 From 37252db6aa576c34fd794a5a54fb32d7a8b3a07a Mon Sep 17 00:00:00 2001
2 From: Jiri Kosina <jkosina@suse.cz>
3 Date: Wed, 26 Oct 2011 13:10:39 +1030
4 Subject: kmod: prevent kmod_loop_msg overflow in __request_module()
5
6 From: Jiri Kosina <jkosina@suse.cz>
7
8 commit 37252db6aa576c34fd794a5a54fb32d7a8b3a07a upstream.
9
10 Due to post-increment in condition of kmod_loop_msg in __request_module(),
11 the system log can be spammed by much more than 5 instances of the 'runaway
12 loop' message if the number of events triggering it makes the kmod_loop_msg
13 to overflow.
14
15 Fix that by making sure we never increment it past the threshold.
16
17 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
18 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21 ---
22 kernel/kmod.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
25 --- a/kernel/kmod.c
26 +++ b/kernel/kmod.c
27 @@ -114,10 +114,12 @@ int __request_module(bool wait, const ch
28 atomic_inc(&kmod_concurrent);
29 if (atomic_read(&kmod_concurrent) > max_modprobes) {
30 /* We may be blaming an innocent here, but unlikely */
31 - if (kmod_loop_msg++ < 5)
32 + if (kmod_loop_msg < 5) {
33 printk(KERN_ERR
34 "request_module: runaway loop modprobe %s\n",
35 module_name);
36 + kmod_loop_msg++;
37 + }
38 atomic_dec(&kmod_concurrent);
39 return -ENOMEM;
40 }