Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Nov 2018 21:01:16 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340302 - in head/sys: compat/freebsd32 kern
Message-ID:  <201811092101.wA9L1GnW012710@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Fri Nov  9 21:01:16 2018
New Revision: 340302
URL: https://svnweb.freebsd.org/changeset/base/340302

Log:
  Fix freebsd32 mknod(at).
  
  As dev_t is now a 64-bit integer, it requires special handling as a
  system call argument.  64-bit arguments are split between two 64-bit
  integers due to the way arguments are promoted to allow reuse of most
  system call implementations.  They must be reassembled before use.
  Further, 64-bit arguments at an odd offset (counting from zero) are
  padded and slid to the next slot on powerpc and mips.  Fix the
  non-COMPAT11 system call by adding a freebsd32_mknodat() and
  appropriately padded declerations.
  
  The COMPAT11 system calls are fully compatible with the 64-bit
  implementations so remove the freebsd32_ versions.
  
  Use uint32_t consistently as the type of the old dev_t.  This matches
  the old definition.
  
  Reviewed by:	kib
  MFC after:	3 days
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D17928

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  9 20:33:38 2018	(r340301)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  9 21:01:16 2018	(r340302)
@@ -463,25 +463,14 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_
 	return (error);
 }
 
-#if defined(COMPAT_FREEBSD11)
-int
-freebsd11_freebsd32_mknod(struct thread *td,
-    struct freebsd11_freebsd32_mknod_args *uap)
-{
 
-	return (kern_mknodat(td, AT_FDCWD, uap->path, UIO_USERSPACE, uap->mode,
-	    uap->dev));
-}
-
 int
-freebsd11_freebsd32_mknodat(struct thread *td,
-    struct freebsd11_freebsd32_mknodat_args *uap)
+freebsd32_mknodat(struct thread *td, struct freebsd32_mknodat_args *uap)
 {
 
-	return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode,
-	    uap->dev));
+	return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE,
+	    uap->mode, PAIR32TO64(dev_t, uap->dev)));
 }
-#endif /* COMPAT_FREEBSD11 */
 
 int
 freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap)

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master	Fri Nov  9 20:33:38 2018	(r340301)
+++ head/sys/compat/freebsd32/syscalls.master	Fri Nov  9 21:01:16 2018	(r340302)
@@ -84,8 +84,8 @@
 11	AUE_NULL	OBSOL	execv
 12	AUE_CHDIR	NOPROTO	{ int chdir(const char *path); }
 13	AUE_FCHDIR	NOPROTO	{ int fchdir(int fd); }
-14	AUE_MKNOD	COMPAT11 { int freebsd32_mknod(const char *path, \
-					int mode, int dev); }
+14	AUE_MKNOD	COMPAT11|NOPROTO { int mknod(const char *path, \
+					int mode, uint32_t dev); }
 15	AUE_CHMOD	NOPROTO	{ int chmod(const char *path, mode_t mode); }
 16	AUE_CHOWN	NOPROTO	{ int chown(const char *path, int uid, int gid); }
 17	AUE_NULL	NOPROTO	{ void *break(char *nsize); }
@@ -958,7 +958,7 @@
 				    mode_t mode); }
 497	AUE_MKFIFOAT	NOPROTO	{ int mkfifoat(int fd, const char *path, \
 				    mode_t mode); }
-498	AUE_MKNODAT	COMPAT11 { int freebsd32_mknodat(int fd, \
+498	AUE_MKNODAT	COMPAT11|NOPROTO { int mknodat(int fd, \
 				    const char *path, mode_t mode, \
 				    uint32_t dev); }
 499	AUE_OPENAT_RWTC	NOPROTO	{ int openat(int fd, const char *path, \
@@ -1113,8 +1113,15 @@
 				    long bufsize, int mode); }
 558	AUE_FHSTATFS	NOPROTO	{ int fhstatfs(const struct fhandle *u_fhp, \
 				    struct statfs32 *buf); }
-559	AUE_MKNODAT	NOPROTO	{ int mknodat(int fd, const char *path, \
-				    mode_t mode, dev_t dev); }
+#ifdef PAD64_REQUIRED
+559	AUE_MKNODAT	STD	{ int freebsd32_mknodat(int fd, \
+				    const char *path, mode_t mode, \
+				    int pad, uint32_t dev1, uint32_t dev2); }
+#else
+559	AUE_MKNODAT	STD	{ int freebsd32_mknodat(int fd, \
+				    const char *path, mode_t mode, \
+				    uint32_t dev1, uint32_t dev2); }
+#endif
 560	AUE_KEVENT	STD	{ int freebsd32_kevent(int fd, \
 				    const struct kevent32 *changelist, \
 				    int nchanges, \

Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master	Fri Nov  9 20:33:38 2018	(r340301)
+++ head/sys/kern/syscalls.master	Fri Nov  9 21:01:16 2018	(r340302)
@@ -163,7 +163,7 @@
 		int mknod(
 		    _In_z_ const char *path,
 		    int mode,
-		    int dev
+		    uint32_t dev
 		);
 	}
 15	AUE_CHMOD	STD {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811092101.wA9L1GnW012710>