diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-03-02 23:48:40 +0100 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2023-11-06 09:28:24 +0000 |
commit | c49779c5de4d3c40d2cb410c4c1640cd5167cd85 (patch) | |
tree | 5150660fb549642978de41ab1f06267b4f017dd3 /drivers/net/wireguard/queueing.c | |
parent | 894629feeee2de09e6562a91b71decd99d6223de (diff) |
queueing: use CFI-safe ptr_ring cleanup function
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>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: Ib9ee487345484769aab6b173738c77dcac0f6f57
Diffstat (limited to 'drivers/net/wireguard/queueing.c')
-rw-r--r-- | drivers/net/wireguard/queueing.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireguard/queueing.c b/drivers/net/wireguard/queueing.c index 1de413b19e34..8084e7408c0a 100644 --- a/drivers/net/wireguard/queueing.c +++ b/drivers/net/wireguard/queueing.c @@ -4,6 +4,7 @@ */ #include "queueing.h" +#include <linux/skb_array.h> struct multicore_worker __percpu * wg_packet_percpu_multicore_worker_alloc(work_func_t function, void *ptr) @@ -42,7 +43,7 @@ void wg_packet_queue_free(struct crypt_queue *queue, bool purge) { free_percpu(queue->worker); WARN_ON(!purge && !__ptr_ring_empty(&queue->ring)); - ptr_ring_cleanup(&queue->ring, purge ? (void(*)(void*))kfree_skb : NULL); + ptr_ring_cleanup(&queue->ring, purge ? __skb_array_destroy_skb : NULL); } #define NEXT(skb) ((skb)->prev) |