PERFORCE change 125977 for review
Roman Divacky
rdivacky at FreeBSD.org
Sun Sep 2 10:13:13 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=125977
Change 125977 by rdivacky at 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 at 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))
More information about the p4-projects
mailing list