• Timo Teras's avatar
    xfrm: fix policy unreferencing on larval drop · a1aa3483
    Timo Teras authored
    I mistakenly had the error path to use num_pols to decide how
    many policies we need to drop (cruft from earlier patch set
    version which did not handle socket policies right).
    
    This is wrong since normally we do not keep explicit references
    (instead we hold reference to the cache entry which holds references
    to policies). drop_pols is set to num_pols if we are holding the
    references, so use that. Otherwise we eventually BUG_ON inside
    xfrm_policy_destroy due to premature policy deletion.
    Signed-off-by: default avatarTimo Teras <timo.teras@iki.fi>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a1aa3483
xfrm_policy.c 69.5 KB