batman-adv: fix memory leak in in batadv_dat_put_dhcp

Message ID mailman.2.1549464410.7610.b.a.t.m.a.n@lists.open-mesh.org (mailing list archive)
State Accepted, archived
Commit cbb10f9948dfd56d7e3dc2d43182627b4239c951
Delegated to: Simon Wunderlich
Headers
Series batman-adv: fix memory leak in in batadv_dat_put_dhcp |

Commit Message

Gui Iribarren via B.A.T.M.A.N Feb. 6, 2019, 2:39 p.m. UTC
  The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Consume the skb to avoid leaking memory.

Fixes: 1fd1ce2d383f ("batman-adv: Snoop DHCPACKs for DAT")
Signed-off-by: Martin Weinelt <martin@linuxlounge.net>
---
 net/batman-adv/distributed-arp-table.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Sven Eckelmann Feb. 6, 2019, 6:38 p.m. UTC | #1
On Wednesday, 6 February 2019 15.39.14 CET Martin Weinelt via B.A.T.M.A.N wrote:
> Consume the skb to avoid leaking memory.
> 
> Fixes: 1fd1ce2d383f ("batman-adv: Snoop DHCPACKs for DAT")
> Signed-off-by: Martin Weinelt <martin@linuxlounge.net>

Good catch. I've modified the commit message to make it better 
understandable and to describe the actual problem in more detail.

Kind regards,
	Sven
  

Patch

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 899ab051..310a4f35 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1711,6 +1711,8 @@  static void batadv_dat_put_dhcp(struct batadv_priv *bat_priv, u8 *chaddr,
 	batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT);
 	batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
 
+	consume_skb(skb);
+
 	batadv_dbg(BATADV_DBG_DAT, bat_priv,
 		   "Snooped from outgoing DHCPACK (server address): %pI4, %pM (vid: %i)\n",
 		   &ip_dst, hw_dst, batadv_print_vid(vid));