Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2205588iof; Tue, 7 Jun 2022 23:10:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDRYqV7G/fqGQxzDCPlIJn7XT74lgDXtJoLuFsRwuiD10C8LrAoFn8JJE+FevJyRkLe7jh X-Received: by 2002:a17:903:209:b0:161:7f66:b9e0 with SMTP id r9-20020a170903020900b001617f66b9e0mr32305861plh.73.1654668609200; Tue, 07 Jun 2022 23:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668609; cv=none; d=google.com; s=arc-20160816; b=0lz7L4r+7iKI9AWp7QOAYV/YjRc3AnTn7Jd/aIXNrXzMVyXlnDURuCVqrklIAxA3hh axlf7VgV+CmuGn48PMoSShzPmiPcfBUXtbLJDHub8QfRN158UOhUC358MEtRsGqoL9c0 opny6GHSE62JGqRlQpAzeXA7VA3w8RtahGZoYFbfy7vBCEHIMEIRwJ1GCBZCw8wVQj4x 4VLyc4j44pAVKpdstOK8WbA5o6wYr4U+SEeMshqbLqDWBXqxV1Yz1tCMesqEl/+x3+pZ Vt2ZGGpTHC99AUHGLUOKL/xHGbM4BfgfscmbDSgCs6WuPBpEl+/yDtZIvMhMDOj0f2yh xAQw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nm/CPOotpQDfMSDwGekl/cxvwFyePk7nZfP8hyNKLMA=; b=sE6LCB6e2E2wZ7DcztnxZnz0RNxViLNI3ece+f5Hw70NnNMBv6VbExLaOInjpDBe9+ hw9i0PHye2DDezuUFcaj4sjXKwPEj9TnbXCyUPugarE0zvQCQRcaXBc9xojHiJiZhH45 cWQvaUQ7uIjecADDYP9Ujw7sLzOLGiEDJPBh/ydyx6jjQzOsdLK95fJDHa0jKarhuIdJ 7TbmHBtH88oF5G9rr3hrxkanlnKF8kpZxv/a0th91FRH7aEVYS/2By0ANTjFQWUAK3O8 LNWyxWFwDcyIcsD3EANHl97Q2XpSFjSf2Jz+5SJ7sF0U1uz8eyOUryJBwThO7XKpsfNm cL7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0n1rA8QA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 5-20020a630f45000000b003fd9e43f9bfsi12513923pgp.393.2022.06.07.23.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0n1rA8QA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD9544ACD7C; Tue, 7 Jun 2022 22:32:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359505AbiFHBkJ (ORCPT + 99 others); Tue, 7 Jun 2022 21:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385335AbiFGWVc (ORCPT ); Tue, 7 Jun 2022 18:21:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9674319948A; Tue, 7 Jun 2022 12:21:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF25D60A21; Tue, 7 Jun 2022 19:21:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02756C385A2; Tue, 7 Jun 2022 19:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629680; bh=sFYoKH3ur13xudM/5aKhDJvPwSJ1dZo6go0R0tMxJR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0n1rA8QAs0gSntiWvi7IcXcN2OgsUqmEU3Q6D0vMM/q7zqCH8UP7YTPif0l1mufZG ElGE2HPU2M0vwh7xe7SH5w2W0nPkNKtx4H9QfPUeKoiHXAey0QQmAjvix8nBGNbIDm k/9RufZDiwDMwA0rWryuWucUbN0lxZkHMDcA5BmM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Subject: [PATCH 5.18 779/879] selftests/landlock: Extend tests for minimal valid attribute size Date: Tue, 7 Jun 2022 19:04:57 +0200 Message-Id: <20220607165025.482010559@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Mickaël Salaün commit 291865bd7e8bb4b4033d341fa02dafa728e6378c upstream. This might be useful when the struct landlock_ruleset_attr will get more fields. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-4-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/landlock/base_test.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/testing/selftests/landlock/base_test.c +++ b/tools/testing/selftests/landlock/base_test.c @@ -35,6 +35,8 @@ TEST(inconsistent_attr) ASSERT_EQ(EINVAL, errno); ASSERT_EQ(-1, landlock_create_ruleset(ruleset_attr, 1, 0)); ASSERT_EQ(EINVAL, errno); + ASSERT_EQ(-1, landlock_create_ruleset(ruleset_attr, 7, 0)); + ASSERT_EQ(EINVAL, errno); ASSERT_EQ(-1, landlock_create_ruleset(NULL, 1, 0)); /* The size if less than sizeof(struct landlock_attr_enforce). */ @@ -47,6 +49,9 @@ TEST(inconsistent_attr) ASSERT_EQ(-1, landlock_create_ruleset(ruleset_attr, page_size + 1, 0)); ASSERT_EQ(E2BIG, errno); + /* Checks minimal valid attribute size. */ + ASSERT_EQ(-1, landlock_create_ruleset(ruleset_attr, 8, 0)); + ASSERT_EQ(ENOMSG, errno); ASSERT_EQ(-1, landlock_create_ruleset( ruleset_attr, sizeof(struct landlock_ruleset_attr), 0));