From owner-p4-projects@FreeBSD.ORG Sun Jun 28 20:57:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 36BF21065675; Sun, 28 Jun 2009 20:57:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAE8B1065673 for ; Sun, 28 Jun 2009 20:57:40 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BFA9D8FC08 for ; Sun, 28 Jun 2009 20:57:40 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5SKve55092150 for ; Sun, 28 Jun 2009 20:57:40 GMT (envelope-from marinosi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5SKveCB092148 for perforce@freebsd.org; Sun, 28 Jun 2009 20:57:40 GMT (envelope-from marinosi@FreeBSD.org) Date: Sun, 28 Jun 2009 20:57:40 GMT Message-Id: <200906282057.n5SKveCB092148@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marinosi@FreeBSD.org using -f From: Ilias Marinos To: Perforce Change Reviews Cc: Subject: PERFORCE change 165358 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2009 20:57:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=165358 Change 165358 by marinosi@marinosi_redrum on 2009/06/28 20:56:55 Start mapping of bsm record's elements(e.g header, token), to be used for record validating. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit_internal.h#2 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#7 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#3 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.h#5 edit Differences ... ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit_internal.h#2 (text) ==== @@ -115,4 +115,38 @@ #define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) +/* + * BSM record - token mapping. + * Based on Sun description. + * XXX: Test them both on i386/amd64 architectures. + */ +/* + * token ID 1 byte + * record byte count 4 bytes + * version # 1 byte [2] + * event type 2 bytes + * event modifier 2 bytes + * seconds of time 4 bytes/8 bytes (32-bit/64-bit value) + * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) + */ +struct bsm_record_header { + u_char token_id; + u_int32_t rec_byte_count; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + struct timespec tm; +}; + +/* + * token ID 1 byte + * trailer magic number 2 bytes + * record byte count 4 bytes + */ +struct bsm_record_trailer { + u_char token_id; + u_int16_t trailer_num; + u_int32_t rec_byte_count; +}; + #endif /* !_AUDIT_INTERNAL_H_ */ ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#7 (text) ==== ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#3 (text+ko) ==== @@ -157,6 +157,9 @@ /* Actual work here */ int c, error = 0; void *audit_slice_dev_buf; + struct audit_slice *as; + + as = dev->si_drv1; /* Safe malloc the pagesz of the system.*/ audit_slice_dev_buf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK); ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.h#5 (text+ko) ====