NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/60127: some drivers leak memory on detatch
>Number: 60127
>Category: kern
>Synopsis: some drivers leak memory on detatch
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 25 12:40:00 +0000 2026
>Originator: YAMAMOTO Takashi
>Release: -current
>Organization:
>Environment:
>Description:
some drivers attaches a device on open and detach it on close.
eg. vnd, fss, cgd, pad, ... (i only confirmed vnd)
typically they do:
open:
cfdata_t cf = kmem_zalloc(sizeof(*cf), KM_SLEEP);
:
:
config_attach_pseudo(cf);
close:
config_detach(...);
kmem_free(cf, sizeof(*cf));
if they are detached by the other means, (eg. drvctl -d)
cfdata_t leaks.
>How-To-Repeat:
eg.
```
#! /bin/sh
t=$(mktemp)
dd if=/dev/zero of=$t bs=1m count=1
while :; do
vnconfig vnd0 $t
drvctl -d vnd0
done
```
>Fix:
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index