mbox series

[0/2] sigaltstack: return only one flag

Message ID 20220126191441.3380389-1-stsp2@yandex.ru (mailing list archive)
Headers show
Series sigaltstack: return only one flag | expand

Message

stsp Jan. 26, 2022, 7:14 p.m. UTC
Currently sigaltstack() can return multiple flags, for example
SS_DISABLE|SS_AUTODISARM. This confuses libraries (including asan
runtime) and contradicts the man page.

Patch 1 fixes this problem by ignoring any flag passed with SS_DISABLE.
Patch 2 adds a test-case for that scenario.

Signed-off-by: Stas Sergeev <stsp2@yandex.ru>
CC: "Eric W. Biederman" <ebiederm@xmission.com>
CC: Kees Cook <keescook@chromium.org>
CC: Jens Axboe <axboe@kernel.dk>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Marco Elver <elver@google.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Alexey Gladkov <legion@kernel.org>
CC: Andrew Lutomirski <luto@mit.edu>
CC: Shuah Khan <shuah@kernel.org>
CC: "Chang S. Bae" <chang.seok.bae@intel.com>
CC: Borislav Petkov <bp@suse.de>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Len Brown <len.brown@intel.com>
CC: linux-kselftest@vger.kernel.org
CC: linux-kernel@vger.kernel.org

Stas Sergeev (2):
  sigaltstack: ignore flags if SS_DISABLE is set
  selftests: sigaltstack: add new SS_DISABLE test

 kernel/signal.c                           |  1 +
 tools/testing/selftests/sigaltstack/sas.c | 48 ++++++++++++-----------
 2 files changed, 26 insertions(+), 23 deletions(-)