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
Sponsored by: Yandex LLC

(cherry picked from commit c6ded47d0bae801589b564dbe01dccd474edaed0)

Details

Provenance
aeAuthored on Feb 11 2021, 8:55 AM
Parents
rG76702e90d007: vt: terminal size can grow too big with small font
Branches
Unknown
Tags
Unknown