Index: sys/security/audit/audit.c =================================================================== --- sys/security/audit/audit.c +++ sys/security/audit/audit.c @@ -242,6 +242,14 @@ bzero(ar, sizeof(*ar)); ar->k_ar.ar_magic = AUDIT_RECORD_MAGIC; nanotime(&ar->k_ar.ar_starttime); + /* + * In a situation where the syscalls like execve(2) and fexecve(2) + * don't have any return status, audit record can possibly be mis- + * leading. Better to intialize ar_errno and ar_retval so as to avoid + * such a situation. + */ + ar->k_ar.ar_errno = 0; + ar->k_ar.ar_retval = 0; /* * Export the subject credential.