ip_mroute: handle V_mfchashtbl allocation failure
authorKristof Provost <kp@FreeBSD.org>
Wed, 22 Nov 2023 13:44:03 +0000 (14:44 +0100)
committerKristof Provost <kp@FreeBSD.org>
Wed, 22 Nov 2023 13:47:14 +0000 (14:47 +0100)
commitb01cad6d3a8523101e7915809144f47e3045067f
tree8e3342500e3b887d0a28799610b5cc7b5dfc7cf3
parent8ec79e8ae07d34a371eeb09329ad32993aecd906
ip_mroute: handle V_mfchashtbl allocation failure

We allocate V_mfchashtbl with HASH_NOWAIT (which maps to M_NOWAIT), so
this allocation may fail. As we didn't handle that failure we could end
up dereferencing a NULL pointer later (e.g. during X_ip_mrouter_done()).

Do the obvious thing and fail out if we cannot allocate the table.

See also: https://redmine.pfsense.org/issues/14917
Sponsored by: Rubicon Communications, LLC ("Netgate")
sys/netinet/ip_mroute.c