Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1868604iog; Thu, 16 Jun 2022 16:02:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s1WALCj83FxeroCJAuyy7GlqbAtvJIpQmN+9bmVAqzrEsDsT+j7q8bdPO7HHLeRzf0myQc X-Received: by 2002:a63:68c4:0:b0:3fb:984f:6779 with SMTP id d187-20020a6368c4000000b003fb984f6779mr6582700pgc.444.1655420535433; Thu, 16 Jun 2022 16:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655420535; cv=none; d=google.com; s=arc-20160816; b=Pd7xWzm8qBRBJk387ebpE/EMnsXhuaX/I1vOwzHbDQ7Nxjk2YFfzeFHipNfEceZiCO wOUykLJH7qucPb8MrplOl1Yob39wVdRKa082HIUNdCBRawXJTKeuD2mv+6P2Yr1FBsx+ 9xIu+ho6DmcHDafQ2h7eCtxTsc52SOIeicgaXXAsjGIMbZOBvggc8I8xHAJ0uLIa1Cb2 1JdvuYAgSYLrEbGdv1QVtPXEBczhx8d/PGcFVrTCxpBNKN2LdSJ6igLQRRVGrutQ9cYJ nGTYQgH4sH2xgbDvbU+Erlh6E+hZXtzb5h8BgyprQWgFWDzrZWIoNrVIdge1qw/d/f1O RzJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GM+MxIdk9slM5wjdPHD9Zax+Dsa/pID19o6T4nwKFOY=; b=fIsV3ak3ojbVWgzJXOEZawr/0+BhTmOikKQqkrfKoCSDemGelYzEZYA0i4aHtMcHsE bU6L91lHYkt5oOyZqUQ/ZmZ7Denn+xZovUJpBASpXRdHQAHBYjw0PYOwSn4wOP3TM+KH BJodLbb2+kmV/ZNOfkBcCwk5gLwttx9CIemtOHmCySJBYFTa+76rTvRRfl+nv8BlQDP4 hdFAxa2SjUV9CZRs23aUZT9zVOymOl+kYIFZenwy04pggI8PK8Qw6+1LnaOQVM+s4yNd kYWlEfxSHtUFPRqMSHpkhMp/IS0Nc1IQWW0qTFWnRly5a01hed6Q+1vDkP35c1JceGIx 9YeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=AdJKbDYj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a63ef09000000b00408cab62ca2si4061201pgh.152.2022.06.16.16.02.01; Thu, 16 Jun 2022 16:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=AdJKbDYj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378914AbiFPWrs (ORCPT + 99 others); Thu, 16 Jun 2022 18:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379091AbiFPWri (ORCPT ); Thu, 16 Jun 2022 18:47:38 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D0F012774 for ; Thu, 16 Jun 2022 15:47:36 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id q11so3499291oih.10 for ; Thu, 16 Jun 2022 15:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GM+MxIdk9slM5wjdPHD9Zax+Dsa/pID19o6T4nwKFOY=; b=AdJKbDYjyOsot33Mt5w2UgXp5E4FLRH4NkzxBwxPiPtcjG2oX+cnUys4Q6R518FkGs jfrSh2msjbfDnnVQvq1MPQk3EcamkjY62ZNWlHlWXaJF5Sez/ZSk0AW3/ig1FajhibDb rBr+oz6HJTMU27pUb0lEe61u6Fk7Maah4z/+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GM+MxIdk9slM5wjdPHD9Zax+Dsa/pID19o6T4nwKFOY=; b=Z9zEThTN2essh7nYJMQwGoajQEk4i1vDnKqSw3H4O9H/flyuNgJKy372uguGp4zPJq STq/V09wd8Y3detUzw8KXdSYjnoGXN6Vg5iTdrLyODxuNoxYGhh1DfsG9zZ//VQOffWc govcY82+XX0FVYICrIXZkdijR52MnCS/usHReGIhrAKvO9NXmEltQjHZ0JMkochSOEi1 583Al5eIK/svzUAsxhtTVMebbQtyOrusdg4awgmkiAOOvXLqxbPAKoDoMLz+6TZNbazS efm7g1C0uIUYE27AUJDwYkiM/us5FpLVfwJyYyeFARlpJzdGc3EeMue83Lj7hDQWOgza uFFw== X-Gm-Message-State: AJIora9DjbKa25/3cS0eabOE+Yyms9qc0UL/1N59r1EJXGcSM9Npa3oa 8bcQ+UypIskyd/cak5WQ592rAw== X-Received: by 2002:a05:6808:1b12:b0:32e:6c9f:fb13 with SMTP id bx18-20020a0568081b1200b0032e6c9ffb13mr3680171oib.172.1655419655747; Thu, 16 Jun 2022 15:47:35 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id l3-20020a4aa783000000b0041bc35464e0sm1719359oom.0.2022.06.16.15.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jun 2022 15:47:35 -0700 (PDT) Subject: Re: [PATCH 1/2] selftests/x86/signal: Adjust the test to the kernel's altstack check To: "Chang S. Bae" , linux-kselftest@vger.kernel.org, shuah@kernel.org, linux-kernel@vger.kernel.org Cc: dave.hansen@linux.intel.com, tglx@linutronix.de, bp@suse.de, Shuah Khan References: <20220401221014.13556-1-chang.seok.bae@intel.com> <20220401221014.13556-2-chang.seok.bae@intel.com> From: Shuah Khan Message-ID: <8b3eb12a-a962-a17e-04d4-7121d751504b@linuxfoundation.org> Date: Thu, 16 Jun 2022 16:47:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220401221014.13556-2-chang.seok.bae@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/1/22 4:10 PM, Chang S. Bae wrote: > The test assumes an insufficient altstack is allowed. Then it raises a > signal to test the delivery failure due to an altstack overflow. > > The kernel now provides an option to tweak sigaltstack()'s sanity check to > prevent an insufficient altstack. ENOMEM is returned on the check failure. > > Adjust the code to skip the test when this option is on. Mention the option name here and in the Skip message. > > Signed-off-by: Chang S. Bae > Cc: linux-kselftest@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > tools/testing/selftests/x86/sigaltstack.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/x86/sigaltstack.c b/tools/testing/selftests/x86/sigaltstack.c > index f689af75e979..22a88b764a8e 100644 > --- a/tools/testing/selftests/x86/sigaltstack.c > +++ b/tools/testing/selftests/x86/sigaltstack.c > @@ -88,8 +88,18 @@ static void sigalrm(int sig, siginfo_t *info, void *ctx_void) > > static void test_sigaltstack(void *altstack, unsigned long size) > { > - if (setup_altstack(altstack, size)) > + if (setup_altstack(altstack, size)) { > + /* > + * The kernel may return ENOMEM when the altstack size > + * is insufficient. Skip the test in this case. > + */ > + if (errno == ENOMEM && size < at_minstack_size) { > + printf("[SKIP]\tThe running kernel disallows an insufficient size.\n"); Please improve this message to clearly why it is okay to skip the test. Mention that the option to disallowing insufficient is enabled and that the test can't be run. > + return; > + } > + > err(1, "sigaltstack()"); > + } > > sigalrm_expected = (size > at_minstack_size) ? true : false; > > With these changes: Reviewed-by: Shuah Khan thanks, -- Shuah