Re: [PATCH] mm/swap: fix swap_info_struct race between swapoff and get_swap_pages()

From: Rongwei Wang
Date: Sun Apr 02 2023 - 10:56:40 EST



On 4/2/23 9:37 PM, Bagas Sanjaya wrote:
On Sun, Apr 02, 2023 at 06:19:20AM +0800, Rongwei Wang wrote:
Without this modification, a core will wait (mostly)
"Currently, a core will ..."

But, a worse consequence, panic also can be caused by
"However, in the worst case, ..."

In this patch, we lock p->lock before calling
"Lock p->lock before calling ..."

We also find this problem exists in stable 5.10.
So, you claim that 5.15.y and 6.1.y aren't affected, right?

I think above both versions also be affected. I can check they next.


Also, Cc: stable@xxxxxxxxxxxxxxx on the SoB area (as pointed by kernel
test robot [1].
Thanks, next version will to do.

Thanks.

[1]: https://lore.kernel.org/stable/ZCiuGEkyk%2F1Afisk@ec83ac1404bb/