HomeFreeBSD

[udp] fix possible mbuf and lock leak in udp_input().

Description

[udp] fix possible mbuf and lock leak in udp_input().

In error case we can leave `inp' locked, also we need to free
mbuf chain m' in the same case. Release the lock and use badunlocked'
label to exit with freed mbuf. Also modify UDP error statistic to
match the IPv6 code.

Remove redundant INP_RUNLOCK() from the `if (last == NULL)' block,
there are no ways to reach this point with locked `inp'.

Obtained from: Yandex LLC
MFC after: 3 days
Sponsored by: Yandex LLC

Details

Provenance
aeAuthored on Feb 11 2021, 8:55 AM
Parents
rG3c782d9c9166: [udp6] fix possible panic due to lack of locking.
Branches
Unknown
Tags
Unknown