aboutsummaryrefslogtreecommitdiff
path: root/lib/libpcap/pcap-netmap.c
diff options
context:
space:
mode:
authorR. Christian McDonald <rcm@FreeBSD.org>2026-11-29 01:03:09 +0000
committerR. Christian McDonald <rcm@FreeBSD.org>2026-11-29 01:03:09 +0000
commita6020486cc0ce00336c65571effe4c6d6b280817 (patch)
tree8271a7567249e78efd6ce874978d31ad6fff26ff /lib/libpcap/pcap-netmap.c
parent7dac8828428d8e6f1c3cc445b0619529ebb0108b (diff)
netmap: Clear ni_bufs_head in a new netmap_ifHEADmain
netmap_mem2_if_new() does not set ni_bufs_head, and the netmap_if comes from a pool that is not zeroed, so it starts with the head of the last extra buffer list of whoever had that netmap_if before. Only a registration from userspace sets the field afterwards. One made by the kernel, such as attaching a NIC to a VALE switch, keeps the old value, and so does a registration that fails after the netmap_if was created. netmap_mem2_if_delete() then frees that list again. When the buffer is free this logs "ouch, double free on buffer"; when another ring has got it in the meantime, it is freed under that ring and can be given out a second time. Clear the field when the netmap_if is created. Reviewed by: vmaffione MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D62152
Diffstat (limited to 'lib/libpcap/pcap-netmap.c')
0 files changed, 0 insertions, 0 deletions