From patchwork Mon Nov 2 11:42:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 1392144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CPrcm0vl0z9sVY for ; Mon, 2 Nov 2020 22:42:31 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B53293C3050 for ; Mon, 2 Nov 2020 12:42:28 +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 [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id D71C53C3044 for ; Mon, 2 Nov 2020 12:42:19 +0100 (CET) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id 1C28D1A00F26 for ; Mon, 2 Nov 2020 12:42:18 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.77,444,1596470400"; d="scan'208";a="100826756" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 02 Nov 2020 19:42:18 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 79FB04CE34E2 for ; Mon, 2 Nov 2020 19:42:13 +0800 (CST) Received: from localhost.localdomain (10.167.220.84) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Nov 2020 19:42:15 +0800 From: Yang Xu To: Date: Mon, 2 Nov 2020 19:42:18 +0800 Message-ID: <1604317338-22774-2-git-send-email-xuyang2018.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604317338-22774-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> References: <1604317338-22774-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD06.g08.fujitsu.local (10.167.33.205) To G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) X-yoursite-MailScanner-ID: 79FB04CE34E2.AD124 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-Spam-Status: No, score=0.4 required=7.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=disabled version=3.4.4 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] syscalls/ptrace08: Add exception for RHEL8 4.18 kernel X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" RHEL 4.18 kernel got this patch commit bd14406b78e6d ("perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set") since 4.18.0-49, therefore it will return success instead of EINVAL when modifying breakpoint. Without this fix, the test will fail on RHEL8 4.18 kernel with: tst_kernel.c:79: TINFO: uname.machine=x86_64 kernel is 64bit ptrace08.c:90: TINFO: Trying address 0xffff800000000000 ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded ptrace08.c:90: TINFO: Trying address 0xffffffffffffffff ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded ptrace08.c:90: TINFO: Trying address 0xffffbfffffffffff ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded Signed-off-by: Yang Xu --- testcases/kernel/syscalls/ptrace/ptrace08.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/ptrace/ptrace08.c b/testcases/kernel/syscalls/ptrace/ptrace08.c index 63086f1fd..741923e36 100644 --- a/testcases/kernel/syscalls/ptrace/ptrace08.c +++ b/testcases/kernel/syscalls/ptrace/ptrace08.c @@ -56,6 +56,11 @@ static pid_t child_pid; static int deffered_check; +static struct tst_kern_exv kvers[] = { + {"RHEL8", "4.18.0-49"}, + {NULL, NULL}, +}; + static void setup(void) { /* @@ -72,7 +77,7 @@ static void setup(void) * disabled instead and the EINVAL was returned when dr7 was written to * enable it again. */ - if (tst_kvercmp(4, 19, 0) < 0) + if (tst_kvercmp2(4, 19, 0, kvers) < 0) deffered_check = 1; }