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

!8675 [sync] PR-8534: riscv: process: Fix kernel gp leakage

parents d37d966a e671b34a
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
#include <asm/switch_to.h>
#include <asm/thread_info.h>

register unsigned long gp_in_global __asm__("gp");

#ifdef CONFIG_STACKPROTECTOR
#include <linux/stackprotector.h>
unsigned long __stack_chk_guard __read_mostly;
@@ -115,7 +113,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,
	if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
		/* Kernel thread */
		memset(childregs, 0, sizeof(struct pt_regs));
		childregs->gp = gp_in_global;
		/* Supervisor/Machine, irqs on: */
		childregs->status = SR_PP | SR_PIE;