• Florian Westphal's avatar
    xfrm: check that cached bundle is still valid · 13ead5c4
    Florian Westphal authored
    Quoting Ilan Tayari:
      1. Set up a host-to-host IPSec tunnel (or transport, doesn't matter)
      2. Ping over IPSec, or do something to populate the pcpu cache
      3. Join a MC group, then leave MC group
      4. Try to ping again using same CPU as before -> traffic
         doesn't egress the machine at all
    
    Ilan debugged the problem down to the fact that one of the path dsts
    devices point to lo due to earlier dst_dev_put().
    In this case, dst is marked as DEAD and we cannot reuse the bundle.
    
    The cache only asserted that the requested policy and that of the cached
    bundle match, but its not enough - also verify the path is still valid.
    
    Fixes: ec30d78c ("xfrm: add xdst pcpu cache")
    Reported-by: default avatarAyham Masood <ayhamm@mellanox.com>
    Tested-by: default avatarIlan Tayari <ilant@mellanox.com>
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    13ead5c4
xfrm_policy.c 76.8 KB