From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 1E7AA80266 for ; Wed, 2 Sep 2026 12:37:14 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 682CZqVh023913; Wed, 2 Sep 2026 15:35:56 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 682CZqVh023913 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="yPBEB6x2" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 682CZp5G023909 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 2 Sep 2026 15:35:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 682CZp5G023909 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-47f6d70223dso760522f8f.1 for ; Wed, 02 Sep 2026 05:35:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBxymR/MXoJLuaDa1V2IjOJZkHrfurEB7uwUMrtKpGjuyk5MtPjybgq+UiH8KKCA2QLHb8JlDg==@openvz.org X-Gm-Message-State: AFuF++kgiKevJpaEf4T74aKZQwWtQ3eibn/AKm4NuofqvH1M5/tWlYhr Hvu9J4Pd0GC/LnxvNOC6Mp2DNWOjgZBtcfVH6DFTkh9AHll8NHjy7p/TMAgIIRfcTB1uKCHiA01 QkKIpCj3jbQaLiq0GxbuM8UgaU9/qVlQdTR7KaadqjpULrvK2xcPEBw== X-Gm-Gg: AYBFou1XvOJkJJuDwHvLR/ffWo7Ykp+0uye/TeHpELn5pf858kc0309wS6sinBoHGb7 gj4o8n0bfmmAUztgVDsxMNIEFdfpl8yWzV2sIA97kNhDFOXlVUUIbVXbj84RKKxj1vxKRM5ISoJ jg0BSTQzRnl2xArRcWAPdZt8B1rSCky/9SaWtLb7GX5dGosPu/BSAkaxlhVdNAChmXF7ecptrZc ocHXQ68+E9raZR2eV6jpQIyhiNUBa4N4VCe7xZ8Bi9yj1KCWLPKRxo6IXOOqbZQT9m7pdXUum0x osn9wdOE7bP5GOMLgejLDeAvPE7NqjAKIEpcUSSDK5UiSH9N52OAnCZM4qFYHJBQWBxLmCJCVX9 NHx+pmPPi6k750fKO X-Received: by 2002:a05:6000:2c06:b0:484:372b:9524 with SMTP id ffacd0b85a97d-484913b9aa1mr8247166f8f.18.1788352550871; Wed, 02 Sep 2026 05:35:50 -0700 (PDT) X-Received: by 2002:a05:6000:2c06:b0:484:372b:9524 with SMTP id ffacd0b85a97d-484913b9aa1mr8247033f8f.18.1788352550192; Wed, 02 Sep 2026 05:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788352550; cv=none; d=google.com; s=arc-20260327; b=UZtLUvvBy15KN5ztvFjSfBNyGRNvFwJKvpeCBk2H738mGziVIwohH+UnvCCcqhSeTw tTvAkykfgElMDdKMNrFMq3cRR21C/Qx1cyXn/l4m9O1QzHQF1pX3qxCVRoCisB2RJ0W+ Dh2QjiaCi3M4Qy8n8wzDQBfPSexrUS45DTRF2CqOO0ABvaSogKCg5D0yDgtfYT0W1w+I xjmtFoijJdRPZasVrwQt39AQ9YhTEXfLZaF/gc0Pif+dztM872H118X0PBMSe7jqX4YR RPYh5qQlIy1OcZXAKMhI7qhIhpQEVlsbjPlQ9ixx5GjokVEN0VLjsl8XCS5FjPLLwgjn FB0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=7vXLfkQ/0pbunec3nP4k6xY8RVNRa6qB/JC/lzWua2U=; fh=CTF2GHyV+XdzB5TROrdG4fdLri6JSHNOBC+LNuNq5bA=; b=kJyWB/DuSYQQgM1zs/f9eTezKL+NOXjwp76fWQtYmBC8AfkLf8HNHGCAL+wevDYUcs u5pkkt2V4AHk522/7TL+ElQ4v4j2cjgC/KIGDRjWwxgryAFdcpJ8KwLsiiEtEsOTxr2Y 2Y6vYv4KqLsVmWHSZuBmJVlzlC0OjZ+v/u0/Pv0MoYj0UbpqJwBEMaYHNbou1c19ubTx LtBs9rf4pxGog3vzflGb8+Ajo6I9Rg0HJlkBUnhIs0FT+QIQJVWv87Q0qlcBwQGo4XFq a5E0c851o0tbnD/gTrlM1umh2tly5zDhhqk1xlihNRiJ75oSCM2wSz02wSc+6Cu69zLJ 8aNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yPBEB6x2; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48448e730e2si5532369f8f.79.2026.09.02.05.35.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 05:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yPBEB6x2; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=7vXLfkQ/0pbunec3nP4k6xY8RVNRa6qB/JC/lzWua2U=; b=yPBEB6x2mttW cjfJy2ZqmkYrFNY/dW2a5hIpXyOZJU5Zol37IIKa576BAZ8sUTm8L1d04JageFIOiYuw7FDMuK6pL o5AxR8DE91+VjhERgPGY9H7dnMenalpcM5F5l8x7RDP+8bq3omnMo9bOCJ6xfs6g5T9yTZ4NCeBN1 jekmb96/fdc1kFhhvtBvTL+WgJyM5ic8et8LDztHlVQ5kq33t62DbLqjOpyAO8QuMz1QbqWD1upcQ DvcNbroiCmieD3MtzX9FMC3/t4721bbnZ/Hwna+tqltLk3EsYbpXiZtnFCLy0W2Rw29iBroc3I4pU nNnb/h44MygMPOpC8aMf4Q==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x1k9Y-000ZPk-1f; Wed, 02 Sep 2026 14:35:49 +0200 MIME-Version: 1.0 From: Konstantin Khorenko To: Eva Kurchatova In-Reply-To: <20260831235046.1651611-1-eva.kurchatova@virtuozzo.com> References: <20260831235046.1651611-1-eva.kurchatova@virtuozzo.com> Date: Wed, 02 Sep 2026 14:35:45 +0200 Message-Id: <178835254565.1215292.16103582718616335226.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3868; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=6XfxXt5nwgUDTrqmldtolzCwzHjG1cL/OcvvuuUFvic=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqmBgkYEo0TobH5LnCkZTIq+EniL3CliXpiSzZp mAmz2RwXAqJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCapgYJAAKCRBRlgpH+WFc KjaoD/9rAiezQWWSNzPhmHSqnwZI277dICAYmdqZvbNkCdzfUcNJbkfuxoA56bfALyPRy3FvWAT qX6JYVyNb9x2CQpyPE5H/cKwj0VV3OZDvWQ26b1a1OoKdUpNqeI2huGFf8I1MuU251agcIM1759 2DByfdhd+VRBzqOHdIeamlUbbRmQV1lyAGSRXOvDJcQECmETO9hd3+D5FN1TKPUJbtmr44Ytq4J Upr+/LYmZjPTWRkbRxBmF67BxuYoKgLSyXfqlNmIS81+V8NvhqYU3dIyp74rUWVFWTDSaDjvBAK U8WYX+uTztA2JOFpzELvs2NtNbIScNunK7gvjJYa2FH8NunFnks+/5Jwh2NTbBpdqzj0D7P7nCI 1/Tm/8Eg25darO/y14GI1ffB5sB/XGWvPzGWA0Xy9aZYyFKF481AJCh0trXktbENbOu3hqZNUqM AxIhpVRfq3rTQIvH3g7YE8OFg0hepyZ08rg8fcFExbIRf2nlb7qKOoz9y7ovRrR9OHpq9HSVMNH ojKxsJZilVAmbbt2awMEwcJrvIBQOXq9vkJM6NCwFxT9xibWZPQPNfDSilfmQz956RUCsS3Z7+y B/D04/sBlAixmPrmQLeLY22/eET9FdZ/B7TtKQD2MgVfOR/ZHlkDrWfIEMR3raBQoVQKAev6flu OZUT24zMJEVYQfA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH vz10] selftests: binderfs: skip the stress test without binderfs X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org > binderfs_test_stress mounts binderfs 32 times and asserts on the first > mount, so on a kernel without CONFIG_ANDROID_BINDERFS the case fails > rather than reporting that the filesystem is not there. > > Probe once with a mount into a temporary directory and skip when the > kernel answers ENODEV. Only ENODEV means the filesystem is missing; > anything else is a real failure and still fails, as does a temporary > directory we cannot create. > > https://virtuozzo.atlassian.net/browse/VSTOR-142449 > Feature: fix selftests > Signed-off-by: Eva Kurchatova > > diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c > index 319567f0fae14..5d47e27e9dab8 100644 > --- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c > +++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c > @@ -379,6 +379,17 @@ static void *binder_version_thread(void *data) > */ > TEST(binderfs_stress) > { > + char probe[] = P_tmpdir "/binderfs_probe_XXXXXX"; > + int probe_ret; > + > + ASSERT_NE(NULL, mkdtemp(probe)); > + probe_ret = mount(NULL, probe, "binder", 0, 0); > + if (!probe_ret) > + umount2(probe, MNT_DETACH); > + rmdir(probe); > + if (probe_ret && errno == ENODEV) errno is checked after rmdir() => original errno has been already lost. > + SKIP(return, "The Android binderfs filesystem is not available"); > + The block is inserted before other declarations, the style is strange. > int fds[1000]; > int syncfds[2]; > pid_t pid; Another angle of view: The probe cannot tell "no binderfs" from "no permission", and the unprivileged case is the whole point. path_mount() rejects an unprivileged caller in may_mount() (fs/namespace.c:4194, -EPERM) before do_new_mount() looks up the filesystem type and returns -ENODEV (fs/namespace.c:3887). A non-root probe therefore always gets EPERM, binderfs present or not. And binderfs_stress is meant to run unprivileged: change_idmaps() writes "0 1" (binderfs_test.c:338), a single-id identity mapping an unprivileged process may write for its own child; change_userns() then gives it setid_userns_root(), and FS_USERNS_MOUNT on binder_fs_type permits the mount inside the userns. So for a non-root run without CONFIG_ANDROID_BINDERFS: - the probe in the parent gets EPERM, errno != ENODEV, no skip; - the child reaches the real mount() inside the userns, gets ENODEV, and ASSERT_EQ(ret, 0) fails - the original problem is untouched. All-in-all, i would suggest another way of fixing it - check /proc/filesystems instead: - tools/testing/selftests/landlock/fs_test.c:131 supports_filesystem(), searches "nodev\t\n"; - tools/testing/selftests/resctrl/resctrlfs.c:756 check_resctrlfs_support(), searches "nodev\tresctrl\n"; - tools/testing/selftests/mm/run_vmtests.sh:440 same for xfs from shell. A helper along with change_mountns(): static bool binderfs_supported(void) { char line[128]; bool ret = false; FILE *f; f = fopen("/proc/filesystems", "r"); if (!f) return true; /* Cannot tell - let the test run and report. */ while (fgets(line, sizeof(line), f)) { /* binderfs has no backing device, hence the "nodev" prefix. */ if (!strcmp(line, "nodev\tbinder\n")) { ret = true; break; } } fclose(f); return ret; } and in TEST(binderfs_stress) right after all declarations: if (!binderfs_supported()) SKIP(return, "The Android binderfs filesystem is not available"); -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel