patch-2.1.20 linux/arch/i386/kernel/ldt.c
Next file: linux/arch/i386/kernel/process.c
Previous file: linux/arch/i386/defconfig
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
Wed Jan 1 16:58:41 1997
- Orig file:
v2.1.19/linux/arch/i386/kernel/ldt.c
- Orig date:
Thu Dec 12 19:36:57 1996
diff -u --recursive --new-file v2.1.19/linux/arch/i386/kernel/ldt.c linux/arch/i386/kernel/ldt.c
@@ -16,7 +16,6 @@
static int read_ldt(void * ptr, unsigned long bytecount)
{
- int error;
void * address = current->ldt;
unsigned long size;
@@ -29,11 +28,7 @@
}
if (size > bytecount)
size = bytecount;
- error = verify_area(VERIFY_WRITE, ptr, size);
- if (error)
- return error;
- copy_to_user(ptr, address, size);
- return size;
+ return copy_to_user(ptr, address, size) ? -EFAULT : size;
}
static inline int limits_ok(struct modify_ldt_ldt_s *ldt_info)
@@ -69,11 +64,9 @@
if (bytecount != sizeof(ldt_info))
return -EINVAL;
- error = verify_area(VERIFY_READ, ptr, sizeof(ldt_info));
+ error = copy_from_user(&ldt_info, ptr, sizeof(ldt_info));
if (error)
- return error;
-
- copy_from_user(&ldt_info, ptr, sizeof(ldt_info));
+ return -EFAULT;
if ((ldt_info.contents == 3 && (oldmode || ldt_info.seg_not_present == 0)) || ldt_info.entry_number >= LDT_ENTRIES)
return -EINVAL;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov