is used to register callback functions on security events. The purpose of this functionality is to allow userspace object managers to take additional action when a policy change, usually a policy reload, causes permissions to be granted or revoked.
.Ievents
is the
.RIbitwise-or
of security events on which to register the callback; see
.BSECURITYEVENTS
below.
.IRssid,
.IRtsid,
.IRtclass,
and
.Iperms
specify the source and target SID's, target class, and specific permissions that the callback wishes to monitor. The special symbol
.BSECSID_WILD
may be passed as the
.Isource
or
.Itarget
and will cause any SID to match.
.Icallback
is the callback function provided by the userspace object manager. The
A return value of \-1 from a callback is interpreted as a failed policy operation. If such a return value is encountered, all remaining callbacks registered on the event are called. In threaded mode, the netlink handler thread may then terminate and cause the userspace AVC to return
.BEINVAL
on all further permission checks until
.BRavc_destroy(3)
is called. In non-threaded mode, the permission check on which the error occurred will return \-1 and the value of
.Ierrno
encountered to the caller. In both cases, a log message is produced and the kernel may be notified of the error.
may be executed in the context of the netlink handler thread. This will likely introduce synchronization issues requiring the use of locks. See
.BRavc_init(3).
Support for dynamic revocation and retained permissions is mostly unimplemented in the SELinux kernel module. The only security event that currently gets excercised is