modify_ldt.2, set_thread_area.2: Fix type of base_addr

Historically (before Linux 2.6.23), base_addr was unsigned long
for 32-bit code and unsigned int for 64-bit code.  In other words,
it was always a 32-bit value.  When the ldt.h header files were
unified, the type became unsigned int on all systems.  Update
modify_ldt.2 and set_thread_area.2 accordingly.

Indeed, on x86, the GDT and LDT specify 32-bit bases for code and
data segments, and this has nothing to do with the kernel.

Reported-by: "Metzger, Markus T" <markus.t.metzger@intel.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Andy Lutomirski 2019-12-04 12:30:45 -08:00 committed by Michael Kerrisk
parent 36a35d6735
commit 59b191dc04
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ structure is defined in \fI<asm/ldt.h>\fP as:
.EX
struct user_desc {
unsigned int entry_number;
unsigned long base_addr;
unsigned int base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;

View File

@ -67,7 +67,7 @@ to a structure of the following type:
.EX
struct user_desc {
unsigned int entry_number;
unsigned long base_addr;
unsigned int base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;