From patchwork Thu Mar 1 09:22:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Kholmanskikh X-Patchwork-Id: 879653 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="fDVDOv94"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zsRlH6CVVz9s1B for ; Thu, 1 Mar 2018 20:21:45 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 5E2CE3E72C4 for ; Thu, 1 Mar 2018 10:21:37 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id ADB033E6269 for ; Thu, 1 Mar 2018 10:21:35 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 792831A00F81 for ; Thu, 1 Mar 2018 10:21:34 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w219H4If165339 for ; Thu, 1 Mar 2018 09:21:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=+hOQCdaeefVuNM7SWCt+Tz1yRTAZ3wzhDsXtBqFQu8g=; b=fDVDOv94Bku+3drXGpZTROURRbenvgLgUDRlOr8fOxzIdBRwCyCC+WqSfYw0N49Wd87A lMFsCR5ww0whlao3NWmj1OCn/kJd/Dsr1MU4zzWWJPG9qD0d79JJQ7wr1g2dFYqKEwta kGZyMQVfuml0FiOgS4pDngpKcusdoqfwSbFylSk1gHWKEgXWgjq12U1UZkKgO1HJTgtA lT9vmSjOEEGYiHxfA8kc9mWJVQPTQ4/Jr+vHra6+a3nrN/PYumPnENfETW07qTLY8R+b EiXAgKa29+UCgRwYOoZAxxfnTkiBO3JkZ7vKEeKxzythDmPtWf/oltB5yH1LFynsrx+r tA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2gedwtr7gc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 01 Mar 2018 09:21:31 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w219LUCO023764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 1 Mar 2018 09:21:31 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w219LUvI030985 for ; Thu, 1 Mar 2018 09:21:30 GMT Received: from kholmanskikh.ru.oracle.com (/10.162.81.25) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 01:21:29 -0800 From: Stanislav Kholmanskikh To: ltp@lists.linux.it Date: Thu, 1 Mar 2018 12:22:16 +0300 Message-Id: <1519896136-23271-1-git-send-email-stanislav.kholmanskikh@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <20180212151755.GA23827@rei> References: <20180212151755.GA23827@rei> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8818 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=437 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803010123 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: vasily.isaenko@oracle.com Subject: [LTP] [PATCH] openposix: mmap/21-1: use all bits set as the invalid flag X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The test is trying to trigger EINVAL by passing an invalid flags value to mmap(). Linux commit 50a8e840d050 ("mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags") introduced a new flag (MAP_SHARED_VALIDATE) and that flag may not be the last one. So instead of adding an 'if' for each new flag we use a value with all bits set (which is unlikely to be a valid flag). Signed-off-by: Stanislav Kholmanskikh --- .../conformance/interfaces/mmap/21-1.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c index dc0cc13..ce636cf 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c @@ -33,7 +33,7 @@ int main(void) void *pa; size_t size = 1024; - int flag; + int flag = ~0; int fd; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_21_1_%d", getpid()); @@ -50,10 +50,6 @@ int main(void) return PTS_UNRESOLVED; } - flag = MAP_SHARED; - while (flag == MAP_SHARED || flag == MAP_PRIVATE || flag == MAP_FIXED) - flag++; - pa = mmap(NULL, size, PROT_READ | PROT_WRITE, flag, fd, 0); if (pa == MAP_FAILED && errno == EINVAL) { printf("Test PASSED\n");