Re: [PATCH] x86: limit the fs segment to the pointer size

2020-02-02 Thread Bin Meng
On Mon, Feb 3, 2020 at 12:41 PM Bin Meng wrote: > > On Wed, Jan 8, 2020 at 7:14 PM Masahiro Yamada wrote: > > > > The fs segment is only used to get the global data pointer. > > If it is accessed beyond sizeof(new_gd->arch.gd_addr), it is a bug. > > > > To specify the byte-granule limit size,

Re: [PATCH] x86: limit the fs segment to the pointer size

2020-02-02 Thread Bin Meng
On Wed, Jan 8, 2020 at 7:14 PM Masahiro Yamada wrote: > > The fs segment is only used to get the global data pointer. > If it is accessed beyond sizeof(new_gd->arch.gd_addr), it is a bug. > > To specify the byte-granule limit size, drop the G bit, so the > flag field is 0x8093 instead of 0xc093,

Re: [PATCH] x86: limit the fs segment to the pointer size

2020-01-29 Thread Simon Glass
On Wed, 8 Jan 2020 at 04:14, Masahiro Yamada wrote: > > The fs segment is only used to get the global data pointer. > If it is accessed beyond sizeof(new_gd->arch.gd_addr), it is a bug. > > To specify the byte-granule limit size, drop the G bit, so the > flag field is 0x8093 instead of 0xc093,

[PATCH] x86: limit the fs segment to the pointer size

2020-01-08 Thread Masahiro Yamada
The fs segment is only used to get the global data pointer. If it is accessed beyond sizeof(new_gd->arch.gd_addr), it is a bug. To specify the byte-granule limit size, drop the G bit, so the flag field is 0x8093 instead of 0xc093, and set the limit field to sizeof(new_gd->arch.gd_addr) - 1.