OSDN Git Service

lib/cmdline.c: fix get_options() overflow while parsing ranges
authorIlya Matveychikov <matvejchikov@gmail.com>
Fri, 23 Jun 2017 22:08:49 +0000 (15:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2017 10:48:51 +0000 (12:48 +0200)
commit7b88f761929e86813c2a1eb878dcc17abbb6119f
tree36962eff1fd92db6447a4ab68abcabbd684c02a5
parentb95aa98e77d7086f4a303a5e9402ab165a5f0cc6
lib/cmdline.c: fix get_options() overflow while parsing ranges

commit a91e0f680bcd9e10c253ae8b62462a38bd48f09f upstream.

When using get_options() it's possible to specify a range of numbers,
like 1-100500.  The problem is that it doesn't track array size while
calling internally to get_range() which iterates over the range and
fills the memory with numbers.

Link: http://lkml.kernel.org/r/2613C75C-B04D-4BFF-82A6-12F97BA0F620@gmail.com
Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/cmdline.c