From af03cd8f4f6e6702251f0dd85f3d36bc245ca31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 13 Oct 2020 04:42:52 +0200 Subject: [PATCH] gnrc_netif: add missing gnrc_netif_release() to early return The gnrc_netif_ipv6_addr_add_internal() function unconditionally acquires the global netif rmutex lock but doesn't release this lock on this specific path (i.e. if gnrc_netif_ipv6_group_join_internal failed). This can cause a deadlock as no other thread will afterwards be capable of acquiring the netif lock. --- sys/net/gnrc/netif/gnrc_netif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index b1a8c09a10..85ebe02fb1 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -561,6 +561,7 @@ int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif, PRIkernel_pid "\n", ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)), netif->pid); + gnrc_netif_release(netif); return res; } #else /* CONFIG_GNRC_IPV6_NIB_ARSM */