lkml.org 
[lkml]   [2021]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] x86/hw_breakpoint: Add stack_canary to hw_breakpoints denylist
Date
From: Lai Jiangshan <laijs@linux.alibaba.com>

When stack-protector is enabled, entry functions may access
to the stack_canary.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
---
arch/x86/kernel/hw_breakpoint.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index 668a4a6533d9..b2b64afdf9c0 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -315,6 +315,14 @@ static inline bool within_cpu_entry(unsigned long addr, unsigned long end)
if (within_area(addr, end, (unsigned long)&per_cpu(cpu_dr7, cpu),
sizeof(cpu_dr7)))
return true;
+
+ /*
+ * When stack-protector is enabled, entry functions may access
+ * to the stack_canary.
+ */
+ if (within_area(addr, end, (unsigned long)&per_cpu(fixed_percpu_data, cpu),
+ sizeof(struct fixed_percpu_data)))
+ return true;
}

return false;
--
2.19.1.6.gb485710b
\
 
 \ /
  Last update: 2021-12-13 05:23    [W:0.118 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site