VYPR
Unrated severityNVD Advisory· Published Sep 30, 2019· Updated Aug 5, 2024

CVE-2019-16995

CVE-2019-16995

Description

In the Linux kernel before 5.0.3, a memory leak exits in hsr_dev_finalize() in net/hsr/hsr_device.c if hsr_add_port fails to add a port, which may cause denial of service, aka CID-6caabe7f197d.

Affected products

126

Patches

2
6caabe7f197d

net: hsr: fix memory leak in hsr_dev_finalize()

https://github.com/torvalds/linuxMao WenanMar 6, 2019via osv
3 files changed · +16 1
  • net/hsr/hsr_device.c+3 1 modified
    @@ -486,7 +486,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
     
     	res = hsr_add_port(hsr, hsr_dev, HSR_PT_MASTER);
     	if (res)
    -		return res;
    +		goto err_add_port;
     
     	res = register_netdevice(hsr_dev);
     	if (res)
    @@ -506,6 +506,8 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
     fail:
     	hsr_for_each_port(hsr, port)
     		hsr_del_port(port);
    +err_add_port:
    +	hsr_del_node(&hsr->self_node_db);
     
     	return res;
     }
    
  • net/hsr/hsr_framereg.c+12 0 modified
    @@ -124,6 +124,18 @@ int hsr_create_self_node(struct list_head *self_node_db,
     	return 0;
     }
     
    +void hsr_del_node(struct list_head *self_node_db)
    +{
    +	struct hsr_node *node;
    +
    +	rcu_read_lock();
    +	node = list_first_or_null_rcu(self_node_db, struct hsr_node, mac_list);
    +	rcu_read_unlock();
    +	if (node) {
    +		list_del_rcu(&node->mac_list);
    +		kfree(node);
    +	}
    +}
     
     /* Allocate an hsr_node and add it to node_db. 'addr' is the node's AddressA;
      * seq_out is used to initialize filtering of outgoing duplicate frames
    
  • net/hsr/hsr_framereg.h+1 0 modified
    @@ -16,6 +16,7 @@
     
     struct hsr_node;
     
    +void hsr_del_node(struct list_head *self_node_db);
     struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[],
     			      u16 seq_out);
     struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb,
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.