__bitmap_parselist: fix bug in empty string handling
authorChris Metcalf <cmetcalf@ezchip.com>
Thu, 25 Jun 2015 22:02:08 +0000 (15:02 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:09:27 +0000 (13:09 +0000)
commite818f6a6785eef9fd666dd92ef74393b3f6229e8
tree9954a3cc4948d8b4707ff94f6e979d5efc4c00b3
parent99eaad608480878125cdd19bf236d56320821521
__bitmap_parselist: fix bug in empty string handling

commit 2528a8b8f457d7432552d0e2b6f0f4046bb702f4 upstream.

bitmap_parselist("", &mask, nmaskbits) will erroneously set bit zero in
the mask.  The same bug is visible in cpumask_parselist() since it is
layered on top of the bitmask code, e.g.  if you boot with "isolcpus=",
you will actually end up with cpu zero isolated.

The bug was introduced in commit 4b060420a596 ("bitmap, irq: add
smp_affinity_list interface to /proc/irq") when bitmap_parselist() was
generalized to support userspace as well as kernelspace.

Fixes: 4b060420a596 ("bitmap, irq: add smp_affinity_list interface to /proc/irq")
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
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/bitmap.c