|
@@ -2335,12 +2335,9 @@ static unsigned long get_segment_base(unsigned int segment)
|
|
|
#ifdef CONFIG_MODIFY_LDT_SYSCALL
|
|
|
struct ldt_struct *ldt;
|
|
|
|
|
|
- if (idx > LDT_ENTRIES)
|
|
|
- return 0;
|
|
|
-
|
|
|
/* IRQs are off, so this synchronizes with smp_store_release */
|
|
|
ldt = lockless_dereference(current->active_mm->context.ldt);
|
|
|
- if (!ldt || idx > ldt->nr_entries)
|
|
|
+ if (!ldt || idx >= ldt->nr_entries)
|
|
|
return 0;
|
|
|
|
|
|
desc = &ldt->entries[idx];
|
|
@@ -2348,7 +2345,7 @@ static unsigned long get_segment_base(unsigned int segment)
|
|
|
return 0;
|
|
|
#endif
|
|
|
} else {
|
|
|
- if (idx > GDT_ENTRIES)
|
|
|
+ if (idx >= GDT_ENTRIES)
|
|
|
return 0;
|
|
|
|
|
|
desc = raw_cpu_ptr(gdt_page.gdt) + idx;
|