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=-11.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, 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 DB083C2D0E2 for ; Tue, 22 Sep 2020 08:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E4C223A1E for ; Tue, 22 Sep 2020 08:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbgIVIQw (ORCPT ); Tue, 22 Sep 2020 04:16:52 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59315 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgIVIQv (ORCPT ); Tue, 22 Sep 2020 04:16:51 -0400 Received: from cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net ([80.193.200.194] helo=[192.168.0.210]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kKdTm-0008TT-7b; Tue, 22 Sep 2020 08:16:50 +0000 Subject: Re: [PATCH 1/3] stress-shm-sysv: exercise shmat with invalid flags To: Piyush Goyal , Liam Girdwood , Mark Brown , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org References: <20200922072730.68911-1-piyushgoyaliit@gmail.com> From: Colin Ian King Message-ID: Date: Tue, 22 Sep 2020 09:16:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <20200922072730.68911-1-piyushgoyaliit@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I believe these patches should have gone directly to me and not various other folk. Colin On 22/09/2020 08:27, Piyush Goyal wrote: > Exercise shmat syscall with invalid flags resulting in more kernel > coverage. > > Signed-off-by: Piyush Goyal > --- > stress-shm-sysv.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/stress-shm-sysv.c b/stress-shm-sysv.c > index aa03d718..5a3e0cc1 100644 > --- a/stress-shm-sysv.c > +++ b/stress-shm-sysv.c > @@ -128,6 +128,19 @@ static int stress_shm_sysv_check( > return 0; > } > > +/* > + * exercise_shmat() > + * exercise shmat syscall with all possible values of arguments > + */ > +static void exercise_shmat(int shm_id) > +{ > + void *addr; > + > + /* Exercise shmat syscall with invalid flags */ > + addr = shmat(shm_id, NULL, ~0); > + (void)addr; > +} > + > #if defined(__linux__) > /* > * stress_shm_get_procinfo() > @@ -337,6 +350,7 @@ static int stress_shm_sysv_child( > goto reap; > } > > + exercise_shmat(shm_id); > addr = shmat(shm_id, NULL, 0); > if (addr == (char *) -1) { > ok = false; >