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

Christian S.J. Peron csjp at FreeBSD.org
Fri Apr 13 14:55:20 UTC 2007


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


More information about the cvs-src mailing list