Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5541417pxb; Wed, 26 Jan 2022 14:34:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPH3OuxdnF1lRVg9GY1W2cyn71l4ZRsowf2RNiuiZsEbGCtUvZK/oahZtpGC+n+bcoKbWa X-Received: by 2002:a17:906:5d0f:: with SMTP id g15mr632285ejt.751.1643236464376; Wed, 26 Jan 2022 14:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236464; cv=none; d=google.com; s=arc-20160816; b=aio2fHmBdyASf1jbrQvG3FUm6ozAydB7yNGTqOzbYIH5hm8XkNhCBmF+GMBHjfUggH vJQQGoRWGI5MZ4sVd3vOobLZRb09e70m9U4fnzQWGBa0ymU6b4cL1zC4/faqHwxPb/eo a1SZM0Fgtyxtdk13FibbA8BsXBaKEO6MRKXllVckXF7SuQPKNp2e4h4t0m1JzYlt9XBy PO54OXsStZKeiFQrfYs2WJ5jFUHLOfv7v1CuWDrdsVraWhR3mnThHZwXRvZ8/z/Koh+z nHAZhcg4mt72AkRGbs6MfFE0l8+XJg126bggrphoFOWm7HgVZGJHjmJ0sQkhfMMYB5Ha imTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=O+b5CapC7L3M523CZMVUm6J5g7pUFdehbp9UOnOr/xk=; b=D/Isnfqnig4rpTq2ljjEwFRFMgOrMyFi9xhsFsmAFYV3nPeQhewr/oiW8QnRRsLqry x9PyYPi0QE6u2MWXW0DYaz3uoruIquXKmeNCzm+zARyvfvKYu+IRHcxnyFuR/8bDmFrv srl7FfPMgeSj7EyQt0E7zlT1VZlh8qNM1wOSp8iYPnpqjOLcDUYfym88URZLZZwIwoxL BEz5lw6c7Wsp2ptwaUA0ajxlhBaHdo5v2p/IynAz9QZ/hFT/c6CwBL0kgdPt//6LHbRO 4wJZXT75f4lDaoaBihmoi6xqQzjMhkCGc22QW90RUtG7Sto1o9k+RmmcfUFpYxZr6nNF N/Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@yandex.ru header.s=mail header.b=E9n8Iml8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs41si258154ejc.489.2022.01.26.14.33.59; Wed, 26 Jan 2022 14:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@yandex.ru header.s=mail header.b=E9n8Iml8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244444AbiAZTXR (ORCPT + 99 others); Wed, 26 Jan 2022 14:23:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244438AbiAZTXQ (ORCPT ); Wed, 26 Jan 2022 14:23:16 -0500 X-Greylist: delayed 485 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 26 Jan 2022 11:23:15 PST Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::602]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA6FCC061747; Wed, 26 Jan 2022 11:23:15 -0800 (PST) Received: from sas1-bdc74852af75.qloud-c.yandex.net (sas1-bdc74852af75.qloud-c.yandex.net [IPv6:2a02:6b8:c14:49b:0:640:bdc7:4852]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 642256FF805C; Wed, 26 Jan 2022 22:15:05 +0300 (MSK) Received: from sas1-1f4a002bb12a.qloud-c.yandex.net (sas1-1f4a002bb12a.qloud-c.yandex.net [2a02:6b8:c14:3908:0:640:1f4a:2b]) by sas1-bdc74852af75.qloud-c.yandex.net (mxback/Yandex) with ESMTP id JlJu1nJfOU-F4cOTLG1; Wed, 26 Jan 2022 22:15:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1643224505; bh=O+b5CapC7L3M523CZMVUm6J5g7pUFdehbp9UOnOr/xk=; h=Date:Subject:To:From:Message-Id:Cc; b=E9n8Iml8+ZHxoa+BXBTJos6Ccp1DizV9JZ8zcd2KXVUdGL2hvYFvhQksyriGFd/X6 4KM8cyqY4/v95sEXDrc5DXUinnWKZDewTaXIaD+Wfjjf2K4UbXsBmkYh4e1h5N/xz3 dr5PYAQbgeDtQyRXrgnXCx8TPtIzwZjIR9nVxCqo= Authentication-Results: sas1-bdc74852af75.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas1-1f4a002bb12a.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id vdrU00sr04-F3IGAhXh; Wed, 26 Jan 2022 22:15:03 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Fwd: 2 From: Stas Sergeev Cc: Stas Sergeev , "Eric W. Biederman" , Kees Cook , Jens Axboe , Peter Zijlstra , Marco Elver , Thomas Gleixner , Alexey Gladkov , Andrew Lutomirski , Shuah Khan , "Chang S. Bae" , Borislav Petkov , Len Brown , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] sigaltstack: return only one flag Date: Wed, 26 Jan 2022 22:14:39 +0300 Message-Id: <20220126191441.3380389-1-stsp2@yandex.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 CC: "Eric W. Biederman" CC: Kees Cook CC: Jens Axboe CC: Peter Zijlstra CC: Marco Elver CC: Thomas Gleixner CC: Alexey Gladkov CC: Andrew Lutomirski CC: Shuah Khan CC: "Chang S. Bae" CC: Borislav Petkov CC: Thomas Gleixner CC: Len Brown 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(-) -- 2.34.1