When dealing with mbuf pointers passed down as function parameters,
authorbluhm <bluhm@openbsd.org>
Mon, 19 Jun 2017 17:58:49 +0000 (17:58 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 19 Jun 2017 17:58:49 +0000 (17:58 +0000)
commit36c0109eae52b8c24faab57b6f949fb2dd622cb5
treecc0859199dae91d7020bdd7213495b91146b5a01
parent9d9f10a05de35a88056efd8fe359805a31eb76ef
When dealing with mbuf pointers passed down as function parameters,
bugs could easily result in use-after-free or double free.  Introduce
m_freemp() which automatically resets the pointer before freeing
it.  So we have less dangling pointers in the kernel.
OK krw@ mpi@ claudio@
15 files changed:
share/man/man9/mbuf.9
sys/net/bsd-comp.c
sys/net/if_gif.c
sys/net/pf_norm.c
sys/net/ppp-deflate.c
sys/netinet/igmp.c
sys/netinet/ip_carp.c
sys/netinet/ip_ether.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/ip_ipip.c
sys/netinet/ipsec_input.c
sys/netinet6/ip6_input.c
sys/nfs/nfs_socket.c
sys/sys/mbuf.h