svn commit: r330343 - stable/11/sys/kern

Eitan Adler eadler at FreeBSD.org
Sat Mar 3 18:11:03 UTC 2018


Author: eadler
Date: Sat Mar  3 18:11:02 2018
New Revision: 330343
URL: https://svnweb.freebsd.org/changeset/base/330343

Log:
  MFC r302519:
  
  Audit the file-descriptor number argument for openat(2).  Remove a comment
  about the desirability of auditing the number, as it was in fact in the
  wrong place (in the common path for open(2) and openat(2), and only the
  latter accepts a file-descriptor argument).  Where other ABIs support
  openat(2), it may be necessary to do additional argument auditing as it is
  not performed in kern_openat(9).
  
  MFC after:	3 days

Modified:
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/11/sys/kern/vfs_syscalls.c	Sat Mar  3 17:38:25 2018	(r330342)
+++ stable/11/sys/kern/vfs_syscalls.c	Sat Mar  3 18:11:02 2018	(r330343)
@@ -959,6 +959,7 @@ int
 sys_openat(struct thread *td, struct openat_args *uap)
 {
 
+	AUDIT_ARG_FD(uap->fd);
 	return (kern_openat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag,
 	    uap->mode));
 }
@@ -979,7 +980,6 @@ kern_openat(struct thread *td, int fd, char *path, enu
 
 	AUDIT_ARG_FFLAGS(flags);
 	AUDIT_ARG_MODE(mode);
-	/* XXX: audit dirfd */
 	cap_rights_init(&rights, CAP_LOOKUP);
 	flags_to_rights(flags, &rights);
 	/*


More information about the svn-src-all mailing list