Revert "cpumask: fix checking valid cpu range".
This reverts commit 78e5a3399421 ("cpumask: fix checking valid cpu range").
syzbot is hitting WARN_ON_ONCE(cpu >= nr_cpumask_bits) warning at
cpu_max_bits_warn() , for commit 78e5a3399421 ("cpumask: fix checking
valid cpu range") is broken. Obviously that patch hits WARN_ON_ONCE()
when e.g. reading /proc/cpuinfo because passing "cpu + 1" instead of
"cpu" will trivially hit cpu == nr_cpumask_bits condition.
Although syzbot found this problem in linux-next.git on 2022/09/27 ,
this problem was not fixed immediately. As a result, that patch was
sent to linux.git before the patch author recognizes this problem, and
syzbot started failing to test changes in linux.git since 2022/10/10
Andrew Jones proposed a fix for x86 and riscv architectures . But
 and  indicate that affected locations are not limited to arch
code. More delay before we find and fix affected locations, less tested
kernel (and more difficult to bisect and fix) before release.
We should have inspected and fixed basically all cpumask users before
applying that patch. We should not crash kernels in order to ask
existing cpumask users to update their code, even if limited to
Link: https://syzkaller.appspot.com/bug?extid=d0fd2bf0dd6da72496dd 
Link: https://syzkaller.appspot.com/bug?extid=21da700f3c9f0bc40150 
Link: https://syzkaller.appspot.com/bug?extid=51a652e2d24d53e75734 
Link: https://firstname.lastname@example.org 
Link: https://syzkaller.appspot.com/bug?extid=4d46c43d81c3bd155060 
Reported-by: Andrew Jones <email@example.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Yury Norov <firstname.lastname@example.org>
Cc: Borislav Petkov <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
1 file changed