This patch sets x->state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state to avoid triggering the BUG_TRAP in __xfrm_state_destroy. The patch applies to both 2.5 and the 2.4 backport. Best regards, Patrick