From nobody@FreeBSD.org  Tue Oct  2 17:57:05 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 19020106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Oct 2012 17:57:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E86EB8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  2 Oct 2012 17:57:04 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q92Hv4o7070844
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 2 Oct 2012 17:57:04 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q92Hv4E3070843;
	Tue, 2 Oct 2012 17:57:04 GMT
	(envelope-from nobody)
Message-Id: <201210021757.q92Hv4E3070843@red.freebsd.org>
Date: Tue, 2 Oct 2012 17:57:04 GMT
From: "Daniel U. Thibault" <daniel.thibault@drdc-rddc.gc.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: OpenBSM-21/openbsm/libbsm/bsm_token.c incorrectly implies an au_to_header64_ex_tm
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172283
>Category:       kern
>Synopsis:       [openbsm] OpenBSM-21/openbsm/libbsm/bsm_token.c incorrectly implies an au_to_header64_ex_tm
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 02 18:00:25 UTC 2012
>Closed-Date:    
>Last-Modified:  Fri Oct 05 03:12:29 UTC 2012
>Originator:     Daniel U. Thibault
>Release:        
>Organization:
DRDC Valcartier
>Environment:
>Description:
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.
>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
>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).

>Release-Note:
>Audit-Trail:
>Unformatted:
