HomeFreeBSD

tty: delete knotes when TTY is revoked

Description

tty: delete knotes when TTY is revoked

Do not clear knotes from the TTY until it gets dealloc'ed, unless the
TTY is being revoked, in that case delete the knotes when closed is
called on the TTY.

When knotes are cleared from a knlist, those knotes become detached from
the knlist. And when an event is triggered on a detached knote there
isn't an associated knlist and therefore no lock will be taken when the
event is triggered.

This becomes a problem when a detached knote is triggered on a TTY since
the mutex for a TTY is also used as the lock for its knlists. This
scenario ends up calling the TTY event handlers without the TTY lock
being held and tripping on asserts in the event handlers.

PR: 272151
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D41605

Details

Provenance
rewAuthored on Dec 19 2023, 12:40 AM
Reviewer
kib
Differential Revision
D41605: tty: delete knotes when TTY is revoked
Parents
rGd9b7301bb791: nvme: Initialize HMB entries before loading them into the controller
Branches
Unknown
Tags
Unknown