]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: don't call xfrm_policy_cache_flush while holding spinlock
authorFlorian Westphal <fw@strlen.de>
Sat, 6 Jan 2018 00:13:08 +0000 (01:13 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 8 Jan 2018 09:16:40 +0000 (10:16 +0100)
commitddb401ac63e0888c3027686228bd5c2f0a35dbad
treec860622d60b86a1ee0a7344a34e296a33061b94a
parent2606b1df5306bf570bce597785c7e8d4beb4c085
xfrm: don't call xfrm_policy_cache_flush while holding spinlock

xfrm_policy_cache_flush can sleep, so it cannot be called while holding
a spinlock.  We could release the lock first, but I don't see why we need
to invoke this function here in first place, the packet path won't reuse
an xdst entry unless its still valid.

While at it, add an annotation to xfrm_policy_cache_flush, it would
have probably caught this bug sooner.

Fixes: 1a2f4828784d78 ("xfrm: add xdst pcpu cache")
Reported-by: syzbot+e149f7d1328c26f9c12f@syzkaller.appspotmail.com
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c