NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59086: vioif(4): kmem_free pointer/content size confusion



>Number:         59086
>Category:       kern
>Synopsis:       vioif(4): kmem_free pointer/content size confusion
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 19 00:25:01 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10
>Organization:
The Virtual FreeKMEM Foundation
>Environment:
>Description:
   1534 		kmem_free(txc, sizeof(txc));

https://nxr.netbsd.org/xref/src/sys/dev/pci/if_vioif.c?r=1.113#1534

   1577 		kmem_free(txc, sizeof(*txc));

https://nxr.netbsd.org/xref/src/sys/dev/pci/if_vioif.c?r=1.113#1577

The first one (in an error branch of vioif_netqueue_init) is wrong; the second one (in vioif_netqueue_teardown) is right.
>How-To-Repeat:
Configure a VM with a _broken_ virtio-net interface that causes vioif_netqueue_init to fail and enter its error branch.
>Fix:
https://mail-index.netbsd.org/source-changes/2025/02/14/msg155513.html

(but this code made it into netbsd-10 and so needs pullup)



Home | Main Index | Thread Index | Old Index