Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2009 10:33:52 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Alexander Best <alexbestms@math.uni-muenster.de>
Subject:   Re: linux syscall modify_ldt() returning wrong errno
Message-ID:  <200906261033.52478.jhb@freebsd.org>
In-Reply-To: <permail-20090625222531f0889e840000548e-a_best01@message-id.uni-muenster.de>
References:  <permail-20090625222531f0889e840000548e-a_best01@message-id.uni-muenster.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 25 June 2009 6:25:31 pm Alexander Best wrote:
> hi there,
> 
> i'm currently playing a bit with the linux test project (ltp). it seems the
> linux syscall modify_ldt() isn't implemented correctly. the following code
> should set errno to ENOSYS, but instead EINVAL is being returned:

It looks like this should fix it:

--- //depot/vendor/freebsd/src/sys/i386/linux/linux_machdep.c	2009/02/18 16:15:14
+++ //depot/user/jhb/acpipci/i386/linux/linux_machdep.c	2009/06/26 14:32:55
@@ -866,9 +866,6 @@
 	union descriptor desc;
 	int size, written;
 
-	if (uap->ptr == NULL)
-		return (EINVAL);
-
 	switch (uap->func) {
 	case 0x00: /* read_ldt */
 		ldt.start = 0;
@@ -911,7 +908,7 @@
 		error = i386_set_ldt(td, &ldt, &desc);
 		break;
 	default:
-		error = EINVAL;
+		error = ENOSYS;
 		break;
 	}
 

-- 
John Baldwin



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