2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1999-2005 Apple Inc.
5 * Copyright (c) 2006-2007, 2016-2018 Robert N. M. Watson
8 * Portions of this software were developed by BAE Systems, the University of
9 * Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL
10 * contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent
11 * Computing (TC) research program.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of Apple Inc. ("Apple") nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
38 #include <sys/cdefs.h>
39 __FBSDID("$FreeBSD$");
41 #include <sys/param.h>
42 #include <sys/condvar.h>
45 #include <sys/filedesc.h>
46 #include <sys/fcntl.h>
49 #include <sys/kernel.h>
50 #include <sys/kthread.h>
51 #include <sys/malloc.h>
52 #include <sys/mount.h>
53 #include <sys/namei.h>
56 #include <sys/queue.h>
57 #include <sys/socket.h>
58 #include <sys/socketvar.h>
59 #include <sys/protosw.h>
60 #include <sys/domain.h>
61 #include <sys/sysctl.h>
62 #include <sys/sysproto.h>
63 #include <sys/sysent.h>
64 #include <sys/systm.h>
65 #include <sys/ucred.h>
68 #include <sys/unistd.h>
69 #include <sys/vnode.h>
71 #include <bsm/audit.h>
72 #include <bsm/audit_internal.h>
73 #include <bsm/audit_kevents.h>
75 #include <netinet/in.h>
76 #include <netinet/in_pcb.h>
78 #include <security/audit/audit.h>
79 #include <security/audit/audit_private.h>
83 FEATURE(audit, "BSM audit support");
85 static uma_zone_t audit_record_zone;
86 static MALLOC_DEFINE(M_AUDITCRED, "audit_cred", "Audit cred storage");
87 MALLOC_DEFINE(M_AUDITDATA, "audit_data", "Audit data storage");
88 MALLOC_DEFINE(M_AUDITPATH, "audit_path", "Audit path storage");
89 MALLOC_DEFINE(M_AUDITTEXT, "audit_text", "Audit text storage");
90 MALLOC_DEFINE(M_AUDITGIDSET, "audit_gidset", "Audit GID set storage");
92 static SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG_RW, 0,
93 "TrustedBSD audit controls");
96 * Audit control settings that are set/read by system calls and are hence
99 * Define the audit control flags.
101 int audit_trail_enabled;
102 int audit_trail_suspended;
104 u_int audit_dtrace_enabled;
106 int __read_frequently audit_syscalls_enabled;
109 * Flags controlling behavior in low storage situations. Should we panic if
110 * a write fails? Should we fail stop if we're out of disk space?
112 int audit_panic_on_write_fail;
118 * Are we currently "failing stop" due to out of disk space?
120 int audit_in_failure;
123 * Global audit statistics.
125 struct audit_fstat audit_fstat;
128 * Preselection mask for non-attributable events.
130 struct au_mask audit_nae_mask;
133 * Mutex to protect global variables shared between various threads and
136 struct mtx audit_mtx;
139 * Queue of audit records ready for delivery to disk. We insert new records
140 * at the tail, and remove records from the head. Also, a count of the
141 * number of records used for checking queue depth. In addition, a counter
142 * of records that we have allocated but are not yet in the queue, which is
143 * needed to estimate the total size of the combined set of records
144 * outstanding in the system.
146 struct kaudit_queue audit_q;
151 * Audit queue control settings (minimum free, low/high water marks, etc.)
153 struct au_qctrl audit_qctrl;
156 * Condition variable to signal to the worker that it has work to do: either
157 * new records are in the queue, or a log replacement is taking place.
159 struct cv audit_worker_cv;
162 * Condition variable to flag when crossing the low watermark, meaning that
163 * threads blocked due to hitting the high watermark can wake up and continue
166 struct cv audit_watermark_cv;
169 * Condition variable for auditing threads wait on when in fail-stop mode.
170 * Threads wait on this CV forever (and ever), never seeing the light of day
173 static struct cv audit_fail_cv;
176 * Optional DTrace audit provider support: function pointers for preselection
180 void *(*dtaudit_hook_preselect)(au_id_t auid, au_event_t event,
182 int (*dtaudit_hook_commit)(struct kaudit_record *kar, au_id_t auid,
183 au_event_t event, au_class_t class, int sorf);
184 void (*dtaudit_hook_bsm)(struct kaudit_record *kar, au_id_t auid,
185 au_event_t event, au_class_t class, int sorf,
186 void *bsm_data, size_t bsm_lenlen);
190 * Kernel audit information. This will store the current audit address
191 * or host information that the kernel will use when it's generating
192 * audit records. This data is modified by the A_GET{SET}KAUDIT auditon(2)
195 static struct auditinfo_addr audit_kinfo;
196 static struct rwlock audit_kinfo_lock;
198 #define KINFO_LOCK_INIT() rw_init(&audit_kinfo_lock, \
200 #define KINFO_RLOCK() rw_rlock(&audit_kinfo_lock)
201 #define KINFO_WLOCK() rw_wlock(&audit_kinfo_lock)
202 #define KINFO_RUNLOCK() rw_runlock(&audit_kinfo_lock)
203 #define KINFO_WUNLOCK() rw_wunlock(&audit_kinfo_lock)
206 * Check various policies to see if we should enable system-call audit hooks.
207 * Note that despite the mutex being held, we want to assign a value exactly
208 * once, as checks of the flag are performed lock-free for performance
209 * reasons. The mutex is used to get a consistent snapshot of policy state --
210 * e.g., safely accessing the two audit_trail flags.
213 audit_syscalls_enabled_update(void)
216 mtx_lock(&audit_mtx);
218 if (audit_dtrace_enabled)
219 audit_syscalls_enabled = 1;
222 if (audit_trail_enabled && !audit_trail_suspended)
223 audit_syscalls_enabled = 1;
225 audit_syscalls_enabled = 0;
229 mtx_unlock(&audit_mtx);
233 audit_set_kinfo(struct auditinfo_addr *ak)
236 KASSERT(ak->ai_termid.at_type == AU_IPv4 ||
237 ak->ai_termid.at_type == AU_IPv6,
238 ("audit_set_kinfo: invalid address type"));
246 audit_get_kinfo(struct auditinfo_addr *ak)
249 KASSERT(audit_kinfo.ai_termid.at_type == AU_IPv4 ||
250 audit_kinfo.ai_termid.at_type == AU_IPv6,
251 ("audit_set_kinfo: invalid address type"));
259 * Construct an audit record for the passed thread.
262 audit_record_ctor(void *mem, int size, void *arg, int flags)
264 struct kaudit_record *ar;
269 KASSERT(sizeof(*ar) == size, ("audit_record_ctor: wrong size"));
273 bzero(ar, sizeof(*ar));
274 ar->k_ar.ar_magic = AUDIT_RECORD_MAGIC;
275 nanotime(&ar->k_ar.ar_starttime);
278 * Export the subject credential.
281 cru2x(cred, &ar->k_ar.ar_subj_cred);
282 ar->k_ar.ar_subj_ruid = cred->cr_ruid;
283 ar->k_ar.ar_subj_rgid = cred->cr_rgid;
284 ar->k_ar.ar_subj_egid = cred->cr_groups[0];
285 ar->k_ar.ar_subj_auid = cred->cr_audit.ai_auid;
286 ar->k_ar.ar_subj_asid = cred->cr_audit.ai_asid;
287 ar->k_ar.ar_subj_pid = td->td_proc->p_pid;
288 ar->k_ar.ar_subj_amask = cred->cr_audit.ai_mask;
289 ar->k_ar.ar_subj_term_addr = cred->cr_audit.ai_termid;
291 * If this process is jailed, make sure we capture the name of the
292 * jail so we can use it to generate a zonename token when we covert
293 * this record to BSM.
296 pr = cred->cr_prison;
297 (void) strlcpy(ar->k_ar.ar_jailname, pr->pr_name,
298 sizeof(ar->k_ar.ar_jailname));
300 ar->k_ar.ar_jailname[0] = '\0';
305 audit_record_dtor(void *mem, int size, void *arg)
307 struct kaudit_record *ar;
309 KASSERT(sizeof(*ar) == size, ("audit_record_dtor: wrong size"));
312 if (ar->k_ar.ar_arg_upath1 != NULL)
313 free(ar->k_ar.ar_arg_upath1, M_AUDITPATH);
314 if (ar->k_ar.ar_arg_upath2 != NULL)
315 free(ar->k_ar.ar_arg_upath2, M_AUDITPATH);
316 if (ar->k_ar.ar_arg_text != NULL)
317 free(ar->k_ar.ar_arg_text, M_AUDITTEXT);
318 if (ar->k_udata != NULL)
319 free(ar->k_udata, M_AUDITDATA);
320 if (ar->k_ar.ar_arg_argv != NULL)
321 free(ar->k_ar.ar_arg_argv, M_AUDITTEXT);
322 if (ar->k_ar.ar_arg_envv != NULL)
323 free(ar->k_ar.ar_arg_envv, M_AUDITTEXT);
324 if (ar->k_ar.ar_arg_groups.gidset != NULL)
325 free(ar->k_ar.ar_arg_groups.gidset, M_AUDITGIDSET);
329 * Initialize the Audit subsystem: configuration state, work queue,
330 * synchronization primitives, worker thread, and trigger device node. Also
331 * call into the BSM assembly code to initialize it.
337 audit_trail_enabled = 0;
338 audit_trail_suspended = 0;
339 audit_syscalls_enabled = 0;
340 audit_panic_on_write_fail = 0;
342 audit_in_failure = 0;
346 audit_fstat.af_filesz = 0; /* '0' means unset, unbounded. */
347 audit_fstat.af_currsz = 0;
348 audit_nae_mask.am_success = 0;
349 audit_nae_mask.am_failure = 0;
351 TAILQ_INIT(&audit_q);
354 audit_qctrl.aq_hiwater = AQ_HIWATER;
355 audit_qctrl.aq_lowater = AQ_LOWATER;
356 audit_qctrl.aq_bufsz = AQ_BUFSZ;
357 audit_qctrl.aq_minfree = AU_FS_MINFREE;
359 audit_kinfo.ai_termid.at_type = AU_IPv4;
360 audit_kinfo.ai_termid.at_addr[0] = INADDR_ANY;
362 mtx_init(&audit_mtx, "audit_mtx", NULL, MTX_DEF);
364 cv_init(&audit_worker_cv, "audit_worker_cv");
365 cv_init(&audit_watermark_cv, "audit_watermark_cv");
366 cv_init(&audit_fail_cv, "audit_fail_cv");
368 audit_record_zone = uma_zcreate("audit_record",
369 sizeof(struct kaudit_record), audit_record_ctor,
370 audit_record_dtor, NULL, NULL, UMA_ALIGN_PTR, 0);
372 /* First initialisation of audit_syscalls_enabled. */
373 audit_syscalls_enabled_update();
375 /* Initialize the BSM audit subsystem. */
378 audit_trigger_init();
380 /* Register shutdown handler. */
381 EVENTHANDLER_REGISTER(shutdown_pre_sync, audit_shutdown, NULL,
384 /* Start audit worker thread. */
388 SYSINIT(audit_init, SI_SUB_AUDIT, SI_ORDER_FIRST, audit_init, NULL);
391 * Drain the audit queue and close the log at shutdown. Note that this can
392 * be called both from the system shutdown path and also from audit
393 * configuration syscalls, so 'arg' and 'howto' are ignored.
395 * XXXRW: In FreeBSD 7.x and 8.x, this fails to wait for the record queue to
396 * drain before returning, which could lead to lost records on shutdown.
399 audit_shutdown(void *arg, int howto)
402 audit_rotate_vnode(NULL, NULL);
406 * Return the current thread's audit record, if any.
408 struct kaudit_record *
412 return (curthread->td_ar);
416 * XXXAUDIT: Shouldn't there be logic here to sleep waiting on available
417 * pre_q space, suspending the system call until there is room?
419 struct kaudit_record *
420 audit_new(int event, struct thread *td)
422 struct kaudit_record *ar;
425 * Note: the number of outstanding uncommitted audit records is
426 * limited to the number of concurrent threads servicing system calls
429 ar = uma_zalloc_arg(audit_record_zone, td, M_WAITOK);
430 ar->k_ar.ar_event = event;
432 mtx_lock(&audit_mtx);
434 mtx_unlock(&audit_mtx);
440 audit_free(struct kaudit_record *ar)
443 uma_zfree(audit_record_zone, ar);
447 audit_commit(struct kaudit_record *ar, int error, int retval)
453 struct au_mask *aumask;
458 ar->k_ar.ar_errno = error;
459 ar->k_ar.ar_retval = retval;
460 nanotime(&ar->k_ar.ar_endtime);
463 * Decide whether to commit the audit record by checking the error
464 * value from the system call and using the appropriate audit mask.
466 if (ar->k_ar.ar_subj_auid == AU_DEFAUDITID)
467 aumask = &audit_nae_mask;
469 aumask = &ar->k_ar.ar_subj_amask;
472 sorf = AU_PRS_FAILURE;
474 sorf = AU_PRS_SUCCESS;
477 * syscalls.master sometimes contains a prototype event number, which
478 * we will transform into a more specific event number now that we
479 * have more complete information gathered during the system call.
481 switch(ar->k_ar.ar_event) {
483 ar->k_ar.ar_event = audit_flags_and_error_to_openevent(
484 ar->k_ar.ar_arg_fflags, error);
487 case AUE_OPENAT_RWTC:
488 ar->k_ar.ar_event = audit_flags_and_error_to_openatevent(
489 ar->k_ar.ar_arg_fflags, error);
493 ar->k_ar.ar_event = audit_ctlname_to_sysctlevent(
494 ar->k_ar.ar_arg_ctlname, ar->k_ar.ar_valid_arg);
498 /* Convert the auditon() command to an event. */
499 ar->k_ar.ar_event = auditon_command_event(ar->k_ar.ar_arg_cmd);
503 if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH))
505 audit_msgsys_to_event(ar->k_ar.ar_arg_svipc_which);
509 if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH))
511 audit_semsys_to_event(ar->k_ar.ar_arg_svipc_which);
515 if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH))
517 audit_shmsys_to_event(ar->k_ar.ar_arg_svipc_which);
521 auid = ar->k_ar.ar_subj_auid;
522 event = ar->k_ar.ar_event;
523 class = au_event_class(event);
525 ar->k_ar_commit |= AR_COMMIT_KERNEL;
526 if (au_preselect(event, class, aumask, sorf) != 0)
527 ar->k_ar_commit |= AR_PRESELECT_TRAIL;
528 if (audit_pipe_preselect(auid, event, class, sorf,
529 ar->k_ar_commit & AR_PRESELECT_TRAIL) != 0)
530 ar->k_ar_commit |= AR_PRESELECT_PIPE;
533 * Expose the audit record to DTrace, both to allow the "commit" probe
534 * to fire if it's desirable, and also to allow a decision to be made
535 * about later firing with BSM in the audit worker.
537 if (dtaudit_hook_commit != NULL) {
538 if (dtaudit_hook_commit(ar, auid, event, class, sorf) != 0)
539 ar->k_ar_commit |= AR_PRESELECT_DTRACE;
543 if ((ar->k_ar_commit & (AR_PRESELECT_TRAIL | AR_PRESELECT_PIPE |
544 AR_PRESELECT_USER_TRAIL | AR_PRESELECT_USER_PIPE |
545 AR_PRESELECT_DTRACE)) == 0) {
546 mtx_lock(&audit_mtx);
548 mtx_unlock(&audit_mtx);
554 * Note: it could be that some records initiated while audit was
555 * enabled should still be committed?
557 * NB: The check here is not for audit_syscalls because any
558 * DTrace-related obligations have been fulfilled above -- we're just
559 * down to the trail and pipes now.
561 mtx_lock(&audit_mtx);
562 if (audit_trail_suspended || !audit_trail_enabled) {
564 mtx_unlock(&audit_mtx);
570 * Constrain the number of committed audit records based on the
571 * configurable parameter.
573 while (audit_q_len >= audit_qctrl.aq_hiwater)
574 cv_wait(&audit_watermark_cv, &audit_mtx);
576 TAILQ_INSERT_TAIL(&audit_q, ar, k_q);
579 cv_signal(&audit_worker_cv);
580 mtx_unlock(&audit_mtx);
584 * audit_syscall_enter() is called on entry to each system call. It is
585 * responsible for deciding whether or not to audit the call (preselection),
586 * and if so, allocating a per-thread audit record. audit_new() will fill in
587 * basic thread/credential properties.
589 * This function will be entered only if audit_syscalls_enabled was set in the
590 * macro wrapper for this function. It could be cleared by the time this
591 * function runs, but that is an acceptable race.
594 audit_syscall_enter(unsigned short code, struct thread *td)
596 struct au_mask *aumask;
605 KASSERT(td->td_ar == NULL, ("audit_syscall_enter: td->td_ar != NULL"));
606 KASSERT((td->td_pflags & TDP_AUDITREC) == 0,
607 ("audit_syscall_enter: TDP_AUDITREC set"));
610 * In FreeBSD, each ABI has its own system call table, and hence
611 * mapping of system call codes to audit events. Convert the code to
612 * an audit event identifier using the process system call table
613 * reference. In Darwin, there's only one, so we use the global
614 * symbol for the system call table. No audit record is generated
615 * for bad system calls, as no operation has been performed.
617 if (code >= td->td_proc->p_sysent->sv_size)
620 event = td->td_proc->p_sysent->sv_table[code].sy_auevent;
621 if (event == AUE_NULL)
625 * Check which audit mask to use; either the kernel non-attributable
626 * event mask or the process audit mask.
628 auid = td->td_ucred->cr_audit.ai_auid;
629 if (auid == AU_DEFAUDITID)
630 aumask = &audit_nae_mask;
632 aumask = &td->td_ucred->cr_audit.ai_mask;
635 * Determine whether trail or pipe preselection would like an audit
636 * record allocated for this system call.
638 class = au_event_class(event);
639 if (au_preselect(event, class, aumask, AU_PRS_BOTH)) {
641 * If we're out of space and need to suspend unprivileged
642 * processes, do that here rather than trying to allocate
643 * another audit record.
645 * Note: we might wish to be able to continue here in the
646 * future, if the system recovers. That should be possible
647 * by means of checking the condition in a loop around
648 * cv_wait(). It might be desirable to reevaluate whether an
649 * audit record is still required for this event by
650 * re-calling au_preselect().
652 if (audit_in_failure &&
653 priv_check(td, PRIV_AUDIT_FAILSTOP) != 0) {
654 cv_wait(&audit_fail_cv, &audit_mtx);
655 panic("audit_failing_stop: thread continued");
658 } else if (audit_pipe_preselect(auid, event, class, AU_PRS_BOTH, 0)) {
665 * After audit trails and pipes have made their policy choices, DTrace
666 * may request that records be generated as well. This is a slightly
667 * complex affair, as the DTrace audit provider needs the audit
668 * framework to maintain some state on the audit record, which has not
669 * been allocated at the point where the decision has to be made.
670 * This hook must run even if we are not changing the decision, as
671 * DTrace may want to stick event state onto a record we were going to
672 * produce due to the trail or pipes. The event state returned by the
673 * DTrace provider must be safe without locks held between here and
674 * below -- i.e., dtaudit_state must must refer to stable memory.
677 dtaudit_state = NULL;
678 if (dtaudit_hook_preselect != NULL) {
679 dtaudit_state = dtaudit_hook_preselect(auid, event, class);
680 if (dtaudit_state != NULL)
686 * If a record is required, allocate it and attach it to the thread
687 * for use throughout the system call. Also attach DTrace state if
690 * XXXRW: If we decide to reference count the evname_elem underlying
691 * dtaudit_state, we will need to free here if no record is allocated
695 td->td_ar = audit_new(event, td);
696 if (td->td_ar != NULL) {
697 td->td_pflags |= TDP_AUDITREC;
699 td->td_ar->k_dtaudit_state = dtaudit_state;
707 * audit_syscall_exit() is called from the return of every system call, or in
708 * the event of exit1(), during the execution of exit1(). It is responsible
709 * for committing the audit record, if any, along with return condition.
712 audit_syscall_exit(int error, struct thread *td)
717 * Commit the audit record as desired; once we pass the record into
718 * audit_commit(), the memory is owned by the audit subsystem. The
719 * return value from the system call is stored on the user thread.
720 * If there was an error, the return value is set to -1, imitating
721 * the behavior of the cerror routine.
726 retval = td->td_retval[0];
728 audit_commit(td->td_ar, error, retval);
730 td->td_pflags &= ~TDP_AUDITREC;
734 audit_cred_copy(struct ucred *src, struct ucred *dest)
737 bcopy(&src->cr_audit, &dest->cr_audit, sizeof(dest->cr_audit));
741 audit_cred_destroy(struct ucred *cred)
747 audit_cred_init(struct ucred *cred)
750 bzero(&cred->cr_audit, sizeof(cred->cr_audit));
754 * Initialize audit information for the first kernel process (proc 0) and for
755 * the first user process (init).
758 audit_cred_kproc0(struct ucred *cred)
761 cred->cr_audit.ai_auid = AU_DEFAUDITID;
762 cred->cr_audit.ai_termid.at_type = AU_IPv4;
766 audit_cred_proc1(struct ucred *cred)
769 cred->cr_audit.ai_auid = AU_DEFAUDITID;
770 cred->cr_audit.ai_termid.at_type = AU_IPv4;
774 audit_thread_alloc(struct thread *td)
781 audit_thread_free(struct thread *td)
784 KASSERT(td->td_ar == NULL, ("audit_thread_free: td_ar != NULL"));
785 KASSERT((td->td_pflags & TDP_AUDITREC) == 0,
786 ("audit_thread_free: TDP_AUDITREC set"));
790 audit_proc_coredump(struct thread *td, char *path, int errcode)
792 struct kaudit_record *ar;
793 struct au_mask *aumask;
803 * Make sure we are using the correct preselection mask.
806 auid = cred->cr_audit.ai_auid;
807 if (auid == AU_DEFAUDITID)
808 aumask = &audit_nae_mask;
810 aumask = &cred->cr_audit.ai_mask;
812 * It's possible for coredump(9) generation to fail. Make sure that
813 * we handle this case correctly for preselection.
816 sorf = AU_PRS_FAILURE;
818 sorf = AU_PRS_SUCCESS;
819 class = au_event_class(AUE_CORE);
820 if (au_preselect(AUE_CORE, class, aumask, sorf) == 0 &&
821 audit_pipe_preselect(auid, AUE_CORE, class, sorf, 0) == 0)
825 * If we are interested in seeing this audit record, allocate it.
826 * Where possible coredump records should contain a pathname and arg32
829 ar = audit_new(AUE_CORE, td);
833 pathp = &ar->k_ar.ar_arg_upath1;
834 *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK);
835 audit_canon_path(td, AT_FDCWD, path, *pathp);
836 ARG_SET_VALID(ar, ARG_UPATH1);
838 ar->k_ar.ar_arg_signum = td->td_proc->p_sig;
839 ARG_SET_VALID(ar, ARG_SIGNUM);
842 audit_commit(ar, errcode, ret);