From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796060401; b=0lz/jC7QabOLjc9mcXm2iTpmss2X1zjWzAEE62s+Vh61LX5PVd7Hul88X8R3aplyqby1 2cInY7zHMB5l2nZ1Y+Jfy8Xr+1AdeqTG0b4LLDMP2HYPIp757RXXtoqBSZgaM4+RJ+OIT qVdc0s3SLwVe8LiMSrRMqpQreD2a2ulK5qiDtg3okgaPBiCRUk6JZ8YETuAPn/4uoeFpz nw7Erc3YoY1f/B7Ood/HzpnOLgNmwpMb/wAHwZukc+dBLK+DLWaLCttMxVZ489dd74os5 nShSXfQb9I3RKKIjZur9x3FL3b8zSTJhAeROVIMIUI1Kd5M0f7U0naI5/3BbDNChEsw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796060401; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=s0uxmBONXaQ6HzdTtsm0QEWz+ZSOyaWTRDbVi9l5cqM=; b=G6eNbWuAnVJ8cHKQJ3ZkuUaRzqb2PhMEcR8G+UhVFH757MToVfzNRnNuGkzdq8QiuK/K iSgdEE4sI8irIUJArEldRaE2oqfO+61C5LH0Al+uEVeCsGORaV0O9wMNyFuYcfkQLRnWY HdnWei6D+A1h48WSzNyV8r2Q3n5oTiGUMy6gCEqAxS5VbOJFwRual4pHJxZ9ZAu74oGeR MTh1dztKiDttoJMc0R69VwEB1MhySjAAj00kRjvWHqC/uSYf3lJx5Egq2Qkf0Kvst4bIh T/5KVUasqzpeMYAwd9kW33cBxqV7/JFp0sVPZwbjptbNIDADS989NJWvyM+Fq4e84+w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=G+DLTSFA; arc=none smtp.remote-ip=209.85.160.177 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02449606A32E for ; Mon, 30 Nov 2026 17:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 02449606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=G+DLTSFA Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-55bd96affd2so138403741cf.1 for ; Mon, 30 Nov 2026 09:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796060400; x=1796665200; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=s0uxmBONXaQ6HzdTtsm0QEWz+ZSOyaWTRDbVi9l5cqM=; b=G+DLTSFA10Vz/k95hRbrq3V9FQS0qqZKc5eJlIFLXzcl5Y5nIDaSpldEuvzEmBg+DQ Xu8HiiGHF5Lujj5VeUVxE467Vnes34rHaKniuOT/Mz7qGqGORXGmTQ1HIDK+rn9wK4wd 3Z3LwORLXa8+vMhiH3+22ot5S+tcJM+IT9Zh0dq1KBwgolt0HHo88FZlYk2d6R8ME+9m Gf/JiCYMBawiYSLyzdFpJhRS7Wqi6ohvh8IDv9gtRzqMW5NJyTlcws6ZNv6zHj9zYHce kcWG+OobQdzeaS6OqCOUjERu4YTlAecfiKCr0PX2rdoQSGJdyyYyw6eFZ6GonU+omQgC d9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796060400; x=1796665200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=s0uxmBONXaQ6HzdTtsm0QEWz+ZSOyaWTRDbVi9l5cqM=; b=xqcZmplQ/p3Q4ECpjqeJppSsMJjEx7zVI9+rIZXq+A63VvdzQXwBl3ZirB4quWB/Xx BJvfOuYB5hvykYbM1HB5ZLf6z7nf3fWz9aG7zRCG1Srw8kfp4PhuvSAlqosVItYnPPgD Fxntt02OGRnB3ByyuLqIwNHRi4Rcv2KbZoe60TgyoSF2VzPGO3HUzD+lY+g+N4v+AS+F thXKtVVenUWrSEc1BxVUEhVx6nBbm0oafdUYQEtHWlINjYjlCU84S3vVjZkYN2dpfopp zty//Px/I9ptH18lRWO0NTMCRbiwu0T+tDkDuKCV0IPHUL8TTMnlwufEb5wYKos4ikEe tfzg== X-Forwarded-Encrypted: i=1; AL+hErEaQnR9wR2efcdoahb94oTx+V3qUNX+SIeSChjDIAUW/VfByv75n1sRIvEBX7OzljBvJX7LohoNgR5AVgIPBJ0=@vger.kernel.org X-Gm-Message-State: APuU4Z/IIeNg6Us2EPjXr4Dzs/GQSBfH3KenvTTQDmB8MrMUtyCZOAB+ BlV7C5PC1+12PgPFk8QH05QxG/2l0nLrT26BeOXk09b6vDf7eDYspfMd X-Gm-Gg: AZFdTZe/M4Y1OtZun3yy1237wY0ABrnegrp0hlRXzBqxO8wm1ErqzCEXWofBR0SWKFr n5rkQHVAkG+FXiKtxsFxxIEERv9arOa2YYfQ0qhKW2R1AblT9Ni6qR+iHwHw/4M4eftSSmMpNJH 5Gz7mQJA4JhHRzS8tEuuehx5ceRkwJm49uuzGpnyrKep7RT/fPpE22wuyAcMgXNUTy916D1OH8W EVYsR5m6XvD1NF4a/lJZnX6M6mtOGyQGiwn6OSh7zHvO68RsYWeJbpbs39wFTjpeMOgoM31z+bb V1INLlO/BDxsqepRgel97l9OchXKRsRY61cCo4tY+GTPUpSnfGYzDTCLmEFLZ96okeIcZGmqvcY PG41bolTHBQydG2/b1C6OPKB1AosGnXIPx5Y96lEOTUqTMqQOKpOvvC9PqGZFa8jNeDe0NEUM+Y uFOJIB87GzpIjpW2Oa44DxIKfhdpTgsEhGKyPyC8mH949AGvfVv8F4fwPbx/4BRf5sZgOHEZWGC HcbfJKHLEWZCULydI25yQshTcXi+37eb/ItsRM4+32Tnybvmix0Hs+lLxflrJA7O/EavBndEFh0 5+vBA1h46IZ+DBMcCoNvdxHC/+f9cMzKrQIx+vVrbVdgFPyhwaSUDR/EGoc+pOiH5bzihx77zgj w2tAI X-Received: by 2002:ac8:5d0e:0:b0:535:1d5b:a7fa with SMTP id d75a77b69052e-55d769fe4ddmr638921391cf.14.1796060400001; Mon, 30 Nov 2026 09:40:00 -0800 (PST) Received: from localhost ([138.197.109.108]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7888fb27sm283476251cf.25.2026.11.30.09.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 09:39:59 -0800 (PST) From: Nikolai Dokutovich To: David Hildenbrand , Andrew Morton Cc: Shuah Khan , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolai Dokutovich Subject: [PATCH v3 2/3] selftests/mm: skip the mkdirty ptrace write tests without FOLL_FORCE Date: Mon, 30 Nov 2026 20:39:49 +0300 Message-ID: <20261130173950.41003-3-ndokutovich@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261130173950.41003-1-ndokutovich@gmail.com> References: <20261130173950.41003-1-ndokutovich@gmail.com> X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit mkdirty writes through /proc/self/mem into read-only PTEs and expects the kernel to force the write. Under the default CONFIG_PROC_MEM_FORCE_PTRACE policy that is only allowed when the writing task is tracing the target task, which is not the case here, so the setup write fails and the test reports a failure instead of skipping: not ok 1 write() failed Check the permission at the entry of the two ptrace write tests and skip them when it is denied. A kernel built with CONFIG_PROC_MEM_ALWAYS_FORCE or booted with proc_mem.force_override=always still runs them for real, so a genuine failure is still reported. Commit a3907a3169d0 ("selftests/mm: specify requirement for PROC_MEM_ALWAYS_FORCE=y") asks for CONFIG_PROC_MEM_ALWAYS_FORCE=y in mm/config, which applies once that fragment is merged into the kernel configuration; this skip additionally keeps an installed binary from failing on a kernel that was not built that way. The remaining subtests do not depend on the forced write and keep running. Signed-off-by: Nikolai Dokutovich --- tools/testing/selftests/mm/mkdirty.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c index 68dd447a5454..333d450d4ff3 100644 --- a/tools/testing/selftests/mm/mkdirty.c +++ b/tools/testing/selftests/mm/mkdirty.c @@ -91,6 +91,11 @@ static void test_ptrace_write(void) ksft_print_msg("[INFO] PTRACE write access\n"); + if (!proc_mem_force_write_allowed()) { + ksft_test_result_skip("FOLL_FORCE write probe returned EIO\n"); + return; + } + mem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); if (mem == MAP_FAILED) { ksft_test_result_fail("mmap() failed\n"); @@ -128,6 +133,11 @@ static void test_ptrace_write_thp(void) ksft_print_msg("[INFO] PTRACE write access to THP\n"); + if (!proc_mem_force_write_allowed()) { + ksft_test_result_skip("FOLL_FORCE write probe returned EIO\n"); + return; + } + mem = mmap_thp_range(PROT_READ, &mmap_mem, &mmap_size); if (mem == MAP_FAILED) return; -- 2.43.0