blob: fb03b1b1a6aab5fdef60e5e097f54ca28d6c1a33 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3Date: Thu, 2 Jan 2020 17:47:50 +0100
4Subject: [PATCH] wireguard: queueing: do not account for pfmemalloc when
5 clearing skb header
6
7commit 04d2ea92a18417619182cbb79063f154892b0150 upstream.
8
9Before 8b7008620b84 ("net: Don't copy pfmemalloc flag in __copy_skb_
10header()"), the pfmemalloc flag used to be between headers_start and
11headers_end, which is a region we clear when preparing the packet for
12encryption/decryption. This is a parameter we certainly want to
13preserve, which is why 8b7008620b84 moved it out of there. The code here
14was written in a world before 8b7008620b84, though, where we had to
15manually account for it. This commit brings things up to speed.
16
17Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
20---
21 drivers/net/wireguard/queueing.h | 3 ---
22 1 file changed, 3 deletions(-)
23
24--- a/drivers/net/wireguard/queueing.h
25+++ b/drivers/net/wireguard/queueing.h
26@@ -83,13 +83,10 @@ static inline __be16 wg_skb_examine_untr
27
28 static inline void wg_reset_packet(struct sk_buff *skb)
29 {
30- const int pfmemalloc = skb->pfmemalloc;
31-
32 skb_scrub_packet(skb, true);
33 memset(&skb->headers_start, 0,
34 offsetof(struct sk_buff, headers_end) -
35 offsetof(struct sk_buff, headers_start));
36- skb->pfmemalloc = pfmemalloc;
37 skb->queue_mapping = 0;
38 skb->nohdr = 0;
39 skb->peeked = 0;