freebsd-skq/contrib/openbsm
Conrad Meyer 8dd74db753 auditd(8): fix long-standing uninitialized memory use bug
The bogus use could lead to an infinite loop depending on how fast the
audit_warn script to execute.

By fixing read(2) interruptibility, d060887 (r335899) revealed another bug
in auditd_wait_for_events.  When read is interrupted by SIGCHLD,
auditd_reap_children will always return with errno set to ECHILD.  But
auditd_wait_for_events checks errno after that point, expecting it to be
unchanged since read.  As a result, it calls auditd_handle_trigger with bogus
stack garbage.  The result is the error message "Got unknown trigger 48."  Fix
by simply ignoring errno at that point; there's only one value it could've
possibly had, thanks to the check up above.

The best part is we've had a fix for this for like 18 months and just never
merged it.  Merge it now.

PR:		234209
Reported by:	Marie Helene Kvello-Aune <freebsd AT mhka.no> (2018-12)
Submitted by:	asomers (2018-07)
Reviewed by:	me (in OpenBSM)
Obtained from:	OpenBSM
X-MFC-With:	r335899
Security:	¯\_(ツ)_/¯
Differential Revision:	https://github.com/openbsm/openbsm/pull/45
2019-11-28 00:46:03 +00:00
..
bin auditd(8): fix long-standing uninitialized memory use bug 2019-11-28 00:46:03 +00:00
bsm Fix OpenBSM with GCC with -Wredundant-decls 2018-05-30 15:51:48 +00:00
compat
config Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
etc Jail and capability mode for shm_rename; add audit support for shm_rename 2019-11-18 13:31:16 +00:00
libauditd In r316006 the getstrfromtype_locked() function was modified to return 2019-01-09 01:16:35 +00:00
libbsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
m4 Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
man Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
modules Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
sys Jail and capability mode for shm_rename; add audit support for shm_rename 2019-11-18 13:31:16 +00:00
test Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
tools Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
.travis.yml Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
aclocal.m4 Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
autogen.sh
configure Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
configure.ac Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
CREDITS Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
FREEBSD-upgrade
INSTALL Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
LICENSE Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
Makefile.am
Makefile.in Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
NEWS Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
README Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00
TODO
VERSION Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: 2017-03-26 21:14:49 +00:00

OpenBSM

  Introduction

OpenBSM is an open-source implementation of Sun's BSM event auditing file
format and API.  Originally created for Apple Computer by McAfee Research,
OpenBSM is now maintained by volunteers and through the generous contributions
of several organizations.

OpenBSM includes several command line tools, including auditreduce(8) and
praudit(8) for reducing and printing audit trails, as well as the libbsm(3)
library to manage configuration files, generate audit records, and parse and
print audit trails.  It also includes the auditd(8) audit configuration
daemon, and the auditdistd(8) audit-trail distribution daemon.

Coupled with a kernel audit implementation, OpenBSM can be used to maintain
system audit streams, and is a foundation for a full audit-enabled system.
Portions of OpenBSM, including include files and token-building routines, are
reusable in a kernel audit implementation, and may be found in the FreeBSD
and Mac OS X kernels.

  Contents

OpenBSM consists of several directories:

    bin/           Audit-related command line tools and daemons
    bsm/           Library header files for BSM
    compat/        Compatibility code to build on various operating systems
    etc/           Sample /etc/security configuration files
    libauditd/     Common audit management functions for auditd and launchd
    libbsm/        Implementation of BSM library interfaces and man pages
    man/           System call and configuration file man pages
    modules/       Directory for auditfilterd module source
    sys/           System header files for BSM
    test/          Test token sets and geneneration program
    tools/         Tool directory, including audump to dump databases

The following programs are included with OpenBSM:

    audit          Command line audit control tool
    auditd         Audit management daemon
    auditdistd     Audit trail distribution daemon
    auditfilterd   Experimental event monitoring framework
    auditreduce    Audit trail reduction tool
    audump         Debugging tool to parse and print audit databases
    praudit        Tool to print audit trails

  Build and Installation

Please see the file INSTALL for build and installation instructions.

  Contributions

The TrustedBSD Project would appreciate the contribution of bug fixes, 
enhancements, etc, under the same license found in the top-level LICENSE file.
Please see the file CREDITS to learn more about who has contributed to the
project.

  Location

Information on OpenBSM may be found on the OpenBSM home page:

    http://www.OpenBSM.org/

Information on TrustedBSD may be found on the TrustedBSD home page:

    http://www.TrustedBSD.org/