Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bef17466 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

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.

Fixes: ca30707d ("drop_monitor: Add packet alert mode")
Fixes: 5e58109b ("drop_monitor: Add support for packet alert mode for hardware drops")
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58a406de
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;