Subject: linux compat mknod(2) bogon
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 12/17/2002 21:44:26
Hi folks,

In linux_sys_mknod(), we seem to go to the trouble of hand-crafting a
native syscall args struct then happily ignore it (for both the mknod
and mkfifo case).  Does the following diff look right?

Simon.
--
Simon Burge                                   <simonb@wasabisystems.com>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/


Index: compat/linux/common/linux_file.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/linux/common/linux_file.c,v
retrieving revision 1.54
diff -d -p -u -u -6 -r1.54 linux_file.c
--- compat/linux/common/linux_file.c	2002/12/11 19:30:39	1.54
+++ compat/linux/common/linux_file.c	2002/12/17 10:42:15
@@ -684,26 +684,26 @@ linux_sys_mknod(p, v, retval)
 	 */
 	if (SCARG(uap, mode) & S_IFIFO) {
 		struct sys_mkfifo_args bma;
 
 		SCARG(&bma, path) = SCARG(uap, path);
 		SCARG(&bma, mode) = SCARG(uap, mode);
-		return sys_mkfifo(p, uap, retval);
+		return sys_mkfifo(p, &bma, retval);
 	} else {
 		struct sys_mknod_args bma;
 
 		SCARG(&bma, path) = SCARG(uap, path);
 		SCARG(&bma, mode) = SCARG(uap, mode);
 		/*
 		 * Linux device numbers uses 8 bits for minor and 8 bits
 		 * for major. Due to how we map our major and minor,
 		 * this just fints into our dev_t. Just mask off the
 		 * upper 16bit to remove any random junk.
 		 */
 		SCARG(&bma, dev) = SCARG(uap, dev) & 0xffff;
-		return sys_mknod(p, uap, retval);
+		return sys_mknod(p, &bma, retval);
 	}
 }
 
 int
 linux_sys_chmod(p, v, retval)
 	struct proc *p;