Unverified Commit 679c6764 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11106 CVE-2024-43868

Merge Pull Request from: @ci-robot 
 
PR sync from: Yuntao Liu <liuyuntao12@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I5V5JOIT5XMCYHGBC2AZN3BZ33AG63ZI/ 
CVE-2024-43868

Clément Léger (1):
  riscv: Use SYM_*() assembly macros instead of deprecated ones

Daniel Maslowski (1):
  riscv/purgatory: align riscv_kernel_entry


-- 
2.34.1
 
https://gitee.com/src-openeuler/kernel/issues/IALCQL 
 
Link:https://gitee.com/openeuler/kernel/pulls/11106

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents e80cd374 37b5257b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
/* void __riscv_copy_words_unaligned(void *, const void *, size_t) */
/* Performs a memcpy without aligning buffers, using word loads and stores. */
/* Note: The size is truncated to a multiple of 8 * SZREG */
ENTRY(__riscv_copy_words_unaligned)
SYM_FUNC_START(__riscv_copy_words_unaligned)
	andi  a4, a2, ~((8*SZREG)-1)
	beqz  a4, 2f
	add   a3, a1, a4
@@ -36,12 +36,12 @@ ENTRY(__riscv_copy_words_unaligned)

2:
	ret
END(__riscv_copy_words_unaligned)
SYM_FUNC_END(__riscv_copy_words_unaligned)

/* void __riscv_copy_bytes_unaligned(void *, const void *, size_t) */
/* Performs a memcpy without aligning buffers, using only byte accesses. */
/* Note: The size is truncated to a multiple of 8 */
ENTRY(__riscv_copy_bytes_unaligned)
SYM_FUNC_START(__riscv_copy_bytes_unaligned)
	andi a4, a2, ~(8-1)
	beqz a4, 2f
	add  a3, a1, a4
@@ -68,4 +68,4 @@ ENTRY(__riscv_copy_bytes_unaligned)

2:
	ret
END(__riscv_copy_bytes_unaligned)
SYM_FUNC_END(__riscv_copy_bytes_unaligned)
+4 −4
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <asm/csr.h>
#include <asm/asm-offsets.h>

ENTRY(__fstate_save)
SYM_FUNC_START(__fstate_save)
	li  a2,  TASK_THREAD_F0
	add a0, a0, a2
	li t1, SR_FS
@@ -60,9 +60,9 @@ ENTRY(__fstate_save)
	sw t0, TASK_THREAD_FCSR_F0(a0)
	csrc CSR_STATUS, t1
	ret
ENDPROC(__fstate_save)
SYM_FUNC_END(__fstate_save)

ENTRY(__fstate_restore)
SYM_FUNC_START(__fstate_restore)
	li  a2,  TASK_THREAD_F0
	add a0, a0, a2
	li t1, SR_FS
@@ -103,4 +103,4 @@ ENTRY(__fstate_restore)
	fscsr t0
	csrc CSR_STATUS, t1
	ret
ENDPROC(__fstate_restore)
SYM_FUNC_END(__fstate_restore)
+6 −6
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include "efi-header.S"

__HEAD
ENTRY(_start)
SYM_CODE_START(_start)
	/*
	 * Image header expected by Linux boot-loaders. The image header data
	 * structure is described in asm/image.h.
@@ -192,9 +192,9 @@ setup_trap_vector:
	wfi
	j .Lsecondary_park

END(_start)
SYM_CODE_END(_start)

ENTRY(_start_kernel)
SYM_CODE_START(_start_kernel)
	/* Mask all interrupts */
	csrw CSR_IE, zero
	csrw CSR_IP, zero
@@ -354,10 +354,10 @@ clear_bss_done:
	tail .Lsecondary_start_common
#endif /* CONFIG_RISCV_BOOT_SPINWAIT */

END(_start_kernel)
SYM_CODE_END(_start_kernel)

#ifdef CONFIG_RISCV_M_MODE
ENTRY(reset_regs)
SYM_CODE_START_LOCAL(reset_regs)
	li	sp, 0
	li	gp, 0
	li	tp, 0
