audit_event.c revision 745b26904e92607793a42c0c924dbfb8f221a1ee
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This file contains the audit event table used to control the production
* of audit records for each system call.
*/
#include <sys/processor.h>
#include <c2/audit_kernel.h>
#include <c2/audit_kevents.h>
#include <c2/audit_record.h>
#include <sys/sysmacros.h>
#include <sys/socketvar.h>
#include <sys/port_impl.h>
int au_naevent;
char _depends_on[] = "fs/sockfs";
static void aus_null(struct t_audit_data *);
static void aus_open(struct t_audit_data *);
static void aus_acl(struct t_audit_data *);
static void aus_acct(struct t_audit_data *);
static void aus_chown(struct t_audit_data *);
static void aus_fchown(struct t_audit_data *);
static void aus_lchown(struct t_audit_data *);
static void aus_chmod(struct t_audit_data *);
static void aus_facl(struct t_audit_data *);
static void aus_fchmod(struct t_audit_data *);
static void aus_fcntl(struct t_audit_data *);
static void aus_fsat(struct t_audit_data *);
static void aus_mkdir(struct t_audit_data *);
static void aus_mknod(struct t_audit_data *);
static void aus_mount(struct t_audit_data *);
static void aus_umount(struct t_audit_data *);
static void aus_umount2(struct t_audit_data *);
static void aus_msgsys(struct t_audit_data *);
static void aus_semsys(struct t_audit_data *);
static void aus_close(struct t_audit_data *);
static void aus_fstatfs(struct t_audit_data *);
static void aus_setgid(struct t_audit_data *);
static void aus_setuid(struct t_audit_data *);
static void aus_shmsys(struct t_audit_data *);
static void aus_doorfs(struct t_audit_data *);
static void aus_ioctl(struct t_audit_data *);
static void aus_memcntl(struct t_audit_data *);
static void aus_mmap(struct t_audit_data *);
static void aus_munmap(struct t_audit_data *);
static void aus_priocntlsys(struct t_audit_data *);
static void aus_setegid(struct t_audit_data *);
static void aus_setgroups(struct t_audit_data *);
static void aus_seteuid(struct t_audit_data *);
static void aus_putmsg(struct t_audit_data *);
static void aus_putpmsg(struct t_audit_data *);
static void aus_getmsg(struct t_audit_data *);
static void aus_getpmsg(struct t_audit_data *);
static void aus_auditsys(struct t_audit_data *);
static void aus_sysinfo(struct t_audit_data *);
static void aus_modctl(struct t_audit_data *);
static void aus_kill(struct t_audit_data *);
static void aus_xmknod(struct t_audit_data *);
static void aus_setregid(struct t_audit_data *);
static void aus_setreuid(struct t_audit_data *);
#if 0
#endif
static void aus_sigqueue(struct t_audit_data *);
static void aus_p_online(struct t_audit_data *);
static void aus_processor_bind(struct t_audit_data *);
static void aus_inst_sync(struct t_audit_data *);
static void aus_brandsys(struct t_audit_data *);
static void aus_shutdown(struct t_audit_data *);
static void aus_sockconfig(struct t_audit_data *);
static void aus_socket(struct t_audit_data *);
/*
* This table contains mapping information for converting system call numbers
* to audit event IDs. In several cases it is necessary to map a single system
* call to several events.
*/
{
/*
* ---------- ---------- ---------- ----------
* INITIAL AUDIT START SYSTEM
* PROCESSING EVENT PROCESSING CALL
* ---------- ---------- ---------- -----------
* FINISH EVENT
* PROCESSING CONTROL
* ----------------------------------------------------------
*/
auf_null, 0,
auf_null, 0,
auf_write, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_mknod, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* was proc lock */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_msgsys, 0,
#if defined(__x86)
auf_null, 0,
#else
auf_null, 0,
#endif /* __x86 */
auf_null, 0,
auf_shmsys, 0,
auf_semsys, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* file locking call */
auf_null, 0,
/* local system calls */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* was sigret (SunOS) */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* was libattach */
auf_null, 0,
/* was libdetach */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* was evtrapret */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
#if defined(__x86)
auf_null, 0,
#else
auf_null, 0,
#endif /* __x86 */
auf_null, 0,
auf_null, 0,
auf_null, 0, /* 112 priocntlsys */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_write, 0,
auf_null, 0,
auf_xmknod, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
/* was lwp_setprivate */
auf_null, 0,
/* was lwp_getprivate */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_write, 0,
auf_null, 0,
/* aus_inst_sync */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0, /* 187 processor_bind */
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_write, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_bind, 0,
auf_null, 0,
auf_accept, 0,
auf_connect, 0,
auf_null, 0,
auf_recv, 0,
auf_recvfrom, 0,
auf_recvmsg, 0,
auf_send, 0,
auf_sendmsg, 0,
auf_sendto, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_setsockopt, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0,
auf_null, 0
};
/* null start function */
/*ARGSUSED*/
static void
{
}
/* acct start function */
/*ARGSUSED*/
static void
{
struct a {
long fname; /* char * */
if (fname == 0)
}
/* chown start function */
/*ARGSUSED*/
static void
{
struct a {
long fname; /* char * */
long uid;
long gid;
}
/* fchown start function */
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fd;
long uid;
long gid;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
}
/*ARGSUSED*/
static void
{
struct a {
long fname; /* char * */
long uid;
long gid;
}
/* chmod start function */
/*ARGSUSED*/
static void
{
struct a {
long fname; /* char * */
long fmode;
}
/* chmod start function */
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fd;
long fmode;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
}
/* null function */
/*ARGSUSED*/
static void
{
}
/* null function */
static au_event_t
{
return (e);
}
/* convert open to appropriate event */
static au_event_t
{
struct a {
long fnamep; /* char * */
long fmode;
long cmode;
e = AUE_OPEN_W;
e = AUE_OPEN_RW;
else
e = AUE_OPEN_R;
e += 1;
e += 2;
return (e);
}
/*ARGSUSED*/
static void
{
struct a {
long fnamep; /* char * */
long fmode;
long cmode;
/* If no write, create, or trunc modes, mark as a public op */
}
/* convert openat(2) to appropriate event */
static au_event_t
{
struct a {
long id;
long arg1;
long arg2;
long arg3;
long arg4;
long arg5;
switch (fmcode) {
case 0: /* openat */
case 1: /* openat64 */
e = AUE_OPENAT_W;
e = AUE_OPENAT_RW;
else
e = AUE_OPENAT_R;
/*
* openat modes are defined in the following order:
* Read only
* Read|Create
* Read|Trunc
* Read|Create|Trunc
* Write Only
* Write|Create
* Write|Trunc
* Write|Create|Trunc * RW Only
* RW|Create
* RW|Trunc
* RW|Create|Trunc
*/
e += 1; /* increment to include CREAT in mode */
e += 2; /* increment to include TRUNC in mode */
/* convert to appropriate au_ctrl */
break;
case 2: /* fstatat64 */
case 3: /* fstatat */
e = AUE_FSTATAT;
break;
case 4: /* fchownat */
e = AUE_FCHOWNAT;
break;
case 5: /* unlinkat */
e = AUE_UNLINKAT;
break;
case 6: /* futimesat */
e = AUE_FUTIMESAT;
break;
case 7: /* renameat */
e = AUE_RENAMEAT;
break;
default:
e = AUE_NULL;
break;
}
return (e);
}
/*ARGSUSED*/
static void
{
struct a {
long id;
long arg1;
long arg2;
long arg3;
long arg4;
long arg5;
switch (fmcode) {
case 0: /* openat */
case 1: /* openat64 */
/* If no write, create, or trunc modes, mark as a public op */
break;
case 2: /* fstatat64 */
case 3: /* fstatat */
break;
default:
break;
}
}
/* msgsys */
static au_event_t
{
struct a {
long id; /* function code id */
long ap; /* arg pointer for recvmsg */
struct b {
long msgid;
long cmd;
long buf; /* struct msqid_ds * */
switch (fm) {
case 0: /* msgget */
e = AUE_MSGGET;
break;
case 1: /* msgctl */
case IPC_RMID:
e = AUE_MSGCTL_RMID;
break;
case IPC_SET:
e = AUE_MSGCTL_SET;
break;
case IPC_STAT:
e = AUE_MSGCTL_STAT;
break;
default:
e = AUE_MSGCTL;
break;
}
break;
case 2: /* msgrcv */
e = AUE_MSGRCV;
break;
case 3: /* msgsnd */
e = AUE_MSGSND;
break;
default: /* illegal system call */
e = AUE_NULL;
break;
}
return (e);
}
/* shmsys */
static au_event_t
{
int fm;
struct a { /* shmsys */
long id; /* function code id */
struct b { /* ctrl */
long shmid;
long cmd;
long arg; /* struct shmid_ds * */
switch (fm) {
case 0: /* shmat */
e = AUE_SHMAT;
break;
case 1: /* shmctl */
case IPC_RMID:
e = AUE_SHMCTL_RMID;
break;
case IPC_SET:
e = AUE_SHMCTL_SET;
break;
case IPC_STAT:
e = AUE_SHMCTL_STAT;
break;
default:
e = AUE_SHMCTL;
break;
}
break;
case 2: /* shmdt */
e = AUE_SHMDT;
break;
case 3: /* shmget */
e = AUE_SHMGET;
break;
default: /* illegal system call */
e = AUE_NULL;
break;
}
return (e);
}
/* semsys */
static au_event_t
{
struct a { /* semsys */
long id;
struct b { /* ctrl */
long semid;
long semnum;
long cmd;
long arg;
switch (fm) {
case 0: /* semctl */
case IPC_RMID:
e = AUE_SEMCTL_RMID;
break;
case IPC_SET:
e = AUE_SEMCTL_SET;
break;
case IPC_STAT:
e = AUE_SEMCTL_STAT;
break;
case GETNCNT:
e = AUE_SEMCTL_GETNCNT;
break;
case GETPID:
e = AUE_SEMCTL_GETPID;
break;
case GETVAL:
e = AUE_SEMCTL_GETVAL;
break;
case GETALL:
e = AUE_SEMCTL_GETALL;
break;
case GETZCNT:
e = AUE_SEMCTL_GETZCNT;
break;
case SETVAL:
e = AUE_SEMCTL_SETVAL;
break;
case SETALL:
e = AUE_SEMCTL_SETALL;
break;
default:
e = AUE_SEMCTL;
break;
}
break;
case 1: /* semget */
e = AUE_SEMGET;
break;
case 2: /* semop */
e = AUE_SEMOP;
break;
default: /* illegal system call */
e = AUE_NULL;
break;
}
return (e);
}
/* utssys - uname(2), ustat(2), fusers(2) */
static au_event_t
{
struct a {
union {
long cbuf; /* char * */
long ubuf; /* struct stat * */
} ub;
union {
long mv; /* for USTAT */
long flags; /* for FUSERS */
} un;
long type;
long outbp; /* char * for FUSERS */
if (type == UTS_FUSERS)
return (e);
else
return ((au_event_t)AUE_NULL);
}
static au_event_t
{
struct a {
long fdes;
long cmd;
long arg;
switch (cmd) {
case F_GETLK:
case F_SETLK:
case F_SETLKW:
break;
case F_SETFL:
case F_GETFL:
case F_GETFD:
break;
default:
e = (au_event_t)AUE_NULL;
break;
}
return ((au_event_t)e);
}
/* null function for now */
static au_event_t
{
return (e);
}
/* null function for now */
static au_event_t
{
return (e);
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fd;
long cmd;
long arg;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
}
/*ARGSUSED*/
static void
{
struct proc *p;
const auditinfo_addr_t *ainfo;
struct a {
long pid;
long signo;
if (pid > 0) {
return;
}
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
if (is_system_labeled())
}
else
}
/*ARGSUSED*/
static void
{
struct a {
long dirnamep; /* char * */
long dmode;
}
/*ARGSUSED*/
static void
{
struct a {
long pnamep; /* char * */
long fmode;
long dev;
#ifdef _LP64
#else
#endif
}
/*ARGSUSED*/
static void
{
struct a {
long version; /* version */
long pnamep; /* char * */
long fmode;
long dev;
#ifdef _LP64
#else
#endif
}
/*ARGSUSED*/
static void
{
struct a {
long pnamep; /* char * */
long fmode;
long dev;
/* no error, then already path token in audit record */
return;
/* not auditing this event, nothing then to do */
return;
/* do the lookup to force generation of path token */
if (error == 0)
}
/*ARGSUSED*/
static void
{
struct a {
long version; /* version */
long pnamep; /* char * */
long fmode;
long dev;
/* no error, then already path token in audit record */
return;
/* not auditing this event, nothing then to do */
return;
/* do the lookup to force generation of path token */
if (error == 0)
}
/*ARGSUSED*/
static void
{ /* AUS_START */
struct a {
long spec; /* char * */
long dir; /* char * */
long flags;
long fstype; /* char * */
long dataptr; /* char * */
long datalen;
goto mount_free_fstype;
/* DEBUG debug_enter((char *)NULL); */
goto mount_free_fstype;
}
MAXNAMELEN, &len)) {
goto mount_free_hostname;
}
}
} /* AUS_MOUNT */
static void
{
char *dir_path;
struct audit_path *path;
/* length alloc'd for two string pointers */
path_len = sizeof (struct audit_path) + sizeof (char *);
MAXPATHLEN, &dir_len))
goto umount2_free_dir;
/*
* the audit_path struct assumes that the buffer pointed to
* by audp_sect[n] contains string 0 immediatedly followed
* by string 1.
*/
}
/*
* the umount syscall is implemented as a call to umount2, but the args
* are different...
*/
/*ARGSUSED*/
static void
{
struct a {
long dir; /* char * */
}
/*ARGSUSED*/
static void
{
struct a {
long dir; /* char * */
long flags;
}
static void
{
struct b {
long msgid;
long cmd;
long buf; /* struct msqid_ds * */
case AUE_MSGGET: /* msgget */
break;
case AUE_MSGCTL: /* msgctl */
case AUE_MSGCTL_RMID: /* msgctl */
case AUE_MSGCTL_STAT: /* msgctl */
case AUE_MSGRCV: /* msgrcv */
case AUE_MSGSND: /* msgsnd */
break;
case AUE_MSGCTL_SET: /* msgctl */
break;
}
}
/*ARGSUSED*/
static void
{
int id;
if (error != 0)
return;
/* need to determine type of executing binary */
#ifdef _SYSCALL32_IMPL
else
#else
#endif
if (sy_flags == SE_32RVAL1)
}
}
static void
{
struct b { /* ctrl */
long semid;
long semnum;
long cmd;
long arg;
case AUE_SEMCTL_RMID:
case AUE_SEMCTL_STAT:
case AUE_SEMCTL_GETNCNT:
case AUE_SEMCTL_GETPID:
case AUE_SEMCTL_GETVAL:
case AUE_SEMCTL_GETALL:
case AUE_SEMCTL_GETZCNT:
case AUE_SEMCTL_SETVAL:
case AUE_SEMCTL_SETALL:
case AUE_SEMCTL:
case AUE_SEMOP:
break;
case AUE_SEMCTL_SET:
break;
case AUE_SEMGET:
break;
}
}
/*ARGSUSED*/
static void
{
int id;
if (error != 0)
return;
/* need to determine type of executing binary */
#ifdef _SYSCALL32_IMPL
else
#else
#endif
if (sy_flags == SE_32RVAL1)
}
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long i;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/*
* When write was not used and the file can be
* considered public, skip the audit.
*/
file_is_public(&attr)) {
/* free any residual audit data */
return;
}
}
}
}
/* decrement file descriptor reference count */
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fd;
long buf; /* struct statfs * */
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
}
#ifdef NOTYET
/*ARGSUSED*/
static void
{
struct proc *p;
const auditinfo_addr_t *ainfo;
struct a {
long pid;
long pgrp;
/* current process? */
if (pid == 0)
(return);
return;
}
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
}
#endif
/*ARGSUSED*/
static void
{
struct a {
long rgid;
long egid;
}
/*ARGSUSED*/
static void
{
struct a {
long gid;
}
/*ARGSUSED*/
static void
{
struct a {
long ruid;
long euid;
}
/*ARGSUSED*/
static void
{
struct a {
long uid;
}
/*ARGSUSED*/
static void
{
struct b {
long id;
long cmd;
long buf; /* struct shmid_ds * */
case AUE_SHMGET: /* shmget */
break;
case AUE_SHMCTL: /* shmctl */
case AUE_SHMCTL_RMID: /* shmctl */
case AUE_SHMCTL_STAT: /* shmctl */
case AUE_SHMCTL_SET: /* shmctl */
break;
case AUE_SHMDT: /* shmdt */
break;
case AUE_SHMAT: /* shmat */
break;
}
}
/*ARGSUSED*/
static void
{
int id;
if (error != 0)
return;
/* need to determine type of executing binary */
#ifdef _SYSCALL32_IMPL
else
#else
#endif
if (sy_flags == SE_32RVAL1)
}
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
/* XX64 */
struct a {
long fd;
long cmd;
long cmarg; /* caddr_t */
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
#ifndef _LP64
#else
#endif
return;
}
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
#ifndef _LP64
#else
#endif
}
/*
* null function for memcntl for now. We might want to limit memcntl()
* auditing to commands: MC_LOCKAS, MC_LOCK, MC_UNLOCKAS, MC_UNLOCK which
* require privileges.
*/
static au_event_t
{
return (e);
}
/*ARGSUSED*/
static au_event_t
{
struct a {
long opcode;
case PRIVSYS_SETPPRIV:
return (AUE_SETPPRIV);
default:
return (AUE_NULL);
}
}
/*ARGSUSED*/
static void
{
struct a {
long addr;
long len;
long cmd;
long arg;
long attr;
long mask;
#ifdef _LP64
#else
#endif
#ifdef _LP64
#else
#endif
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long addr;
long len;
long prot;
long flags;
long fd;
long pos;
#ifdef _LP64
#else
#endif
return;
}
/*
* Mark in the tad if write access is NOT requested... if
* this is later detected (in audit_attributes) to be a
* public object, the mmap event may be discarded.
*/
}
} else {
}
/* decrement file descriptor reference count */
} /* AUS_MMAP */
/*ARGSUSED*/
static void
{
struct a {
long addr;
long len;
#ifdef _LP64
#else
#endif
} /* AUS_MUNMAP */
/*ARGSUSED*/
static void
{
struct a {
long pc_version;
long psp; /* procset_t */
long cmd;
long arg;
} /* AUS_PRIOCNTLSYS */
/*ARGSUSED*/
static void
{
struct a {
long gid;
} /* AUS_SETEGID */
/*ARGSUSED*/
static void
{
int i;
int gidsetsize;
struct a {
long gidsetsize;
long gidset;
return;
if (gidsetsize != 0) {
KM_SLEEP);
gidsetsize * sizeof (gid_t)) == 0)
for (i = 0; i < gidsetsize; i++)
} else
} /* AUS_SETGROUPS */
/*ARGSUSED*/
static void
{
struct a {
long uid;
} /* AUS_SETEUID */
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fdes;
long ctl; /* struct strbuf * */
long data; /* struct strbuf * */
long pri;
/* add path name to audit record */
}
}
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fdes;
long ctl; /* struct strbuf * */
long data; /* struct strbuf * */
long pri;
long flags;
/* add path name to audit record */
}
}
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fdes;
long ctl; /* struct strbuf * */
long data; /* struct strbuf * */
long pri;
/*
* read operation on this object
*/
/* add path name to audit record */
}
}
}
/*ARGSUSED*/
static void
{
struct f_audit_data *fad;
struct a {
long fdes;
long ctl; /* struct strbuf * */
long data; /* struct strbuf * */
long pri;
long flags;
/*
* read operation on this object
*/
/* add path name to audit record */
}
}
}
static au_event_t
{
struct a {
long code;
long a1;
long a2;
long a3;
long a4;
long a5;
long a6;
long a7;
switch (code) {
case BSM_GETAUID:
e = AUE_GETAUID;
break;
case BSM_SETAUID:
e = AUE_SETAUID;
break;
case BSM_GETAUDIT:
e = AUE_GETAUDIT;
break;
case BSM_GETAUDIT_ADDR:
e = AUE_GETAUDIT_ADDR;
break;
case BSM_SETAUDIT:
e = AUE_SETAUDIT;
break;
case BSM_SETAUDIT_ADDR:
e = AUE_SETAUDIT_ADDR;
break;
case BSM_AUDIT:
e = AUE_AUDIT;
break;
case BSM_AUDITSVC:
e = AUE_AUDITSVC;
break;
case BSM_GETPORTAUDIT:
e = AUE_GETPORTAUDIT;
break;
case BSM_AUDITON:
case BSM_AUDITCTL:
case A_GETPOLICY:
e = AUE_AUDITON_GPOLICY;
break;
case A_SETPOLICY:
e = AUE_AUDITON_SPOLICY;
break;
case A_GETKMASK:
e = AUE_AUDITON_GETKMASK;
break;
case A_SETKMASK:
e = AUE_AUDITON_SETKMASK;
break;
case A_GETQCTRL:
e = AUE_AUDITON_GQCTRL;
break;
case A_SETQCTRL:
e = AUE_AUDITON_SQCTRL;
break;
case A_GETCWD:
e = AUE_AUDITON_GETCWD;
break;
case A_GETCAR:
e = AUE_AUDITON_GETCAR;
break;
case A_GETSTAT:
e = AUE_AUDITON_GETSTAT;
break;
case A_SETSTAT:
e = AUE_AUDITON_SETSTAT;
break;
case A_SETUMASK:
e = AUE_AUDITON_SETUMASK;
break;
case A_SETSMASK:
e = AUE_AUDITON_SETSMASK;
break;
case A_GETCOND:
e = AUE_AUDITON_GETCOND;
break;
case A_SETCOND:
e = AUE_AUDITON_SETCOND;
break;
case A_GETCLASS:
e = AUE_AUDITON_GETCLASS;
break;
case A_SETCLASS:
e = AUE_AUDITON_SETCLASS;
break;
default:
e = AUE_NULL;
break;
}
break;
default:
e = AUE_NULL;
break;
}
return (e);
} /* AUI_AUDITSYS */
static void
{
struct f_audit_data *fad;
int auditstate, policy;
struct a {
long code;
long a1;
long a2;
long a3;
long a4;
long a5;
long a6;
long a7;
case AUE_SETAUID:
return;
break;
case AUE_SETAUDIT:
STRUCT_SIZE(ainfo))) {
return;
}
#ifdef _LP64
#else
#endif
break;
case AUE_SETAUDIT_ADDR:
STRUCT_SIZE(ainfo_addr))) {
return;
}
#ifdef _LP64
#else
#endif
AU_IPv4) {
} else {
}
break;
case AUE_AUDITSVC:
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here
*/
return;
} else {
}
/* decrement file descriptor ref count */
break;
case AUE_AUDITON_SETKMASK:
return;
break;
case AUE_AUDITON_SPOLICY:
return;
break;
case AUE_AUDITON_SQCTRL: {
model = get_udatamodel();
return;
if (model == DATAMODEL_ILP32) {
3, "setqctrl:aq_hiwater",
3, "setqctrl:aq_lowater",
3, "setqctrl:aq_bufsz",
3, "setqctrl:aq_delay",
} else {
3, "setqctrl:aq_hiwater",
3, "setqctrl:aq_lowater",
3, "setqctrl:aq_bufsz",
3, "setqctrl:aq_delay",
}
break;
}
case AUE_AUDITON_SETUMASK:
STRUCT_SIZE(ainfo))) {
return;
}
break;
case AUE_AUDITON_SETSMASK:
STRUCT_SIZE(ainfo))) {
return;
}
break;
case AUE_AUDITON_SETCOND:
return;
break;
case AUE_AUDITON_SETCLASS:
return;
break;
case AUE_GETAUID:
case AUE_GETAUDIT:
case AUE_GETAUDIT_ADDR:
case AUE_AUDIT:
case AUE_GETPORTAUDIT:
case AUE_AUDITON_GPOLICY:
case AUE_AUDITON_GQCTRL:
case AUE_AUDITON_GETKMASK:
case AUE_AUDITON_GETCWD:
case AUE_AUDITON_GETCAR:
case AUE_AUDITON_GETSTAT:
case AUE_AUDITON_SETSTAT:
case AUE_AUDITON_GETCOND:
case AUE_AUDITON_GETCLASS:
break;
default:
break;
}
} /* AUS_AUDITSYS */
/* only audit privileged operations for systeminfo(2) system call */
static au_event_t
{
struct a {
long command;
long buf; /* char * */
long count;
switch (command) {
case SI_SET_HOSTNAME:
case SI_SET_SRPC_DOMAIN:
e = (au_event_t)AUE_SYSINFO;
break;
default:
e = (au_event_t)AUE_NULL;
break;
}
return (e);
}
/*ARGSUSED*/
static void
{
char *name;
struct a {
long command;
long buf; /* char * */
long count;
switch (command) {
case SI_SET_HOSTNAME:
{
return;
break;
/*
* Must be non-NULL string and string
* must be less than SYS_NMLN chars.
*/
break;
break;
}
case SI_SET_SRPC_DOMAIN:
{
return;
break;
/*
* If string passed in is longer than length
* allowed for domain name, fail.
*/
break;
break;
}
default:
return;
}
}
static au_event_t
{
struct a {
long cmd;
switch (cmd) {
case MODLOAD:
e = AUE_MODLOAD;
break;
case MODUNLOAD:
e = AUE_MODUNLOAD;
break;
case MODADDMAJBIND:
e = AUE_MODADDMAJ;
break;
case MODSETDEVPOLICY:
e = AUE_MODDEVPLCY;
break;
case MODALLOCPRIV:
e = AUE_MODADDPRIV;
break;
default:
e = AUE_NULL;
break;
}
return (e);
}
/*ARGSUSED*/
static void
{
case AUE_MODLOAD: {
typedef struct {
long cmd;
long use_path;
long filename; /* char * */
} modloada_t;
char *filenamep;
extern char *default_path;
/* space to hold path */
/* get string */
/* free allocated path */
return;
}
/* ensure it's null terminated */
if (use_path)
/* release temporary memory */
break;
}
case AUE_MODUNLOAD: {
typedef struct {
long cmd;
long id;
} modunloada_t;
break;
}
case AUE_MODADDMAJ: {
typedef struct {
long cmd;
long subcmd;
long data; /* int * */
} modconfiga_t;
int i, num_aliases;
char *drvname, *mc_drvname;
char *name;
extern char *ddi_major_to_name(major_t);
model = get_udatamodel();
/* sanitize buffer */
/* get user arguments */
STRUCT_SIZE(mc)) != 0)
return;
if ((drvname = ddi_major_to_name(
/* safety */
if (mc_drvname[0] != '\0') {
}
/* drvname != NULL from test above */
return;
}
if (mc_drvname[0] != '\0') {
/* safety */
} else
for (i = 0; i < num_aliases; i++) {
STRUCT_SIZE(alias));
STRUCT_SIZE(alias)) != 0)
break;
MAXMODCONFNAME, NULL) != 0) {
break;
}
}
break;
}
default:
break;
}
}
/*ARGSUSED*/
static void
struct t_audit_data *tad,
int error,
{
int fd;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int err;
int len;
int add_sock_token = 0;
/* need to determine type of executing binary */
#ifdef _SYSCALL32_IMPL
else
#else
#endif
if (sy_flags == SE_32RVAL1)
if (error) {
/* can't trust socket contents. Just return */
return;
}
/*
* not security relevant if doing a accept from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* XXX - what about other socket types for AF_INET (e.g. DGRAM)
*/
/*
* no local address then need to get it from lower
* levels. only put out record on first read ala
* AUE_WRITE.
*/
/* only done once on a connection */
(void) SOP_GETSOCKNAME(so);
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
}
add_sock_token = 1;
}
break;
default:
/* AF_UNIX, AF_ROUTE, AF_KEY do not support accept */
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long addr;
long len;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int len;
int add_sock_token = 0;
/*
* bind failed, then nothing extra to add to audit record.
*/
if (error) {
/* XXX may want to add failed address some day */
return;
}
/*
* not security relevant if doing a bind from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
/* only done once on a connection */
(void) SOP_GETSOCKNAME(so);
}
add_sock_token = 1;
break;
case AF_UNIX:
/* token added by lookup */
break;
default:
/* AF_ROUTE, AF_KEY do not support accept */
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long addr;
long len;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int len;
int add_sock_token = 0;
/*
* not security relevant if doing a connect from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* no local address then need to get it from lower
* levels.
*/
/* only done once on a connection */
(void) SOP_GETSOCKNAME(so);
(void) SOP_GETPEERNAME(so);
}
if (error) {
break;
break;
break;
#ifdef NOTYET
#endif
} else {
/* sanity check on length */
}
add_sock_token = 1;
break;
case AF_UNIX:
/* does a lookup on name */
break;
default:
/* AF_ROUTE, AF_KEY do not support accept */
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long how;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int len;
int add_sock_token = 0;
/*
* not security relevant if doing a shutdown using non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* no local address then need to get it from lower
* levels.
*/
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
}
add_sock_token = 1;
break;
case AF_UNIX:
/* get path from file struct here */
} else {
}
break;
default:
/*
* AF_KEY and AF_ROUTE support shutdown. No socket token
* added.
*/
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long level;
long optname;
long *optval;
long optlen;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
char val[AU_BUFSIZE];
int len;
int add_sock_token = 0;
if (error) {
/* XXX may want to include other arguments */
return;
}
/*
* not security relevant if doing a setsockopt from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
}
/* get local and foreign addresses */
add_sock_token = 1;
break;
case AF_UNIX:
/* get path from file struct here */
} else {
}
break;
default:
/*
* AF_KEY and AF_ROUTE support setsockopt. No socket token
* added.
*/
break;
}
if (add_sock_token == 0) {
}
if ((len > 0) &&
}
if (add_sock_token == 0)
return;
}
/*ARGSUSED*/
static void
struct t_audit_data *tad;
{
struct a {
long domain;
long type;
long protocol;
long devpath;
char *kdevpath;
} else {
&size)) {
return;
}
if (size > MAXPATHLEN) {
return;
}
}
}
/*
* only audit recvmsg when the system call represents the creation of a new
* circuit. This effectively occurs for all UDP packets and may occur for
* special TCP situations where the local host has not set a local address
* in the socket structure.
*/
/*ARGSUSED*/
static void
struct t_audit_data *tad,
int error,
{
struct a {
long fd;
long msg; /* struct msghdr */
long flags;
int fd;
int err;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int len;
int add_sock_token = 0;
/* bail if an error */
if (error) {
return;
}
/*
* not security relevant if doing a recvmsg from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
/*
* XXX - what do we do about other families?
*/
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* if datagram type socket, then just use what is in
* socket structure for local address.
* XXX - what do we do for other types?
*/
add_sock_token = 1;
/* get local address */
/* get peer address */
break;
}
break;
}
/* length is value from recvmsg - sanity check */
if (msg_namelen == 0) {
break;
}
sizeof (so_faddr)) != 0) {
break;
}
/* get path from file struct here */
/*
* already processed this file for read attempt
*/
/* don't want to audit every recvmsg attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
}
add_sock_token = 1;
}
/* XXX - what about SOCK_RDM/SOCK_SEQPACKET ??? */
break;
case AF_UNIX:
/*
* first check if this is first time through. Too much
* duplicate code to put this in an aui_ routine.
*/
/* get path from file struct here */
/*
* already processed this file for read attempt
*/
/* don't want to audit every recvmsg attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
} else {
}
return;
default:
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
struct t_audit_data *tad,
int error,
{
struct a {
long fd;
long msg; /* char */
long len;
long flags;
long from; /* struct sockaddr */
long fromlen;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int fd;
int add_sock_token = 0;
int len;
int err;
/* bail if an error */
if (error) {
return;
}
/*
* not security relevant if doing a recvmsg from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
/*
* XXX - what do we do about other families?
*/
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* if datagram type socket, then just use what is in
* socket structure for local address.
* XXX - what do we do for other types?
*/
add_sock_token = 1;
/* get local address */
/* get peer address */
/* sanity check */
break;
/* sanity checks */
break;
sizeof (fromlen)) != 0)
break;
if (fromlen == 0)
break;
/* enforce maximum size */
fromlen) != 0)
break;
/* get path from file struct here */
/*
* already processed this file for read attempt
*/
/* don't want to audit every recvfrom attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
}
add_sock_token = 1;
}
/* XXX - what about SOCK_RDM/SOCK_SEQPACKET ??? */
break;
case AF_UNIX:
/*
* first check if this is first time through. Too much
* duplicate code to put this in an aui_ routine.
*/
/* get path from file struct here */
/*
* already processed this file for read attempt
*/
/* don't want to audit every recvfrom attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
} else {
}
return;
default:
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long msg; /* struct msghdr */
long flags;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int err;
int fd;
int add_sock_token = 0;
int len;
struct f_audit_data *fad;
/* bail if an error */
if (error) {
/* XXX include destination address from system call arguments */
return;
}
/*
* not security relevant if doing a sendmsg from non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* if datagram type socket, then just use what is in
* socket structure for local address.
* XXX - what do we do for other types?
*/
/* get local address */
/* get peer address */
break;
}
break;
/* length is value from recvmsg - sanity check */
if (msg_namelen == 0)
break;
sizeof (so_faddr)) != 0)
break;
add_sock_token = 1;
/* get path from file struct here */
/*
* already processed this file for write attempt
*/
/* don't want to audit every sendmsg attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
}
add_sock_token = 1;
}
/* XXX - what about SOCK_RAW/SOCK_RDM/SOCK_SEQPACKET ??? */
break;
case AF_UNIX:
/*
* first check if this is first time through. Too much
* duplicate code to put this in an aui_ routine.
*/
/* get path from file struct here */
/*
* already processed this file for write attempt
*/
/* don't want to audit every sendmsg attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
} else {
}
return;
default:
break;
}
if (add_sock_token == 0) {
return;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long msg; /* char */
long len;
long flags;
long to; /* struct sockaddr */
long tolen;
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
int err;
int fd;
int len;
int add_sock_token = 0;
struct f_audit_data *fad;
/* bail if an error */
if (error) {
/* XXX include destination address from system call arguments */
return;
}
/*
* not security relevant if doing a sendto using non socket
* so no extra tokens. Should probably turn off audit record
* generation here.
*/
return;
}
/*
* XXX - what do we do about other families?
*/
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* if datagram type socket, then just use what is in
* socket structure for local address.
* XXX - what do we do for other types?
*/
/* get local address */
/* get peer address */
/* sanity check */
break;
/* sanity checks */
break;
/* enforce maximum size */
break;
add_sock_token = 1;
} else {
/*
* check if this is first time through.
*/
/* get path from file struct here */
/*
* already processed this file for write attempt
*/
/* don't want to audit every sendto attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
if (so->so_laddr_len == 0)
(void) SOP_GETSOCKNAME(so);
if (so->so_faddr_len == 0)
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
}
add_sock_token = 1;
}
/* XXX - what about SOCK_RDM/SOCK_SEQPACKET ??? */
break;
case AF_UNIX:
/*
* first check if this is first time through. Too much
* duplicate code to put this in an aui_ routine.
*/
/* get path from file struct here */
/*
* already processed this file for write attempt
*/
/* don't want to audit every sendto attempt */
/* free any residual audit data */
return;
}
/*
* mark things so we know what happened and don't
* repeat things
*/
} else {
}
return;
default:
break;
}
if (add_sock_token == 0) {
return;
}
}
/*
* XXX socket(2) may be equivilent to open(2) on a unix domain
* socket. This needs investigation.
*/
/*ARGSUSED*/
static void
{
struct a {
long domain;
long type;
long protocol;
}
/*ARGSUSED*/
static void
{
struct a {
long pid;
long signo;
long *val;
struct proc *p;
const auditinfo_addr_t *ainfo;
if (pid > 0) {
return;
}
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
}
else
}
/*ARGSUSED*/
static void
{
struct a {
long name; /* char */
long flags;
}
/*ARGSUSED*/
static void
{
struct a {
long cmd;
long arg1;
long arg2;
long arg3;
long arg4;
long arg5;
long arg6;
#ifdef _LP64
#else
#endif
}
/*ARGSUSED*/
static void
{
struct a {
long processor_id;
long flag;
struct flags {
int flag;
char *cflag;
} aflags[6] = {
{ P_ONLINE, "P_ONLINE"},
{ P_OFFLINE, "P_OFFLINE"},
{ P_NOINTR, "P_NOINTR"},
{ P_SPARE, "P_SPARE"},
{ P_FAULTED, "P_FAULTED"},
{ P_STATUS, "P_STATUS"}
};
int i;
char *cflag;
for (i = 0; i < 6; i++) {
break;
}
}
/*ARGSUSED*/
static void
{
struct a {
long id_type;
long id;
long processor_id;
long obind;
struct proc *p;
int lwpcnt;
const auditinfo_addr_t *ainfo;
else
case P_MYID:
case P_LWPID:
return;
}
mutex_enter(&p->p_lock);
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
break;
case P_PID:
return;
}
mutex_enter(&p->p_lock);
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
break;
default:
return;
}
else
}
/*ARGSUSED*/
static au_event_t
{
struct a { /* doorfs */
long a1;
long a2;
long a3;
long a4;
long a5;
long code;
/*
* audit formats for several of the
* door calls have not yet been determined
*/
switch (code) {
case DOOR_CALL:
e = AUE_DOORFS_DOOR_CALL;
break;
case DOOR_RETURN:
e = AUE_NULL;
break;
case DOOR_CREATE:
break;
case DOOR_REVOKE:
break;
case DOOR_INFO:
e = AUE_NULL;
break;
case DOOR_UCRED:
e = AUE_NULL;
break;
case DOOR_BIND:
e = AUE_NULL;
break;
case DOOR_UNBIND:
e = AUE_NULL;
break;
case DOOR_GETPARAM:
e = AUE_NULL;
break;
case DOOR_SETPARAM:
e = AUE_NULL;
break;
default: /* illegal system call */
e = AUE_NULL;
break;
}
return (e);
}
static door_node_t *
au_door_lookup(int did)
{
return (NULL);
/*
* Use the underlying vnode (we may be namefs mounted)
*/
return (NULL);
}
}
/*ARGSUSED*/
static void
{
struct a { /* doorfs */
long a1;
long a2;
long a3;
long a4;
long a5;
long code;
struct proc *p;
const auditinfo_addr_t *ainfo;
case AUE_DOORFS_DOOR_CALL:
break;
if (DOOR_INVALID(dp)) {
break;
}
break;
}
mutex_enter(&p->p_lock);
mutex_enter(&p->p_crlock);
mutex_exit(&p->p_crlock);
mutex_exit(&p->p_lock);
return;
}
break;
case AUE_DOORFS_DOOR_RETURN:
/*
* We may want to write information about
* all doors (if any) which will be copied
* by this call to the user space
*/
break;
case AUE_DOORFS_DOOR_CREATE:
break;
case AUE_DOORFS_DOOR_REVOKE:
break;
case AUE_DOORFS_DOOR_INFO:
break;
case AUE_DOORFS_DOOR_CRED:
break;
case AUE_DOORFS_DOOR_BIND:
break;
case AUE_DOORFS_DOOR_UNBIND: {
break;
}
default: /* illegal system call */
break;
}
}
/*ARGSUSED*/
static au_event_t
{
struct a {
union {
long name; /* char */
long fd;
} obj;
long cmd;
long nentries;
long arg; /* aclent_t */
case SETACL:
/* ok, acl(SETACL, ...) and facl(SETACL, ...) are expected. */
break;
case GETACL:
case GETACLCNT:
/* do nothing for these two values. */
e = AUE_NULL;
break;
default:
/* illegal system call */
break;
}
return (e);
}
/*ARGSUSED*/
static void
{
struct a {
long fname;
long cmd;
long nentries;
long aclbufp;
case GETACL:
case GETACLCNT:
break;
case SETACL:
break;
else {
int i;
break;
}
}
break;
}
default:
break;
}
}
/*ARGSUSED*/
static void
{
struct a {
long fd;
long cmd;
long nentries;
long aclbufp;
struct f_audit_data *fad;
int fd;
return;
/* get path from file struct here */
} else {
}
/* decrement file descriptor reference count */
case GETACL:
case GETACLCNT:
break;
case SETACL:
break;
else {
int i;
break;
}
}
break;
}
default:
break;
}
}
/*ARGSUSED*/
static void
struct t_audit_data *tad;
int error;
{
struct f_audit_data *fad;
int fd;
register struct a {
long fd;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
/*
* already processed this file for read attempt
*
* XXX might be better to turn off auditing in a aui_read() routine.
*/
/* don't really want to audit every read attempt */
/* free any residual audit data */
return;
}
/* mark things so we know what happened and don't repeat things */
} else {
}
/* include attributes */
/* decrement file descriptor reference count */
}
/*ARGSUSED*/
static void
struct t_audit_data *tad;
int error;
{
struct f_audit_data *fad;
int fd;
register struct a {
long fd;
/*
* convert file pointer to file descriptor
* Note: fd ref count incremented here.
*/
return;
/* get path from file struct here */
/*
* already processed this file for write attempt
*
* XXX might be better to turn off auditing in a aus_write() routine.
*/
/* don't really want to audit every write attempt */
/* free any residual audit data */
return;
}
/* mark things so we know what happened and don't repeat things */
} else {
}
/* include attributes */
/* decrement file descriptor reference count */
}
/*ARGSUSED*/
static void
struct t_audit_data *tad;
int error;
{
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
struct f_audit_data *fad;
int fd;
int err;
int len;
register struct a {
long fd;
/*
* If there was an error, then nothing to do. Only generate
* audit record on first successful recv.
*/
if (error) {
/* Turn off audit record generation here. */
/* free any residual audit data */
return;
}
/* Turn off audit record generation here. */
/* free any residual audit data */
return;
}
/* get path from file struct here */
/*
* already processed this file for read attempt
*/
/* don't really want to audit every recv call */
/* free any residual audit data */
return;
}
/* mark things so we know what happened and don't repeat things */
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* Only for connections.
* XXX - do we need to worry about SOCK_DGRAM or other types???
*/
/* only done once on a connection */
(void) SOP_GETSOCKNAME(so);
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
/*
* only way to drop out of switch. Note that we
* we release fd below.
*/
break;
}
/* don't really want to audit every recv call */
/* free any residual audit data */
return;
case AF_UNIX:
} else {
}
return;
default:
return;
}
}
/*ARGSUSED*/
static void
struct t_audit_data *tad;
int error;
{
char so_laddr[sizeof (struct sockaddr_in6)];
char so_faddr[sizeof (struct sockaddr_in6)];
struct f_audit_data *fad;
int fd;
int err;
int len;
register struct a {
long fd;
/*
* If there was an error, then nothing to do. Only generate
* audit record on first successful send.
*/
if (error != 0) {
/* Turn off audit record generation here. */
/* free any residual audit data */
return;
}
/* Turn off audit record generation here. */
/* free any residual audit data */
return;
}
/* get path from file struct here */
/*
* already processed this file for write attempt
*/
/* don't really want to audit every send call */
/* free any residual audit data */
return;
}
/* mark things so we know what happened and don't repeat things */
switch (so_family) {
case AF_INET:
case AF_INET6:
/*
* Only for connections.
* XXX - do we need to worry about SOCK_DGRAM or other types???
*/
/* only done once on a connection */
(void) SOP_GETSOCKNAME(so);
(void) SOP_GETPEERNAME(so);
/* get local and foreign addresses */
/*
* only way to drop out of switch. Note that we
* we release fd below.
*/
break;
}
/* don't really want to audit every send call */
/* free any residual audit data */
return;
case AF_UNIX:
} else {
}
return;
default:
return;
}
}
static au_event_t
{
struct a {
long subcode;
long flags;
case 0:
e = AUE_FORK1;
break;
case 1:
e = AUE_FORKALL;
break;
case 2:
e = AUE_VFORK;
break;
default:
e = AUE_NULL;
break;
}
return (e);
}
/*ARGSUSED*/
static au_event_t
{
struct a { /* portfs */
long a1;
long a2;
long a3;
/*
* check opcode
*/
case PORT_ASSOCIATE:
case PORT_DISSOCIATE:
/*
* check source
*/
e = AUE_PORTFS;
} else {
e = AUE_NULL;
}
break;
default:
e = AUE_NULL;
}
return (e);
}