Re: Small bug in arch/i386/boot/pm.c?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Smith wrote:
Hi,

I was looking at this macro in pm.c:

#define GDT_ENTRY(flags,base,limit)             \
        (((u64)(base & 0xff000000) << 32) |     \
         ((u64)flags << 40) |                   \
         ((u64)(limit & 0x00ff0000) << 32) |    \
         ((u64)(base & 0x00ffff00) << 16) |     \
         ((u64)(limit & 0x0000ffff)))

I think it should be:

#define GDT_ENTRY(flags,base,limit)             \
        (((u64)(base & 0xff000000) << 32) |     \
         ((u64)flags << 40) |                   \
         ((u64)(limit & 0x00ff0000) << 32) |    \
         ((u64)(base & 0x00ffffff) << 16) |     \ <----------
         ((u64)(limit & 0x0000ffff)))

The base is 0 in the code so it's OK but I think that if we use a *theoretical* base like 0xffffffff the macro won't set the gdt entry correctly.

Did I miss something?


Nope, that's absolutely correct (and yes, it's a non-manifest bug.)

Do you want to submit a patch?

	-hpa


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux