Re: [PATCH] scsi: ufs: core: Register the RPMB bus before adding devices to it

From: Bean Huo

Date: Wed Nov 11 2026 - 14:11:30 EST



Hi Alexey,

Thanks. The code is correct, but this exact failure is already fixed in
Stanley's series, which has been on the list since September:
https://lore.kernel.org/all/20260914144910.931518-1-stanleyjhu@xxxxxxxxxx

The order there matters. Once ufs_rpmb devices register again, which is what
your patch does, two bugs come back: a use-after-free on host unbind, and
concurrent RPMB requests that get each other's responses. Stanley measured both
with KASAN. Patches 1/3 and 2/3 fix them, and 3/3 turns registration back on
last. Taking this patch first would open that window again in mainline and in
stable.

So I would prefer to drop this one in favour of the series. If you have a board
where RPMB fails today, a Tested-by on v5 would help, please have a try
Stanley's patches. thanks


Kind regards,
Bean