git: 49548ea75c91 - main - udp: in_pcblookup() never returns a freed inpcb

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Thu, 22 Oct 2026 03:31:28 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=49548ea75c91893f9a30b35abb122b2fff9274f0

commit 49548ea75c91893f9a30b35abb122b2fff9274f0
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-10-21 21:32:15 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-10-22 03:29:41 +0000

    udp: in_pcblookup() never returns a freed inpcb
---
 sys/netinet/udp_usrreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 8190497193c1..79d292983c24 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -746,8 +746,7 @@ udp_common_ctlinput(struct icmp *icmp, struct inpcbinfo *pcbinfo)
 	    uh->uh_sport, INPLOOKUP_WLOCKPCB, NULL);
 	if (inp != NULL) {
 		INP_WLOCK_ASSERT(inp);
-		if (inp->inp_socket != NULL)
-			udp_notify(inp, icmp_errmap(icmp));
+		udp_notify(inp, icmp_errmap(icmp));
 		INP_WUNLOCK(inp);
 	} else {
 		inp = in_pcblookup(pcbinfo, ip->ip_dst, uh->uh_dport,