Bug 172283 - [openbsm] OpenBSM-21/openbsm/libbsm/bsm_token.c incorrectly implies an au_to_header64_ex_tm
Summary: [openbsm] OpenBSM-21/openbsm/libbsm/bsm_token.c incorrectly implies an au_to_...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 1.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-02 19:00 UTC by Daniel U. Thibault
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel U. Thibault 2012-10-02 19:00:25 UTC
The au_to_header32_ex_tm function of bsm_token.c (a component of the current libbsm implementation) reads in part:

/*
[...]
 * seconds of time         4 bytes/8 bytes (32-bit/64-bit value)
 * milliseconds of time    4 bytes/8 bytes (32-bit/64-bit value)
 */
token_t *
au_to_header32_ex_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
    struct timeval tm, struct auditinfo_addr *aia)


   Everywhere else within this file, a mention of "4 bytes/8 bytes (32-bit/64-bit value)" means the function described exists also as a 64-bit version.  Hence one expects au_to_header64_ex_tm to follow shortly after au_to_header32_ex_tm ---but there is no such function.

Fix: 

Either change the au_to_header32_ex_tm preamble to conclude with:

 * seconds of time         4 bytes
 * milliseconds of time    4 bytes
 */

or add an au_to_header64_ex_tm function to libbsm (easily done by making a slightly-modified copy of au_to_header32_ex_tm; also declare this in openbsm/sys/bsm/audit_record.h).
How-To-Repeat: Look up http://www.opensource.apple.com/source/OpenBSM/OpenBSM-21/openbsm/libbsm/bsm_token.c and search for au_to_header32_ex_tm
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:23 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped