| Submitter | David Miller |
|---|---|
| Date | Feb. 12, 2010, 8:03 p.m. |
| Message ID | <20100212.120307.19150137.davem@davemloft.net> |
| Download | mbox | patch |
| Permalink | /patch/45209/ |
| State | Accepted |
| Delegated to: | David Miller |
| Headers | show |
Comments
Patch
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h index 4248d96..5247283 100644 --- 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;