Message ID | 20240104174502.490192-2-magali.lemes@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2023-6932 | expand |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 474711222999..002d6f9ad043 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -216,8 +216,10 @@ static void igmp_start_timer(struct ip_mc_list *im, int max_delay) int tv = get_random_u32_below(max_delay); im->tm_running = 1; - if (!mod_timer(&im->timer, jiffies+tv+2)) - refcount_inc(&im->refcnt); + if (refcount_inc_not_zero(&im->refcnt)) { + if (mod_timer(&im->timer, jiffies + tv + 2)) + ip_ma_put(im); + } } static void igmp_gq_start_timer(struct in_device *in_dev)