Revision 4d59b6ccf000862beed6fc0765d3209f98a8d8a2 authored by Tejun Heo on 08 February 2017, 22:30:56 UTC, committed by Linus Torvalds on 08 February 2017, 23:41:43 UTC
Commit 513e3d2d11c9 ("cpumask: always use nr_cpu_ids in formatting and parsing functions") converted both cpumask printing and parsing functions to use nr_cpu_ids instead of nr_cpumask_bits. While this was okay for the printing functions as it just picked one of the two output formats that we were alternating between depending on a kernel config, doing the same for parsing wasn't okay. nr_cpumask_bits can be either nr_cpu_ids or NR_CPUS. We can always use nr_cpu_ids but that is a variable while NR_CPUS is a constant, so it can be more efficient to use NR_CPUS when we can get away with it. Converting the printing functions to nr_cpu_ids makes sense because it affects how the masks get presented to userspace and doesn't break anything; however, using nr_cpu_ids for parsing functions can incorrectly leave the higher bits uninitialized while reading in these masks from userland. As all testing and comparison functions use nr_cpumask_bits which can be larger than nr_cpu_ids, the parsed cpumasks can erroneously yield false negative results. This made the taskstats interface incorrectly return -EINVAL even when the inputs were correct. Fix it by restoring the parse functions to use nr_cpumask_bits instead of nr_cpu_ids. Link: http://lkml.kernel.org/r/20170206182442.GB31078@htj.duckdns.org Fixes: 513e3d2d11c9 ("cpumask: always use nr_cpu_ids in formatting and parsing functions") Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Martin Steigerwald <martin.steigerwald@teamix.de> Debugged-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Cc: <stable@vger.kernel.org> [4.0+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0911d00
File | Mode | Size |
---|---|---|
acpica | ||
apei | ||
arm64 | ||
dptf | ||
nfit | ||
pmic | ||
Kconfig | -rw-r--r-- | 16.5 KB |
Makefile | -rw-r--r-- | 3.2 KB |
ac.c | -rw-r--r-- | 11.0 KB |
acpi_amba.c | -rw-r--r-- | 2.8 KB |
acpi_apd.c | -rw-r--r-- | 4.4 KB |
acpi_cmos_rtc.c | -rw-r--r-- | 2.1 KB |
acpi_configfs.c | -rw-r--r-- | 5.9 KB |
acpi_dbg.c | -rw-r--r-- | 18.2 KB |
acpi_extlog.c | -rw-r--r-- | 8.7 KB |
acpi_ipmi.c | -rw-r--r-- | 17.0 KB |
acpi_lpat.c | -rw-r--r-- | 4.4 KB |
acpi_lpss.c | -rw-r--r-- | 24.9 KB |
acpi_memhotplug.c | -rw-r--r-- | 10.3 KB |
acpi_pad.c | -rw-r--r-- | 12.4 KB |
acpi_platform.c | -rw-r--r-- | 3.8 KB |
acpi_pnp.c | -rw-r--r-- | 13.7 KB |
acpi_processor.c | -rw-r--r-- | 17.3 KB |
acpi_video.c | -rw-r--r-- | 54.3 KB |
acpi_watchdog.c | -rw-r--r-- | 3.0 KB |
battery.c | -rw-r--r-- | 38.5 KB |
battery.h | -rw-r--r-- | 220 bytes |
bgrt.c | -rw-r--r-- | 2.7 KB |
blacklist.c | -rw-r--r-- | 5.3 KB |
bus.c | -rw-r--r-- | 32.1 KB |
button.c | -rw-r--r-- | 16.3 KB |
cm_sbs.c | -rw-r--r-- | 2.8 KB |
container.c | -rw-r--r-- | 3.3 KB |
cppc_acpi.c | -rw-r--r-- | 35.0 KB |
custom_method.c | -rw-r--r-- | 2.1 KB |
debugfs.c | -rw-r--r-- | 422 bytes |
device_pm.c | -rw-r--r-- | 31.6 KB |
device_sysfs.c | -rw-r--r-- | 16.5 KB |
dock.c | -rw-r--r-- | 17.1 KB |
ec.c | -rw-r--r-- | 53.5 KB |
ec_sys.c | -rw-r--r-- | 3.5 KB |
event.c | -rw-r--r-- | 4.2 KB |
evged.c | -rw-r--r-- | 3.8 KB |
fan.c | -rw-r--r-- | 10.6 KB |
glue.c | -rw-r--r-- | 9.0 KB |
gsi.c | -rw-r--r-- | 2.6 KB |
hed.c | -rw-r--r-- | 2.3 KB |
internal.h | -rw-r--r-- | 8.3 KB |
ioapic.c | -rw-r--r-- | 5.6 KB |
numa.c | -rw-r--r-- | 12.7 KB |
nvs.c | -rw-r--r-- | 4.6 KB |
osi.c | -rw-r--r-- | 13.1 KB |
osl.c | -rw-r--r-- | 39.1 KB |
pci_irq.c | -rw-r--r-- | 14.1 KB |
pci_link.c | -rw-r--r-- | 24.2 KB |
pci_mcfg.c | -rw-r--r-- | 8.3 KB |
pci_root.c | -rw-r--r-- | 24.5 KB |
pci_slot.c | -rw-r--r-- | 5.1 KB |
power.c | -rw-r--r-- | 22.3 KB |
proc.c | -rw-r--r-- | 3.6 KB |
processor_core.c | -rw-r--r-- | 11.4 KB |
processor_driver.c | -rw-r--r-- | 8.6 KB |
processor_idle.c | -rw-r--r-- | 38.0 KB |
processor_pdc.c | -rw-r--r-- | 4.6 KB |
processor_perflib.c | -rw-r--r-- | 20.1 KB |
processor_thermal.c | -rw-r--r-- | 6.5 KB |
processor_throttling.c | -rw-r--r-- | 31.2 KB |
property.c | -rw-r--r-- | 23.4 KB |
reboot.c | -rw-r--r-- | 1.3 KB |
resource.c | -rw-r--r-- | 21.4 KB |
sbs.c | -rw-r--r-- | 20.2 KB |
sbshc.c | -rw-r--r-- | 7.2 KB |
sbshc.h | -rw-r--r-- | 960 bytes |
scan.c | -rw-r--r-- | 53.7 KB |
sleep.c | -rw-r--r-- | 22.0 KB |
sleep.h | -rw-r--r-- | 412 bytes |
spcr.c | -rw-r--r-- | 2.4 KB |
sysfs.c | -rw-r--r-- | 25.0 KB |
tables.c | -rw-r--r-- | 21.2 KB |
thermal.c | -rw-r--r-- | 32.0 KB |
utils.c | -rw-r--r-- | 18.9 KB |
video_detect.c | -rw-r--r-- | 11.8 KB |
wakeup.c | -rw-r--r-- | 2.7 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...