From owner-cvs-all@FreeBSD.ORG Fri Apr 13 14:55:20 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C81716A405; Fri, 13 Apr 2007 14:55:20 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id EDF6B13C4C9; Fri, 13 Apr 2007 14:55:19 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3DEtJxK059951; Fri, 13 Apr 2007 14:55:19 GMT (envelope-from csjp@repoman.freebsd.org) Received: (from csjp@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3DEtJEW059950; Fri, 13 Apr 2007 14:55:19 GMT (envelope-from csjp) Message-Id: <200704131455.l3DEtJEW059950@repoman.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 13 Apr 2007 14:55:19 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/security/audit audit.c audit.h audit_arg.c audit_bsm.c audit_bsm_token.c audit_private.h audit_syscalls.c src/sys/sys proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2007 14:55:20 -0000 csjp 2007-04-13 14:55:19 UTC FreeBSD src repository Modified files: sys/security/audit audit.c audit.h audit_arg.c audit_bsm.c audit_bsm_token.c audit_private.h audit_syscalls.c sys/sys proc.h Log: Fix the handling of IPv6 addresses for subject and process BSM audit tokens. Currently, we do not support the set{get}audit_addr(2) system calls which allows processes like sshd to set extended or ip6 information for subject tokens. The approach that was taken was to change the process audit state slightly to use an extended terminal ID in the kernel. This allows us to store both IPv4 IPv6 addresses. In the case that an IPv4 address is in use, we convert the terminal ID from an struct auditinfo_addr to a struct auditinfo. If getaudit(2) is called when the subject is bound to an ip6 address, we return E2BIG. - Change the internal audit record to store an extended terminal ID - Introduce ARG_TERMID_ADDR - Change the kaudit <-> BSM conversion process so that we are using the appropriate subject token. If the address associated with the subject is IPv4, we use the standard subject32 token. If the subject has an IPv6 address associated with them, we use an extended subject32 token. - Fix a couple of endian issues where we do a couple of byte swaps when we shouldn't be. IP addresses are already in the correct byte order, so reading the ip6 address 4 bytes at a time and swapping them results in in-correct address data. It should be noted that the same issue was found in the openbsm library and it has been changed there too on the vendor branch - Change A_GETPINFO to use the appropriate structures - Implement A_GETPINFO_ADDR which basically does what A_GETPINFO does, but can also handle ip6 addresses - Adjust get{set}audit(2) syscalls to convert the data auditinfo <-> auditinfo_addr - Fully implement set{get}audit_addr(2) NOTE: This adds the ability for processes to correctly set extended subject information. The appropriate userspace utilities still need to be updated. MFC after: 1 month Reviewed by: rwatson Obtained from: TrustedBSD Revision Changes Path 1.25 +1 -1 src/sys/security/audit/audit.c 1.10 +1 -1 src/sys/security/audit/audit.h 1.11 +2 -2 src/sys/security/audit/audit_arg.c 1.16 +34 -10 src/sys/security/audit/audit_bsm.c 1.10 +12 -12 src/sys/security/audit/audit_bsm_token.c 1.13 +2 -0 src/sys/security/audit/audit_private.h 1.13 +52 -7 src/sys/security/audit/audit_syscalls.c 1.475 +1 -1 src/sys/sys/proc.h