[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220126191441.3380389-2-stsp2@yandex.ru>
Date: Wed, 26 Jan 2022 22:14:40 +0300
From: Stas Sergeev <stsp2@...dex.ru>
To: unlisted-recipients:; (no To-header on input)
Cc: Stas Sergeev <stsp2@...dex.ru>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Kees Cook <keescook@...omium.org>,
Jens Axboe <axboe@...nel.dk>,
Peter Zijlstra <peterz@...radead.org>,
Marco Elver <elver@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Alexey Gladkov <legion@...nel.org>,
Andrew Lutomirski <luto@....edu>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] sigaltstack: ignore flags if SS_DISABLE is set
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 <stsp2@...dex.ru>
CC: "Eric W. Biederman" <ebiederm@...ssion.com>
CC: Kees Cook <keescook@...omium.org>
CC: Jens Axboe <axboe@...nel.dk>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Marco Elver <elver@...gle.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Alexey Gladkov <legion@...nel.org>
CC: Andrew Lutomirski <luto@....edu>
CC: linux-kernel@...r.kernel.org
---
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
Powered by blists - more mailing lists