@@ -455,5 +455,5 @@ ENTRY(reset_regs)
.Lreset_regs_done_vector:
#endif /* CONFIG_RISCV_ISA_V */
	ret
END(reset_regs)
SYM_CODE_END(reset_regs)
#endif /* CONFIG_RISCV_M_MODE */
+6 −6
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
 *
 * Always returns 0
 */
ENTRY(__hibernate_cpu_resume)
SYM_FUNC_START(__hibernate_cpu_resume)
	/* switch to hibernated image's page table. */
	csrw CSR_SATP, s0
	sfence.vma
@@ -34,7 +34,7 @@ ENTRY(__hibernate_cpu_resume)
	mv	a0, zero

	ret
END(__hibernate_cpu_resume)
SYM_FUNC_END(__hibernate_cpu_resume)

/*
 * Prepare to restore the image.
@@ -42,7 +42,7 @@ END(__hibernate_cpu_resume)
 * a1: satp of temporary page tables.
 * a2: cpu_resume.
 */
ENTRY(hibernate_restore_image)
SYM_FUNC_START(hibernate_restore_image)
	mv	s0, a0
	mv	s1, a1
	mv	s2, a2
@@ -50,7 +50,7 @@ ENTRY(hibernate_restore_image)
	REG_L	a1, relocated_restore_code

	jr	a1
END(hibernate_restore_image)
SYM_FUNC_END(hibernate_restore_image)

/*
 * The below code will be executed from a 'safe' page.
@@ -58,7 +58,7 @@ END(hibernate_restore_image)
 * back to the original memory location. Finally, it jumps to __hibernate_cpu_resume()
 * to restore the CPU context.
 */
ENTRY(hibernate_core_restore_code)
SYM_FUNC_START(hibernate_core_restore_code)
	/* switch to temp page table. */
	csrw satp, s1
	sfence.vma
@@ -73,4 +73,4 @@ ENTRY(hibernate_core_restore_code)
	bnez	s4, .Lcopy

	jr	s2
END(hibernate_core_restore_code)
SYM_FUNC_END(hibernate_core_restore_code)
+8 −12
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@
	.endm
#endif /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */

ENTRY(ftrace_caller)
SYM_FUNC_START(ftrace_caller)
	SAVE_ABI

	addi	a0, t0, -FENTRY_RA_OFFSET
@@ -91,8 +91,7 @@ ENTRY(ftrace_caller)
	mv	a1, ra
	mv	a3, sp

ftrace_call:
	.global ftrace_call
SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL)
	call	ftrace_stub

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
@@ -102,16 +101,15 @@ ftrace_call:
#ifdef HAVE_FUNCTION_GRAPH_FP_TEST
	mv	a2, s0
#endif
ftrace_graph_call:
	.global ftrace_graph_call
SYM_INNER_LABEL(ftrace_graph_call, SYM_L_GLOBAL)
	call	ftrace_stub
#endif
	RESTORE_ABI
	jr t0
ENDPROC(ftrace_caller)
SYM_FUNC_END(ftrace_caller)

#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
ENTRY(ftrace_regs_caller)
SYM_FUNC_START(ftrace_regs_caller)
	SAVE_ALL

	addi	a0, t0, -FENTRY_RA_OFFSET
@@ -120,8 +118,7 @@ ENTRY(ftrace_regs_caller)
	mv	a1, ra
	mv	a3, sp

ftrace_regs_call:
	.global ftrace_regs_call
SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
	call	ftrace_stub

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
@@ -131,12 +128,11 @@ ftrace_regs_call:
#ifdef HAVE_FUNCTION_GRAPH_FP_TEST
	mv	a2, s0
#endif
ftrace_graph_regs_call:
	.global ftrace_graph_regs_call
SYM_INNER_LABEL(ftrace_graph_regs_call, SYM_L_GLOBAL)
	call	ftrace_stub
#endif

	RESTORE_ALL
	jr t0
ENDPROC(ftrace_regs_caller)
SYM_FUNC_END(ftrace_regs_caller)
#endif /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */
Loading