2022-01-26 22:34:24

by stsp

[permalink] [raw]
Subject: [PATCH 0/2] sigaltstack: return only one flag

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 <[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: Shuah Khan <[email protected]>
CC: "Chang S. Bae" <[email protected]>
CC: Borislav Petkov <[email protected]>
CC: Thomas Gleixner <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]

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(-)

--
2.34.1