projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
440ab7a
)
sparc64: Tighten checks in kstack_valid().
author
David S. Miller
<davem@davemloft.net>
Fri, 12 Feb 2010 20:03:45 +0000
(12:03 -0800)
committer
David S. Miller
<davem@davemloft.net>
Fri, 12 Feb 2010 20:03:45 +0000
(12:03 -0800)
The kernel stack pointer is invalid if it is not 16-byte
aligned.
Based upon a report by Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/kstack.h
patch
|
blob
|
blame
|
history
diff --git
a/arch/sparc/kernel/kstack.h
b/arch/sparc/kernel/kstack.h
index 4248d969272f1f92a7470a15bc631c72bd628f24..5247283d1c03e57c94d40ebfea4074cdf7db3100 100644
(file)
--- a/
arch/sparc/kernel/kstack.h
+++ b/
arch/sparc/kernel/kstack.h
@@
-11,6
+11,10
@@
static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
{
unsigned long base = (unsigned long) tp;
+ /* Stack pointer must be 16-byte aligned. */
+ if (sp & (16UL - 1))
+ return false;
+
if (sp >= (base + sizeof(struct thread_info)) &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;