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 |
---|---|---|
asymmetric_keys | ||
async_tx | ||
.gitignore | -rw-r--r-- | 12 bytes |
842.c | -rw-r--r-- | 4.2 KB |
Kconfig | -rw-r--r-- | 49.3 KB |
Makefile | -rw-r--r-- | 5.3 KB |
ablk_helper.c | -rw-r--r-- | 4.4 KB |
ablkcipher.c | -rw-r--r-- | 12.9 KB |
acompress.c | -rw-r--r-- | 4.2 KB |
aead.c | -rw-r--r-- | 10.1 KB |
aes_generic.c | -rw-r--r-- | 62.0 KB |
af_alg.c | -rw-r--r-- | 10.6 KB |
ahash.c | -rw-r--r-- | 14.7 KB |
akcipher.c | -rw-r--r-- | 3.9 KB |
algapi.c | -rw-r--r-- | 21.1 KB |
algboss.c | -rw-r--r-- | 6.0 KB |
algif_aead.c | -rw-r--r-- | 18.9 KB |
algif_hash.c | -rw-r--r-- | 10.4 KB |
algif_rng.c | -rw-r--r-- | 5.2 KB |
algif_skcipher.c | -rw-r--r-- | 21.1 KB |
ansi_cprng.c | -rw-r--r-- | 10.9 KB |
anubis.c | -rw-r--r-- | 27.8 KB |
api.c | -rw-r--r-- | 13.6 KB |
arc4.c | -rw-r--r-- | 3.4 KB |
authenc.c | -rw-r--r-- | 13.9 KB |
authencesn.c | -rw-r--r-- | 15.2 KB |
blkcipher.c | -rw-r--r-- | 15.0 KB |
blowfish_common.c | -rw-r--r-- | 15.7 KB |
blowfish_generic.c | -rw-r--r-- | 3.4 KB |
camellia_generic.c | -rw-r--r-- | 34.9 KB |
cast5_generic.c | -rw-r--r-- | 20.9 KB |
cast6_generic.c | -rw-r--r-- | 9.5 KB |
cast_common.c | -rw-r--r-- | 13.1 KB |
cbc.c | -rw-r--r-- | 4.9 KB |
ccm.c | -rw-r--r-- | 22.7 KB |
chacha20_generic.c | -rw-r--r-- | 3.9 KB |
chacha20poly1305.c | -rw-r--r-- | 19.3 KB |
cipher.c | -rw-r--r-- | 3.3 KB |
cmac.c | -rw-r--r-- | 7.7 KB |
compress.c | -rw-r--r-- | 1.3 KB |
crc32_generic.c | -rw-r--r-- | 3.8 KB |
crc32c_generic.c | -rw-r--r-- | 4.3 KB |
crct10dif_common.c | -rw-r--r-- | 3.6 KB |
crct10dif_generic.c | -rw-r--r-- | 3.2 KB |
cryptd.c | -rw-r--r-- | 36.3 KB |
crypto_engine.c | -rw-r--r-- | 12.0 KB |
crypto_null.c | -rw-r--r-- | 5.3 KB |
crypto_user.c | -rw-r--r-- | 13.1 KB |
crypto_wq.c | -rw-r--r-- | 972 bytes |
ctr.c | -rw-r--r-- | 12.4 KB |
cts.c | -rw-r--r-- | 12.2 KB |
deflate.c | -rw-r--r-- | 7.2 KB |
des_generic.c | -rw-r--r-- | 35.7 KB |
dh.c | -rw-r--r-- | 3.7 KB |
dh_helper.c | -rw-r--r-- | 2.6 KB |
drbg.c | -rw-r--r-- | 57.5 KB |
ecb.c | -rw-r--r-- | 4.9 KB |
ecc.c | -rw-r--r-- | 24.4 KB |
ecc.h | -rw-r--r-- | 3.4 KB |
ecc_curve_defs.h | -rw-r--r-- | 1.5 KB |
ecdh.c | -rw-r--r-- | 3.5 KB |
ecdh_helper.c | -rw-r--r-- | 2.3 KB |
echainiv.c | -rw-r--r-- | 4.6 KB |
fcrypt.c | -rw-r--r-- | 18.0 KB |
fips.c | -rw-r--r-- | 1.6 KB |
gcm.c | -rw-r--r-- | 33.2 KB |
gf128mul.c | -rw-r--r-- | 12.2 KB |
ghash-generic.c | -rw-r--r-- | 3.6 KB |
hash_info.c | -rw-r--r-- | 1.9 KB |
hmac.c | -rw-r--r-- | 6.8 KB |
internal.h | -rw-r--r-- | 4.1 KB |
jitterentropy-kcapi.c | -rw-r--r-- | 6.0 KB |
jitterentropy.c | -rw-r--r-- | 23.9 KB |
keywrap.c | -rw-r--r-- | 12.6 KB |
khazad.c | -rw-r--r-- | 51.8 KB |
kpp.c | -rw-r--r-- | 2.9 KB |
lrw.c | -rw-r--r-- | 14.6 KB |
lz4.c | -rw-r--r-- | 4.0 KB |
lz4hc.c | -rw-r--r-- | 4.1 KB |
lzo.c | -rw-r--r-- | 3.9 KB |
mcryptd.c | -rw-r--r-- | 17.5 KB |
md4.c | -rw-r--r-- | 6.2 KB |
md5.c | -rw-r--r-- | 4.1 KB |
memneq.c | -rw-r--r-- | 6.1 KB |
michael_mic.c | -rw-r--r-- | 3.6 KB |
pcbc.c | -rw-r--r-- | 7.8 KB |
pcrypt.c | -rw-r--r-- | 13.2 KB |
poly1305_generic.c | -rw-r--r-- | 8.0 KB |
proc.c | -rw-r--r-- | 3.0 KB |
ripemd.h | -rw-r--r-- | 974 bytes |
rmd128.c | -rw-r--r-- | 10.2 KB |
rmd160.c | -rw-r--r-- | 12.6 KB |
rmd256.c | -rw-r--r-- | 10.6 KB |
rmd320.c | -rw-r--r-- | 13.1 KB |
rng.c | -rw-r--r-- | 5.0 KB |
rsa-pkcs1pad.c | -rw-r--r-- | 17.6 KB |
rsa.c | -rw-r--r-- | 7.5 KB |
rsa_helper.c | -rw-r--r-- | 4.2 KB |
rsaprivkey.asn1 | -rw-r--r-- | 316 bytes |
rsapubkey.asn1 | -rw-r--r-- | 82 bytes |
salsa20_generic.c | -rw-r--r-- | 6.7 KB |
scatterwalk.c | -rw-r--r-- | 2.2 KB |
scompress.c | -rw-r--r-- | 7.8 KB |
seed.c | -rw-r--r-- | 17.4 KB |
seqiv.c | -rw-r--r-- | 5.4 KB |
serpent_generic.c | -rw-r--r-- | 21.2 KB |
sha1_generic.c | -rw-r--r-- | 2.6 KB |
sha256_generic.c | -rw-r--r-- | 11.0 KB |
sha3_generic.c | -rw-r--r-- | 7.0 KB |
sha512_generic.c | -rw-r--r-- | 7.1 KB |
shash.c | -rw-r--r-- | 14.1 KB |
simd.c | -rw-r--r-- | 6.1 KB |
skcipher.c | -rw-r--r-- | 24.6 KB |
tcrypt.c | -rw-r--r-- | 50.8 KB |
tcrypt.h | -rw-r--r-- | 4.3 KB |
tea.c | -rw-r--r-- | 6.6 KB |
testmgr.c | -rw-r--r-- | 90.9 KB |
testmgr.h | -rw-r--r-- | 1.2 MB |
tgr192.c | -rw-r--r-- | 30.5 KB |
twofish_common.c | -rw-r--r-- | 37.8 KB |
twofish_generic.c | -rw-r--r-- | 6.3 KB |
vmac.c | -rw-r--r-- | 18.9 KB |
wp512.c | -rw-r--r-- | 59.8 KB |
xcbc.c | -rw-r--r-- | 7.2 KB |
xor.c | -rw-r--r-- | 4.0 KB |
xts.c | -rw-r--r-- | 13.5 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...