Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Sep 2007 17:13:11 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125977 for review
Message-ID:  <200709021713.l82HDBQf035229@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125977

Change 125977 by rdivacky@rdivacky_witten on 2007/09/02 17:12:58

	Implement "read_default_ldt" for linux_modify_ldt(). This just copies out nulled
	descriptor. This helps user-mode linux.
	
	Tested by: "Yuriy Tsibizov" <yuriy.tsibizov@gmail.com>

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_machdep.c#2 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_machdep.c#2 (text+ko) ====

@@ -873,6 +873,8 @@
 	struct i386_ldt_args ldt;
 	struct l_descriptor ld;
 	union descriptor desc;
+	struct l_desc_struct null_desc[5];
+	int size;
 
 	if (uap->ptr == NULL)
 		return (EINVAL);
@@ -885,6 +887,15 @@
 		error = i386_get_ldt(td, &ldt);
 		td->td_retval[0] *= sizeof(union descriptor);
 		break;
+	case 0x02: /* read_default_ldt = 0 */
+		size = 5*sizeof(struct l_desc_struct);
+
+		bzero(null_desc, size);
+		if (size > uap->bytecount)
+			size = uap->bytecount;
+		td->td_retval[0] = size;
+		error = copyout(null_desc, uap->ptr, size);
+		break;
 	case 0x01: /* write_ldt */
 	case 0x11: /* write_ldt */
 		if (uap->bytecount != sizeof(ld))



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