[PATCH] ARM: spectre-v2: fix unstable cpu get
xieyuanbin1
xieyuanbin1 at huawei.com
Thu Apr 24 06:31:33 PDT 2025
From: Xie Yuanbin <xieyuanbin1 at huawei.com>
>> From: Xie Yuanbin <xieyuanbin1 at huawei.com>
>>
>> When a user program accesses the kernel address,
>
>Please see
>https://lore.kernel.org/all/795c9463-452e-bf64-1cc0-c318ccecb1da@I-love.SAKURA.ne.jp/T/
>
>As I see it, this can't be fixed - certainly not in this way due to the
>reasons I set out in the above thread.
Oh, I'm sorry that I haven't noticed that someone has submitted similar patch before.
I've actually thought about a similar problem. In areas other than put_cpu/get_cpu, tasks may be scheduled to other CPUs, this cpu actually does not execute the spectre code.
However, in this case, a context_switch must be happended. Inside switch_mm, the spectre code is still executed, so I didn't think of it as a problem.
But there is a situation, if we switch to another thread of **this** process, we will not execute switch_mm, which is so sad.
As mentioned in the previous patch discussion, this is only an alarm. However, I do not think so. On heterogeneous CPUs, the spectre code of different cores may have different implementations.
If another cpu's fn is executed, there may be illegal instruction and panic.
User processes can attack this point, which is very dangerous.
More information about the linux-arm-kernel
mailing list