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

Simon Glass sjg at chromium.org
Thu Jan 30 03:17:17 CET 2020


On Wed, 8 Jan 2020 at 04:14, Masahiro Yamada <masahiroy at kernel.org> 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, and set the limit field
> to sizeof(new_gd->arch.gd_addr) - 1.
>
> Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
> ---
>
>  arch/x86/cpu/i386/cpu.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list