mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
sound: Drain buffer selinfo in sndbuf_free()
Prevent a use-after-free in kern_poll() by making sure the buffer's
selinfo is drained. This is required for a subsequent patch that
implements asynchronous audio device detach.
Reported by: KASAN
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44544
(cherry picked from commit fba54d0179)
This commit is contained in:
parent
b556c37f83
commit
ea2275e72c
1 changed files with 1 additions and 0 deletions
|
|
@ -147,6 +147,7 @@ sndbuf_free(struct snd_dbuf *b)
|
|||
} else
|
||||
free(b->buf, M_DEVBUF);
|
||||
}
|
||||
seldrain(sndbuf_getsel(b));
|
||||
|
||||
b->tmpbuf = NULL;
|
||||
b->shadbuf = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue