Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp73471rwl; Wed, 9 Aug 2023 11:06:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGH2Twiun/UsUgwQ7MVwI6W0wEQGUh9RwWfl0rWLwjc5cvXR+Z4PCxZnXu6bYj+4YUOMM2C X-Received: by 2002:a05:6808:1311:b0:3a3:6450:f5c4 with SMTP id y17-20020a056808131100b003a36450f5c4mr112072oiv.4.1691604381676; Wed, 09 Aug 2023 11:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691604381; cv=none; d=google.com; s=arc-20160816; b=ZNznGg50ZxsYXBEFRSGFf7sPQ91x8kJCrJio39nEVI49Cct0lWQRT0u9C1QuxFD4JN nSJwMTxh+AormNoRkiebahehUfNkZOZA7tU99yaF5D0b12jM/42ivJFkh4WfR0brOQMr TJjWKpendDpeFaAdgeNZa+jwq5SpzMDpZQXuCoo8UCHM6FCMYHJC0BDnNHU40VHoeftt rsGXQkG5GsOG6iKC9vguli0Yg5qgNfy+5skeIEYVnOC1mvS445R0jqorUS9un+kR5fAZ Bwzx/hDQgcwOP4NXOVkQ9L3AZP0HgZLKjN17MKOp1d8hwERvPMx86E9ep5ZU2zofnFJR TkIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hnmANJdRCsM71bgRy6P8+oUuaWA/o9muj8vPzSTetCw=; fh=nE/UqZX6qzpWLzz9CgtzS7bs+n+xzJ8NCqsu+2HYlgM=; b=T97yk1Kh536zqhVHYZpYX7cqQcWPHzkzEgSVmNehTMuYuaUAYOISRxYD1s3LA/4wCp +JLYZwBHW8rOL4oRZNyN9xJ7spDlRLNbZld/cX113mX2HnYNpov8IxZuIKd5NuT1czpN fSo+arUCb4ev8tftnXGUcOuoiPcWVK3u0zT7KJKr6gkOtgau9H0PYuXMbxeefwe1amVQ ahXH6ru0GvE5i2eiX9oipI30jwkuNVdg/2cmbCFE+SZ+VYzCr4zJUjiBtdvHPRbmVtOC T+38mr/tIzuCPHLOkyYRZFc4HV0cPovEZudc6x2/U+hdoUhr8SAlo5a3DTv4cFQ43Qq7 hVeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a17090ace1100b002630f63c654si1873686pju.125.2023.08.09.11.06.08; Wed, 09 Aug 2023 11:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbjHIREr (ORCPT + 99 others); Wed, 9 Aug 2023 13:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbjHIREn (ORCPT ); Wed, 9 Aug 2023 13:04:43 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 316DC2100; Wed, 9 Aug 2023 10:04:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42BE811FB; Wed, 9 Aug 2023 10:05:25 -0700 (PDT) Received: from donnerap.arm.com (donnerap.manchester.arm.com [10.32.100.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 144543F59C; Wed, 9 Aug 2023 10:04:41 -0700 (PDT) From: Andre Przywara To: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Shuah Khan Cc: linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] selftests: landlock: allow other ABI versions Date: Wed, 9 Aug 2023 18:04:34 +0100 Message-Id: <20230809170435.1312162-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230809170435.1312162-1-andre.przywara@arm.com> References: <20230809170435.1312162-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At the moment the abi_version subtest of the landlock selftest expects exactly version 3 of the landlock syscall ABI. However older kernels returned a smaller number (or even -1, for the initial code), and the kselftest documentation states that older kernels should still be supported. Relax the test for the return value, to just not accept 0, which was never a value returned by this syscall (the initial ABI version was 1). This fixes kselftests runs on older kernels like on my Ubuntu 20.04 system. Signed-off-by: Andre Przywara --- tools/testing/selftests/landlock/base_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/landlock/base_test.c b/tools/testing/selftests/landlock/base_test.c index 792c3f0a59b4f..1e3b6de57e80e 100644 --- a/tools/testing/selftests/landlock/base_test.c +++ b/tools/testing/selftests/landlock/base_test.c @@ -75,7 +75,7 @@ TEST(abi_version) const struct landlock_ruleset_attr ruleset_attr = { .handled_access_fs = LANDLOCK_ACCESS_FS_READ_FILE, }; - ASSERT_EQ(3, landlock_create_ruleset(NULL, 0, + ASSERT_NE(0, landlock_create_ruleset(NULL, 0, LANDLOCK_CREATE_RULESET_VERSION)); ASSERT_EQ(-1, landlock_create_ruleset(&ruleset_attr, 0, -- 2.25.1