Re: [PATCH] xfrm: policy: Fix use-after-free on inexact bin in xfrm_policy_bysel_ctx()

From: Sanghyun Park

Date: Tue Jun 02 2026 - 02:25:00 EST


Thank you for the review. I apologize for the several mistakes I've made.

> There is no such commit, neither ID nor subject.

You are right, I apologize. The correct one is:
Fixes: 6be3b0db6db8 ("xfrm: policy: add inexact policy search tree infrastructure")

> Looks like this patch is whitespace-damaged.

Will use git send-email for v2.

> Could you also say in changelog why you added the 3rd criterion?
> Became (bin && ret && delete).

The extra ret check was only meant to avoid pruning the inexact bin when
the lookup did not actually find and unlink a policy. Pruning in that
case is harmless but unnecessary. It is sort of an optimization fix
rather than security-related one.

After looking at it again, I will drop the extra ret check in v2 and keep
the original condition as bin && delete to make the patch minimal.

I will send a v2 with these fixes in a concise version.

Thank you,
Sanghyun