kmod: prevent kmod_loop_msg overflow in __request_module()
commit4d3e486fb80b593cdb04d240b2cadaf8c40dd863
authorJiri Kosina <jkosina@suse.cz>
Wed, 26 Oct 2011 02:40:39 +0000 (26 13:10 +1030)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Nov 2011 20:32:27 +0000 (7 12:32 -0800)
tree98f681298e616997ed94069b5abb81feae81e5d1
parentb628ea1f5cd046c9bd07c5ebef824bae08a85f1c
kmod: prevent kmod_loop_msg overflow in __request_module()

commit 37252db6aa576c34fd794a5a54fb32d7a8b3a07a upstream.

Due to post-increment in condition of kmod_loop_msg in __request_module(),
the system log can be spammed by much more than 5 instances of the 'runaway
loop' message if the number of events triggering it makes the kmod_loop_msg
to overflow.

Fix that by making sure we never increment it past the threshold.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/kmod.c