Re: [BUG] xfrm: a socket policy cloned for a TCP child leaks when cloning the second policy fails

From: Kyuwon Cho

Date: Sun Nov 22 2026 - 23:29:46 EST


On Mon, 23 Nov 2026 03:38:58 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> xfrm_sk_clone_policy() already sets the child slots to NULL before cloning.
> Would checking "if (np)" on the child pointer avoid both cases?

Yes. v2 checks np, the new socket's own slot, and is sent inline as a
proper patch. The report was also wrong that a partial clone leaves the
parent's sk_policy[1] in the child; that slot is NULL.

Kyuwon Cho

pw-bot: cr