ss_flags combo of SS_AUTODISARM|SS_DISABLE can be used to check
the support of SS_AUTODISARM. We need to remove the like flags and
only keep SS_DISABLE because many libraries (eg asan runtime)
check if SAS is disabled by just checking "ss_flags == SS_DISABLE".
Also man page mandates that only 1 flag can be returned, so
returning SS_AUTODISARM|SS_DISABLE should be disallowed.
Signed-off-by: Stas Sergeev <[email protected]>
CC: "Eric W. Biederman" <[email protected]>
CC: Kees Cook <[email protected]>
CC: Jens Axboe <[email protected]>
CC: Peter Zijlstra <[email protected]>
CC: Marco Elver <[email protected]>
CC: Thomas Gleixner <[email protected]>
CC: Alexey Gladkov <[email protected]>
CC: Andrew Lutomirski <[email protected]>
CC: [email protected]
---
kernel/signal.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/signal.c b/kernel/signal.c
index 38602738866e..40634a500317 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -4209,6 +4209,7 @@ do_sigaltstack (const stack_t *ss, stack_t *oss, unsigned long sp,
if (ss_mode == SS_DISABLE) {
ss_size = 0;
ss_sp = NULL;
+ ss_flags = SS_DISABLE;
} else {
if (unlikely(ss_size < min_ss_size))
ret = -ENOMEM;
--
2.34.1