summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Wise <AustinWise@gmail.com>2018-03-09 09:22:39 +0000
committerTrent Mick <trentm@gmail.com>2018-03-09 09:22:39 +0000
commit504e1b79e7bc5c6cca5f920dea12d6d9eec6e8fb (patch)
tree864de9298a4bfa64e119698fed44e5680d5cd470
parentd40d50dab4b6a89f1e840364a47eeaf2ff7c6195 (diff)
downloadillumos-joyent-504e1b79e7bc5c6cca5f920dea12d6d9eec6e8fb.tar.gz
joyent/illumos-joyent#163 fix stack selection for delivery of Linux signalscr3583-joyent-illumos-joyent-163
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/signal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/signal.c b/usr/src/lib/brand/lx/lx_brand/common/signal.c
index a8e3601cb9..5ae399bcd8 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/signal.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/signal.c
@@ -26,6 +26,7 @@
/*
* Copyright 2018 Joyent, Inc. All rights reserved.
+ * Copyright 2018 Austin Wise <austin@awise.us>
*/
#include <sys/types.h>
@@ -1636,8 +1637,10 @@ lx_sigdeliver(int lx_sig, siginfo_t *sip, ucontext_t *ucp, size_t stacksz,
* stack specified by the user.
*/
newstack = (lxsap->lxsa_flags & LX_SA_ONSTACK) &&
- !(lxtsd->lxtsd_sigaltstack.ss_flags & (LX_SS_ONSTACK |
- LX_SS_DISABLE));
+ !(lxtsd->lxtsd_sigaltstack.ss_flags & LX_SS_DISABLE) &&
+ (orig_sp < (uintptr_t)lxtsd->lxtsd_sigaltstack.ss_sp ||
+ orig_sp >= (uintptr_t)(lxtsd->lxtsd_sigaltstack.ss_sp +
+ lxtsd->lxtsd_sigaltstack.ss_size));
/*
* Find the first unused region of the Linux process stack, where