提交 6700224f 编写于 作者: R Russell King (Oracle) 提交者: Yongqiang Liu

ARM: use LOADADDR() to get load address of sections

stable inclusion
from stable-v4.19.234
commit 67e1f18a972be16363c6e88d7b29cde880774164
category: bugfix
bugzilla: 186460, https://gitee.com/src-openeuler/kernel/issues/I53MHA
CVE: CVE-2022-23960

--------------------------------

commit 8d9d651f upstream.

Use the linker's LOADADDR() macro to get the load address of the
sections, and provide a macro to set the start and end symbols.
Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NLiao Chang <liaochang1@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 abcacb28
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
#define ARM_MMU_DISCARD(x) x #define ARM_MMU_DISCARD(x) x
#endif #endif
/* Set start/end symbol names to the LMA for the section */
#define ARM_LMA(sym, section) \
sym##_start = LOADADDR(section); \
sym##_end = LOADADDR(section) + SIZEOF(section)
#define PROC_INFO \ #define PROC_INFO \
. = ALIGN(4); \ . = ALIGN(4); \
__proc_info_begin = .; \ __proc_info_begin = .; \
...@@ -100,19 +105,19 @@ ...@@ -100,19 +105,19 @@
* only thing that matters is their relative offsets * only thing that matters is their relative offsets
*/ */
#define ARM_VECTORS \ #define ARM_VECTORS \
__vectors_start = .; \ __vectors_lma = .; \
.vectors 0xffff0000 : AT(__vectors_start) { \ .vectors 0xffff0000 : AT(__vectors_start) { \
*(.vectors) \ *(.vectors) \
} \ } \
. = __vectors_start + SIZEOF(.vectors); \ ARM_LMA(__vectors, .vectors); \
__vectors_end = .; \ . = __vectors_lma + SIZEOF(.vectors); \
\ \
__stubs_start = .; \ __stubs_lma = .; \
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { \ .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) { \
*(.stubs) \ *(.stubs) \
} \ } \
. = __stubs_start + SIZEOF(.stubs); \ ARM_LMA(__stubs, .stubs); \
__stubs_end = .; \ . = __stubs_lma + SIZEOF(.stubs); \
\ \
PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors)); PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册