Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144051393
D18361.id51223.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18361.id51223.diff
View Options
Index: sys/kern/kern_sig.c
===================================================================
--- sys/kern/kern_sig.c
+++ sys/kern/kern_sig.c
@@ -615,20 +615,25 @@
}
}
+/*
+ * Returns 1 (true) if altstack is configured for the thread, and the
+ * passed stack bottom address falls into the altstack range. Handles
+ * the 43 compat special case where the alt stack size is zero.
+ */
int
sigonstack(size_t sp)
{
- struct thread *td = curthread;
+ struct thread *td;
- return ((td->td_pflags & TDP_ALTSTACK) ?
+ td = curthread;
+ if ((td->td_pflags & TDP_ALTSTACK) == 0)
+ return (0);
#if defined(COMPAT_43)
- ((td->td_sigstk.ss_size == 0) ?
- (td->td_sigstk.ss_flags & SS_ONSTACK) :
- ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size))
-#else
- ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size)
+ if (td->td_sigstk.ss_size == 0)
+ return ((td->td_sigstk.ss_flags & SS_ONSTACK) != 0);
#endif
- : 0);
+ return (sp >= (size_t)td->td_sigstk.ss_sp &&
+ sp < td->td_sigstk.ss_size + (size_t)td->td_sigstk.ss_sp);
}
static __inline int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 4, 11:07 PM (15 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28438322
Default Alt Text
D18361.id51223.diff (1 KB)
Attached To
Mode
D18361: Improve sigonstack().
Attached
Detach File
Event Timeline
Log In to Comment