Skip to content
Snippets Groups Projects
Commit 232486e1 authored by David S. Miller's avatar David S. Miller
Browse files

sparc64: Tighten checks in kstack_valid().


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: default avatarDavid S. Miller <davem@davemloft.net>
parent 440ab7ac
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment