aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-09-16 21:39:27 +0200
committerDavid S. Miller <davem@davemloft.net>2019-09-16 21:39:27 +0200
commitf432c2e30461cfdfde5ee74ad62d9684016f3623 (patch)
treedb3d398fe5737b425daebfbf7cccb46117cc3bec /net/core
parentMerge branch 'tc-taprio-offload-for-SJA1105-DSA' (diff)
parentdrop_monitor: Better sanitize notified packets (diff)
downloadwireguard-linux-f432c2e30461cfdfde5ee74ad62d9684016f3623.tar.xz
wireguard-linux-f432c2e30461cfdfde5ee74ad62d9684016f3623.zip
Merge branch 'drop_monitor-Better-sanitize-notified-packets'
Ido Schimmel says: ==================== drop_monitor: Better sanitize notified packets When working in 'packet' mode, drop monitor generates a notification with a potentially truncated payload of the dropped packet. The payload is copied from the MAC header, but I forgot to check that the MAC header was set, so do it now. Patch #1 sets the offsets to the various protocol layers in netdevsim, so that it will continue to work after the MAC header check is added to drop monitor in patch #2. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/drop_monitor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index cc60cc22e2db..536e032d95c8 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -487,6 +487,9 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,
struct sk_buff *nskb;
unsigned long flags;
+ if (!skb_mac_header_was_set(skb))
+ return;
+
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return;
@@ -900,6 +903,9 @@ net_dm_hw_packet_probe(struct sk_buff *skb,
struct sk_buff *nskb;
unsigned long flags;
+ if (!skb_mac_header_was_set(skb))
+ return;
+
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return;