]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wireguard: queueing: use CFI-safe ptr_ring cleanup function
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 30 Mar 2022 01:31:24 +0000 (21:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:48 +0000 (14:06 +0200)
commit76abd1562e7c43cd6cf0a2bc23edf732329a145a
tree73134d973eda105adb0dc4da1000134b51c78b32
parent5a2f97d29740e4953771a32558b1d4c13b3effa0
wireguard: queueing: use CFI-safe ptr_ring cleanup function

commit ec59f128a9bd4255798abb1e06ac3b442f46ef68 upstream.

We make too nuanced use of ptr_ring to entirely move to the skb_array
wrappers, but we at least should avoid the naughty function pointer cast
when cleaning up skbs. Otherwise RAP/CFI will honk at us. This patch
uses the __skb_array_destroy_skb wrapper for the cleanup, rather than
directly providing kfree_skb, which is what other drivers in the same
situation do too.

Reported-by: PaX Team <pageexec@freemail.hu>
Fixes: 886fcee939ad ("wireguard: receive: use ring buffer for incoming handshakes")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireguard/queueing.c