]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Move the funsetown(9) call from audit_pipe_close() to cdevpriv
authorkib <kib@FreeBSD.org>
Wed, 13 Jan 2016 14:02:07 +0000 (14:02 +0000)
committerkib <kib@FreeBSD.org>
Wed, 13 Jan 2016 14:02:07 +0000 (14:02 +0000)
commite884cfc968387de3c1ff83079d0ce44782846404
treef43449bc298355cacbdb5481e953b4bb355d4a86
parent0f1ad490766ad165a63459482430d90902e54839
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
sys/security/audit/audit_pipe.c