From patchwork Mon Apr 11 09:40:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 1615642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=faHKMUuB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KcP4C0dBvz9sCD for ; Mon, 11 Apr 2022 19:40:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8DCB93CA51D for ; Mon, 11 Apr 2022 11:40:55 +0200 (CEST) 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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id F1CD93CA3CF for ; Mon, 11 Apr 2022 11:40:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 5815C1A007FD for ; Mon, 11 Apr 2022 11:40:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649670051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GkXfA7krfGUd2wYW2GGdnGP8FDKfbH+2QOmyU8lxjI=; b=faHKMUuBr+ILHJnEFyh9qDgG6c7Hu0gqko99nCtQnkx37WivP+7KGJLvSI3tSJs7kZBoAC Y6s+oB+JNTp3Vl3D1VaEunxS7Zx11XDwiYcqL0zDy0JRzC3JGU+/PdcYLWwu2dFRwHyJtt Hxigj/xiMaPY3MC8brdxGfkTpm6ENLA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-3pKZfhJjPOOXJSnUdZOBBQ-1; Mon, 11 Apr 2022 05:40:50 -0400 X-MC-Unique: 3pKZfhJjPOOXJSnUdZOBBQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BDE0100BAA7 for ; Mon, 11 Apr 2022 09:40:50 +0000 (UTC) Received: from liwang-workstation.nay.redhat.com (dhcp-66-81-187.nay.redhat.com [10.66.81.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id A070CC28106 for ; Mon, 11 Apr 2022 09:40:49 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 11 Apr 2022 17:40:47 +0800 Message-Id: <20220411094048.1143292-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=liwang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] pkey01: print more info when write buff fail 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" We got sporadically failed on POWER9 but couldn't reproduce the problem manually. Here add printf to show info to see if the PKEY_DISABLE_WRITE takes effect on buffers. pkey01.c:149: TINFO: Set PKEY_DISABLE_WRITE on (MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB) buffer pkey01.c:174: TFAIL: Child: exited with 0 pkey01.c:176: TINFO: Remove PKEY_DISABLE_WRITE from the buffer Signed-off-by: Li Wang Reviewed-by: Petr Vorel Reviewed-by: Cyril Hrubis --- testcases/kernel/syscalls/pkeys/pkey01.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testcases/kernel/syscalls/pkeys/pkey01.c b/testcases/kernel/syscalls/pkeys/pkey01.c index 04f50924c..1a9194e1a 100644 --- a/testcases/kernel/syscalls/pkeys/pkey01.c +++ b/testcases/kernel/syscalls/pkeys/pkey01.c @@ -161,6 +161,8 @@ static void pkey_test(struct tcase *tc, struct mmap_param *mpa) break; case PKEY_DISABLE_WRITE: *buffer = 'a'; + tst_res(TFAIL | TERRNO, + "Write buffer success, buffer[0] = %d", *buffer); break; } exit(0); @@ -183,6 +185,7 @@ static void pkey_test(struct tcase *tc, struct mmap_param *mpa) break; case PROT_WRITE: *buffer = 'a'; + tst_res(TPASS, "Write buffer success, buffer[0] = %d", *buffer); break; case PROT_READ | PROT_WRITE: case PROT_READ | PROT_WRITE | PROT_EXEC: From patchwork Mon Apr 11 09:40:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 1615643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TNkVxN43; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KcP4P31Xkz9sCD for ; Mon, 11 Apr 2022 19:41:09 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2D62B3CA518 for ; Mon, 11 Apr 2022 11:41:07 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 6DE703CA52C for ; Mon, 11 Apr 2022 11:40:55 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 4DFE1100065F for ; Mon, 11 Apr 2022 11:40:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649670053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JV15oEOS1c2o9AhY8Am6KkVk7gZDqpagyVGgO7LtX4o=; b=TNkVxN43dTnFflDuUVOaul1ThqNxk0ecjVy9FCQF4ZwYTrrdL4RQLq2pxNSnGog0qxXiYz O1SVKO2qGhbtqZJh0xqITnix7L1xYxXlfDYgVorEeFnoQFrTo1GGHlsHalmoebV0KJt363 5yKxakZLolQNeCMzlOIkqAabz33CCi8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-364-dFayDiXWOI2xNhdqkvF32A-1; Mon, 11 Apr 2022 05:40:52 -0400 X-MC-Unique: dFayDiXWOI2xNhdqkvF32A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12D80800882 for ; Mon, 11 Apr 2022 09:40:52 +0000 (UTC) Received: from liwang-workstation.nay.redhat.com (dhcp-66-81-187.nay.redhat.com [10.66.81.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 280CBC28106 for ; Mon, 11 Apr 2022 09:40:50 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 11 Apr 2022 17:40:48 +0800 Message-Id: <20220411094048.1143292-2-liwang@redhat.com> In-Reply-To: <20220411094048.1143292-1-liwang@redhat.com> References: <20220411094048.1143292-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=liwang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 at in-4.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,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] pkey: correct the PKEY_DISABLE_ACCESS definitions on PowerPC 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" Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e9506394a159 Signed-off-by: Li Wang --- testcases/kernel/syscalls/pkeys/pkey.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testcases/kernel/syscalls/pkeys/pkey.h b/testcases/kernel/syscalls/pkeys/pkey.h index 6e32326b6..6cda88ff1 100644 --- a/testcases/kernel/syscalls/pkeys/pkey.h +++ b/testcases/kernel/syscalls/pkeys/pkey.h @@ -11,6 +11,13 @@ #include "lapi/syscalls.h" #include "lapi/mmap.h" +#if defined(__powerpc__) || defined(__ppc__) +# undef PKEY_DISABLE_ACCESS +# define PKEY_DISABLE_ACCESS 0x3 +# undef PKEY_DISABLE_WRITE +# define PKEY_DISABLE_WRITE 0x2 +#endif + #ifndef PKEY_DISABLE_ACCESS # define PKEY_DISABLE_ACCESS 0x1 # define PKEY_DISABLE_WRITE 0x2