]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ktrace: fix a race between writes and close
authorKonstantin Belousov <kib@FreeBSD.org>
Sat, 22 May 2021 12:40:00 +0000 (15:40 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 22 May 2021 20:14:13 +0000 (23:14 +0300)
commitfc369a353b5b5e0f8046687fcbd78a7cd9ad1810
tree1d6c0c4dc8a448c36a2a8256422556565f7f5efb
parent48235c377f960050e9129aa847d7d73019561c82
ktrace: fix a race between writes and close

It was possible that termination of ktrace session occured during some
record write, in which case write occured after the close of the vnode.
Use ktr_io_params refcounting to avoid this situation, by taking the
reference on the structure instead of vnode.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D30400
sys/kern/kern_ktrace.c