Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793826585; b=hEFbrk/bXp0j7vAxBl6heX7/kiJec+pFw3392rchKQDK/IxUHJCxifqMqVgkLYK8pqlo yee5DAgtLn+fYRL26Ahmert4mEK6DznbI9BCxPHhI76iaKAFxy21leWbdMei65jICwRVJ JcxW6qbXmDa9mU9hXiCU+JLJRkgKPduOS2hZtLyT8lRZP1wjxQwPsPLxyOFChFiR8Fozd 7w5o3wmXrciaHreTOatx6B+ftCNlJbu8HuK+bjIfYOKX8xqFMHAd5rmGvEE3ycIhAmfvI ALgBBK/gUzChWptzY/krhxcLsL/hdQ5ZTabrc7V4NDGSxnNjc+cC/PdrDhk7mmOkx3A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793826585; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=iDRVFy6I1yy3Vo/9vdN843HKbuRZWWjAxcnOm4/lGYs=; b=CUaNMc8UfPVZc5g+vmWuNMbtYr5mGDyJXNyhYwVAs8Ya4zC7R+wLtEYcnYuAy9nKcB7C Zg5m1Fdogfyfozj18p0Y4JYO3HRFVcXIvpsjc7lXkHzTtlnkbciornNJPKoxJpytw7DVf wMd+jhzX2mNPGWtZ1W4TvJh+bwQM0wTupXYYHn1xgxSSVyX4rpKNTqy7OLdcNnQC/cRcv xxasr1EB5OvqkC67CoEV7c44yQJOAGRTqelu0j83JEWQ3Bl6nNqAga8SAtMGjfy0iTaE8 cMAzxNEB781a41W+7vCOXbigrStsQrEKSoKtvTWO3qsbkB8T5znha9ybE9diRRr7nsw== 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=YN0v5xCT; arc=none smtp.remote-ip=209.85.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 48DA3607B9DB for ; Wed, 4 Nov 2026 21:09:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48DA3607B9DB 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, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YN0v5xCT Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-48e09aa5264so620911f8f.2 for ; Wed, 04 Nov 2026 13:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793826584; x=1794431384; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iDRVFy6I1yy3Vo/9vdN843HKbuRZWWjAxcnOm4/lGYs=; b=YN0v5xCTD9eqYjRDrox9B7A61G1+SFMIUYQay/ymlVUEBzD+kVNRzZ7FlEgvOJVqyW Xy82e6XV0cd+AV6K5WT238vjhOrRtDiq6vPygR4889jEbICVmf1w1bDKHwPfTLME7Quj BwhZqF0rAVrNbnHOFyAL9cOwIXM40H6qOtSOWsB5yjPWJYQIZeomuTgT130NUsQuwbu2 Pbqs8VQqOKBQEd/H4ynbiTvnPlphdVumQpxeCPSLMskleBloYrVLj48dpS9euGOu4d6R GDgF81LTbZo2O+Y+nKqU1HWH3B/V38lsGwkJy4NxGq3Z3VSbu7u3sc2JVPsHahRzoFZS G/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793826584; x=1794431384; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iDRVFy6I1yy3Vo/9vdN843HKbuRZWWjAxcnOm4/lGYs=; b=TfV7Y+gKwRiVbNMWkWVezeOzRBCRXLRRZ0X52a5DbecvYir6eEKCfrosT+wSSk20c/ RSp7rRp4kqSF9e5hMlJCtVffWDbT1fMMEtNbDvFP+c2yuVJ0wR4V4EnmPFiiLsgxnPik mnsIXzVbPI+R6BgEczAFqXV2bzrniLsq6QCSsKebbLOo57En+Sc1woLrM2Rvv1pAF7U8 LHXwDq7JAwtorhrQTxVg7KmrK5VfSjsR5YwLPWQGgW2D9ZZqlV2IHgUL7LmfmEFRCyWk rvPsYkU2pJ+4qM4yOou+6X0rFNZs6nsREWzsDmyYPqjIDiav4txHKZAQVV0gAimLPSpo RPyA== X-Forwarded-Encrypted: i=1; AKwUvBxggwY6qLj7b06i6vTD/hwF0S/zoIXMvCHlB5wWEus5sD9+ha/aYSF5iHxkUlFu9urmMmLwMwP88Z1XTp5QHdQ=@vger.kernel.org X-Gm-Message-State: APuU4Z+SScSNl1JFL4lXDlRJB0HxgT6473fIT/N9ZO7JRuqS6Xk3iZL9 xBtzTxGMuG803UXB1zkpHMLcFhSk+q/CuEvFi85J2NQanU440XccRfvbXnDfExDg X-Gm-Gg: AYBFou3NWjKRveAdVjYp4DYaMa0QpWMW62II/1fy7isqRrvCLFMoJNYSkD4blVThT/p ubT0GEUrg4VKT+Vffhj9pUHR84pyOLZ9KYGYoq1sR8cSIbPTQY2uyvzfg45XI2SKV2ya7XSuJj5 mpYZUSyP0C+8YvMg9ZRaMPVgHTKHICdPApaY4s8asYUg4R/aME+rJiJTJ0hcBPP4r41q9YPkM2t bX++hqbAmY7UdaRmBo75fpR4eNOt2OQa8nG2pAWI+3P10yzf79Xi2+TVDORPfLCE2vvSC3QhhN8 ZzxV4FW6nRxEqVOM+nWCjVL94DNx38RL/DhRF/fRLJyWtspZsL74mbYALkx791t4XC7nXZgI9E1 TUEwyFs3Rak9ATg+8Yo/yj9DkaWPNHfcaPNK9N5EJ7TQ8YUYmxWFTNtbFAr1tKS3Ew9UShQcBsk 2ZKQYWP65S0gdFrgjKEewfNcdLM1/hpMeVWDQVLbvdXO9RjowKxPhf7aT9KQ6xnCjOb4aB5GKt0 /NElhZjGX9hwoTEGqVqvg2x1wlZwZAaHp0OgTBpaSQ1+EJvO1fZdIytlkrTlpYtgQVX+bnIRmm5 MyNeysBZ2fV6wRbk7mTIqANPJOyYRHG62a6SnOcsyMMwM5Muvx02qSKZ43o5SW0aRCBZWRG3zGA = X-Received: by 2002:a05:600c:4e50:b0:4a1:7d9b:d4ae with SMTP id 5b1f17b1804b1-4ac16fa3523mr400681945e9.5.1793826583655; Wed, 04 Nov 2026 13:09:43 -0800 (PST) Received: from localhost (ip87-106-108-193.pbiaas.com. [87.106.108.193]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b4532916f2sm84724225e9.5.2026.11.04.13.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 13:09:43 -0800 (PST) From: =?utf-8?q?G=C3=BCnther_Noack?= Date: Wed, 04 Nov 2026 22:09:08 +0100 Subject: [PATCH v2 22/27] selftests/landlock: Fix messages and comments in helper programs 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20261104-selftests-refactor-v2-22-c52f23f7ce33@gmail.com> References: <20261104-selftests-refactor-v2-0-c52f23f7ce33@gmail.com> In-Reply-To: <20261104-selftests-refactor-v2-0-c52f23f7ce33@gmail.com> To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Shuah Khan Cc: linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?G=C3=BCnther_Noack?= X-Mailer: b4 0.15.2 * sandbox-and-launch: Describe the actual argument order. * sandbox-and-launch, wait-pipe, wait-pipe-sandbox: Report failed read(2) calls as read failures, not write failures. * wait-pipe-sandbox: Terminate error messages with a newline, and fix comments naming "." instead of the opened "/". Signed-off-by: Günther Noack --- tools/testing/selftests/landlock/sandbox-and-launch.c | 6 +++--- tools/testing/selftests/landlock/wait-pipe-sandbox.c | 16 ++++++++-------- tools/testing/selftests/landlock/wait-pipe.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/landlock/sandbox-and-launch.c b/tools/testing/selftests/landlock/sandbox-and-launch.c index 3e32e1a51ac5..8b33ddadc63e 100644 --- a/tools/testing/selftests/landlock/sandbox-and-launch.c +++ b/tools/testing/selftests/landlock/sandbox-and-launch.c @@ -25,8 +25,8 @@ int main(int argc, char *argv[]) char buf; /* - * The first argument must be the file descriptor number of a pipe. - * The second argument must be the program to execute. + * The first argument must be the program to execute. The second and + * third arguments must be the file descriptor numbers of two pipes. */ if (argc != 4) { fprintf(stderr, "Wrong number of arguments (not three)\n"); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) /* Waits for the parent to try to umount. */ if (read(pipe_parent, &buf, 1) != 1) { - perror("Failed to write to the third argument"); + perror("Failed to read from the third argument"); return 1; } diff --git a/tools/testing/selftests/landlock/wait-pipe-sandbox.c b/tools/testing/selftests/landlock/wait-pipe-sandbox.c index 87dbc9164430..dbc0c2747e9f 100644 --- a/tools/testing/selftests/landlock/wait-pipe-sandbox.c +++ b/tools/testing/selftests/landlock/wait-pipe-sandbox.c @@ -31,7 +31,7 @@ static int sync_with(int pipe_child, int pipe_parent) /* Waits for the parent do its test. */ if (read(pipe_parent, &buf, 1) != 1) { - perror("Failed to write to the second argument"); + perror("Failed to read from the second argument"); return 1; } @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) /* Tries to send a signal, denied by layer1. */ if (!kill(getppid(), 0)) { - fprintf(stderr, "Successfully sent a signal to the parent"); + fprintf(stderr, "Successfully sent a signal to the parent\n"); return 1; } @@ -88,13 +88,13 @@ int main(int argc, char *argv[]) /* Tries to send a signal, denied by layer1. */ if (!kill(getppid(), 0)) { - fprintf(stderr, "Successfully sent a signal to the parent"); + fprintf(stderr, "Successfully sent a signal to the parent\n"); return 1; } - /* Tries to open ., denied by layer2. */ + /* Tries to open /, denied by layer2. */ if (open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC) >= 0) { - fprintf(stderr, "Successfully opened /"); + fprintf(stderr, "Successfully opened /\n"); return 1; } @@ -115,15 +115,15 @@ int main(int argc, char *argv[]) } close(ruleset_fd); - /* Tries to open ., denied by layer2. */ + /* Tries to open /, denied by layer2. */ if (open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC) >= 0) { - fprintf(stderr, "Successfully opened /"); + fprintf(stderr, "Successfully opened /\n"); return 1; } /* Tries to send a signal, denied by layer3. */ if (!kill(getppid(), 0)) { - fprintf(stderr, "Successfully sent a signal to the parent"); + fprintf(stderr, "Successfully sent a signal to the parent\n"); return 1; } diff --git a/tools/testing/selftests/landlock/wait-pipe.c b/tools/testing/selftests/landlock/wait-pipe.c index 0dbcd260a0fa..3cfa4dce5f35 100644 --- a/tools/testing/selftests/landlock/wait-pipe.c +++ b/tools/testing/selftests/landlock/wait-pipe.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) /* Waits for the parent do its test. */ if (read(pipe_parent, &buf, 1) != 1) { - perror("Failed to write to the second argument"); + perror("Failed to read from the second argument"); return 1; } -- 2.56.0