From patchwork Wed Feb 22 11:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 1746191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.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=RGVZsdAM; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMDxF5gfBz23yr for ; Wed, 22 Feb 2023 22:50:24 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id AFAC23CBC35 for ; Wed, 22 Feb 2023 12:50:16 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (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 04C0F3C304A for ; Wed, 22 Feb 2023 12:50:14 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 6DCBB200074 for ; Wed, 22 Feb 2023 12:50:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677066611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YdFJ13L8KbHG0ffs2nkRl2SP6ae02YAFdxxEq+yOT1I=; b=RGVZsdAMzW7KzTus2Bu14ivg84siOVN8q7yj+OlKGDobXzWt1l0LMDxOAs+PO5M5AyghyT 2ja7EnAtmCDrUOSt0PE2rTZBpZZpp9vsPBDhDM0XJzYk+C40q4NCX2w7hgSfejnyKZaYfQ evENtYxnFrQjJM5OaKvowD8BPVHQ+rk= 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-231-xvwZABWPMIScc6BEVoGnWA-1; Wed, 22 Feb 2023 06:50:08 -0500 X-MC-Unique: xvwZABWPMIScc6BEVoGnWA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0808085A588; Wed, 22 Feb 2023 11:50:08 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.194.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79D7A492B00; Wed, 22 Feb 2023 11:50:06 +0000 (UTC) From: David Hildenbrand To: ltp@lists.linux.it Date: Wed, 22 Feb 2023 12:50:05 +0100 Message-Id: <20230222115005.223063-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 at in-7.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 autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH v1] security/dirtyc0w_shmem: Fix test with host pagesize != 4k 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: , Cc: Juri Lelli , Bruno Goncalves , David Hildenbrand Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The test can currently fail if the host page size is not 4k, because we forgot to replace a hard-coded 4k by the actual page size. So if we end up having to trigger a UFFDIO_WAKE, that ioctl will fail because it's not aligned to the host page size. Reported-by: Juri Lelli Reported-by: Bruno Goncalves Tested-by: Chunyu Hu Cc: Petr Vorel Cc: Martin Doucha Signed-off-by: David Hildenbrand --- testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c b/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c index 9c2b03994..2a982347c 100644 --- a/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c +++ b/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c @@ -115,7 +115,7 @@ static void *uffd_thread_fn(void *arg) if (ioctl(uffd, UFFDIO_CONTINUE, &uffdio) < 0) { if (errno == EEXIST) { uffdio_wake.start = (unsigned long) map; - uffdio_wake.len = 4096; + uffdio_wake.len = page_size; SAFE_IOCTL(uffd, UFFDIO_WAKE, &uffdio_wake); } }