Yury Norov 8351760ff5 lib: fix stall in __bitmap_parselist()
syzbot is catching stalls at __bitmap_parselist()
(https://syzkaller.appspot.com/bug?id=ad7e0351fbc90535558514a71cd3edc11681997a).
The trigger is

  unsigned long v = 0;
  bitmap_parselist("7:,", &v, BITS_PER_LONG);

which results in hitting infinite loop at

    while (a <= b) {
	    off = min(b - a + 1, used_size);
	    bitmap_set(maskp, a, off);
	    a += group_size;
    }

due to used_size == group_size == 0.

Link: http://lkml.kernel.org/r/20180404162647.15763-1-ynorov@caviumnetworks.com
Fixes: 0a5ce0831d04382a ("lib/bitmap.c: make bitmap_parselist() thread-safe and much faster")
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+6887cbb011c8054e8a3d@syzkaller.appspotmail.com>
Cc: Noam Camus <noamca@mellanox.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-05 21:36:21 -07:00
..
2017-12-22 19:39:09 +11:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2018-02-06 18:32:44 -08:00
2018-01-01 12:40:27 -07:00
2018-02-06 18:32:44 -08:00
2017-10-07 10:45:14 -06:00
2017-02-24 17:46:57 -08:00
2018-02-26 14:39:30 -05:00
2018-01-31 11:32:27 -08:00
2018-04-03 15:51:22 -07:00
2018-02-06 18:32:47 -08:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2016-12-06 10:17:03 +02:00
2018-02-21 15:35:43 -08:00
2018-03-31 23:25:39 -04:00
2017-12-01 13:09:40 -08:00
2017-08-15 09:02:07 -07:00