Date: Mon, 26 Nov 2018 12:47:13 +0000 (UTC) From: Eugene Grosbein <eugen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340961 - stable/10/sys/netinet Message-ID: <201811261247.wAQClD7h067826@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eugen Date: Mon Nov 26 12:47:12 2018 New Revision: 340961 URL: https://svnweb.freebsd.org/changeset/base/340961 Log: Prevent ip_input() from panicing due to unprotected access to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339808 due to significant differences in code base. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/10/sys/netinet/ip_input.c Modified: stable/10/sys/netinet/ip_input.c ============================================================================== --- stable/10/sys/netinet/ip_input.c Mon Nov 26 12:41:49 2018 (r340960) +++ stable/10/sys/netinet/ip_input.c Mon Nov 26 12:47:12 2018 (r340961) @@ -564,7 +564,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - /* IN_IFADDR_RLOCK(); */ + IN_IFADDR_RLOCK(); LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet @@ -574,11 +574,11 @@ passin: if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr && (!checkif || ia->ia_ifp == ifp)) { ifa_ref(&ia->ia_ifa); - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(); goto ours; } } - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(); /* * Check for broadcast addresses.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811261247.wAQClD7h067826>