Re: [PATCH] kmod: prevent kmod_loop_msg overflow in__request_module()

From: Jiri Kosina
Date: Tue Oct 04 2011 - 05:38:08 EST


On Tue, 4 Oct 2011, Rusty Russell wrote:

> > > Well, it will take two billion passes through here to cause the
> > > overflow. I really hope you found this problem by inspection!
> >
> > Unfortunately not, it was more painful experience than code reading :)
>
> Cool!
>
> Changing it to unsigned would have helped too.

Still woudln't have helped much in cases of __request_module() being
called incredibly quickly in an infinite loop. Changing it to unsigned
will cause the messages being printed in bunches of five, but the effect
will be the same -- the log being infinitely filled by the printk()s.
Computers can do infinite loops really quickly today :)

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