From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06162C49ED7 for ; Mon, 16 Sep 2019 16:37:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7BE821852 for ; Mon, 16 Sep 2019 16:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568651837; bh=A4EC8rYENbB35cqZcR/Jp9eGTrxiDPiBK2ZwBJAd0RY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=LCgxiPPtK25eIdpXf04n2t4AY7Fd58YqJVDSARLMG3IiXpbcd5B0eAKDz9Xyf29Tf hZhzfAFnHvRwJK0CGZcVY4egW1T7+X6S9wcuvUfSJOEm3M8VFEUePRzuW+09KOV1R2 dD0ZOBQu5KozQCTPKeC6V9XttmRjdI2tjXXgZR00= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387415AbfIPQhR (ORCPT ); Mon, 16 Sep 2019 12:37:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:34770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbfIPQhR (ORCPT ); Mon, 16 Sep 2019 12:37:17 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BB7D214D9; Mon, 16 Sep 2019 16:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568651836; bh=A4EC8rYENbB35cqZcR/Jp9eGTrxiDPiBK2ZwBJAd0RY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=nLwejD44HX8XnRRvatCXwqkeSGcj194yx1ey+33mBRNN06oqL6nsQKBEU0X2O/atx O++fLg6U1iwj8GQX4TKp30wMsOewvjUXl56CK1RtBAnwUUsPWWfFcGKSy0TRrDJXlv E3Y9C9vI91BlxtXgO27qsR+fIwFGZDDb7GhstvIg= Subject: Re: [PATCH 2/6] selftests/clone3: add a check for invalid exit_signal To: Eugene Syromiatnikov , linux-kernel@vger.kernel.org, Christian Brauner , linux-kselftest@vger.kernel.org Cc: Adrian Reber , shuah References: From: shuah Message-ID: Date: Mon, 16 Sep 2019 10:37:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 9/10/19 6:03 AM, Eugene Syromiatnikov wrote: > Check that the kernel fails calls with exit_signal with non-zero highest > 32 bits. > Describe what you are testing: "Add a test case for clone3() non-zero highest 32 bits behavior. It should fail with exit_signal value??" Add checks for unsupported cases. Handle unsupported architectures and configurations with skip > * tools/testing/selftests/clone3/clone3.c (enum test_mode): Add > CLONE3_ARGS_BIG_EXIT_SIGNAL. > (call_clone3): Add args.exit_signal initialisation in case > test_mode == CLONE3_ARGS_BIG_EXIT_SIGNAL. > (main): Add test_clone3 clone check with > test_mode == CLONE3_ARGS_BIG_EXIT_SIGNAL. Please don't include pseudo code in the commit log. > > Signed-off-by: Eugene Syromiatnikov > --- > tools/testing/selftests/clone3/clone3.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c > index 7b65ee5..4f23a0c 100644 > --- a/tools/testing/selftests/clone3/clone3.c > +++ b/tools/testing/selftests/clone3/clone3.c > @@ -28,6 +28,7 @@ enum test_mode { > CLONE3_ARGS_NO_TEST, > CLONE3_ARGS_ALL_0, > CLONE3_ARGS_ALL_1, > + CLONE3_ARGS_BIG_EXIT_SIGNAL, > }; > > static pid_t raw_clone(struct clone_args *args, size_t size) > @@ -72,6 +73,10 @@ static int call_clone3(int flags, size_t size, enum test_mode test_mode) > args.tls = 1; > args.set_tid = 1; > break; > + > + case CLONE3_ARGS_BIG_EXIT_SIGNAL: > + args.exit_signal = 0xbadc0ded00000000; Please add a comment to indicate what this is. I am assuming this bad sig val. > + break; > } > > pid = raw_clone(&args, size); > @@ -146,6 +151,10 @@ int main(int argc, char *argv[]) > /* Do a clone3() with all members set to 1 */ > if (test_clone3(0, CLONE3_ARGS_SIZE_V0, -EINVAL, CLONE3_ARGS_ALL_1)) > goto on_error; > + /* Do a clone3() with exit_signal having highest 32 bits non-zero */ > + if (test_clone3(0, CLONE3_ARGS_SIZE_V0, -EINVAL, > + CLONE3_ARGS_BIG_EXIT_SIGNAL)) > + goto on_error; > /* > * Do a clone3() with sizeof(struct clone_args) + 8 > * and all members set to 0. > thanks, -- Shuah