lkml.org 
[lkml]   [2009]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] consider stack access while checking for alternate signal stack
Date
AFAICT all you want is the following, and I'm not sure it requires all that
much explanation. I've probably missed some subtlety.


Thanks,
Roland

--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2090,7 +2090,13 @@ static inline int is_si_special(const struct siginfo *info)

static inline int on_sig_stack(unsigned long sp)
{
- return (sp - current->sas_ss_sp < current->sas_ss_size);
+#ifdef CONFIG_STACK_GROWSUP
+ return sp >= current->sas_ss_sp &&
+ sp - current->sas_ss_sp < current->sas_ss_size;
+#else
+ return sp > current->sas_ss_sp &&
+ sp - current->sas_ss_sp <= current->sas_ss_size;
+#endif
}


\
 
 \ /
  Last update: 2009-10-19 20:11    [W:0.055 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site