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

From: Alexey Charkov

Date: Thu Nov 12 2026 - 08:24:31 EST


Hi Bean,

On Wed, Nov 11, 2026 at 10:43 PM Bean Huo <beanhuo@xxxxxxxx> wrote:
>
>
> 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

Thanks a lot for pointing this out, I hadn't seen Stanley's series
before, and it indeed covers my case and more. I've sent my tested-by
on Stanley's v6 thread. Let's drop this patch in favor of Stanley's
series.

Best regards,
Alexey