]> git.baikalelectronics.ru Git - uboot.git/commit
x86: limit the fs segment to the pointer size
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 8 Jan 2020 11:13:42 +0000 (20:13 +0900)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 3 Feb 2020 17:19:26 +0000 (01:19 +0800)
commitd1f910377f8e73966deb4320b3beefdfe2a40fe5
tree66c18fd1385f05498c0662821c3a6277e7d72ed9
parent4d082110ff608e966a32421271492385cdc46f09
x86: limit the fs segment to the pointer size

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@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fixed the comments about FS segement]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/i386/cpu.c