HomeFreeBSD

Move the funsetown(9) call from audit_pipe_close() to cdevpriv

Description

Move the funsetown(9) call from audit_pipe_close() to cdevpriv
destructor. As result, close method becomes trivial and removed.
Final cdevsw close method might be called without file
context (e.g. in vn_open_vnode() if the vnode is reclaimed meantime),
which leaves ap_sigio registered for notification, despite cdevpriv
destructor frees the memory later.

Call destructor instead of doing a cleanup inline, for
devfs_set_cdevpriv() failure in open. This adds missed funsetown(9)
call and locks ap to satisfy audit_pipe_free() invariants.

Reported and tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on
Parents
rS293825: Switch legacy pty clone handler to use make_dev_s(9). Add
Branches
Unknown
Tags
Unknown