]> git.baikalelectronics.ru Git - kernel.git/commit
raw: test against runtime value of max_raw_minors
authorPaul Bolle <pebolle@tiscali.nl>
Tue, 4 Feb 2014 22:23:12 +0000 (23:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 16:29:46 +0000 (08:29 -0800)
commit7120a11171b755f8c88497688a9e6ae1a0c18801
tree3149c5f0fa942917ed97655062377f9a184881ba
parentfe05c9fc4ccb6ebf3924cb7b201e519a8516afa6
raw: test against runtime value of max_raw_minors

bind_get() checks the device number it is called with. It uses
MAX_RAW_MINORS for the upper bound. But MAX_RAW_MINORS is set at compile
time while the actual number of raw devices can be set at runtime. This
means the test can either be too strict or too lenient. And if the test
ends up being too lenient bind_get() might try to access memory beyond
what was allocated for "raw_devices".

So check against the runtime value (max_raw_minors) in this function.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Jan Kara <jack@suse.cz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/raw.c