Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2893063rdb; Wed, 4 Oct 2023 15:11:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQSOCfdiix3jbZomQY7bxRMGdmgnFbxo6QIXW/qq9unkuAK1mLNipMlcPdDzqvcMtrxYix X-Received: by 2002:a05:6808:343:b0:3af:6595:e53 with SMTP id j3-20020a056808034300b003af65950e53mr3877244oie.13.1696457483329; Wed, 04 Oct 2023 15:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696457483; cv=none; d=google.com; s=arc-20160816; b=MmleneTTedW2WOzxA6PJoEQ/OB6/SqmI/LdXr4N5vlhV+0WjccaH7pVJX0hocP++eI 6sh4h37KhuAkW3ZtIXpxbwiueOTqAbo4ZzDBbEedvoFWti08EOwa7WngLvG7PTm0fcpc JnzyIWmOzBkclrgJwm6jPJjjrFUGbJKU/hKQJHYUCoc61oeVYAMYJMBbbwMRUjpKFvie Qtpza2cLluhBnFDgqITkUaM9NoM0b9eIgUaKhcitniJP1sSVk20nNck++LBw+Hmzk4Ka hdv13xGVtI7ubbSmyOpwRaXspk8y+j2BirMnvCGVmTQVgPFE7YoXwjduIUHtt4UMHnZS Q5vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature:dkim-filter; bh=cW99n8OXkptGYBwo2lvuMipxJldHT9R48ujQFfMBHAE=; fh=PhRfb9k/VCaD3nhvPFELAdaSNFsaoc654VPOTTQHJlA=; b=KfLKuxkVvhlWjVDpymDJ7tNDWh+ilNi9PPw4Pj9An+TEaO48bSyD7Y7vmwGxwb/x4j Xpu66cFnPa1gDtBe7/jah78xrcw3dpYgmAQ+A0QMyafuoSzX8S1vHIELOxXFURkI9pb3 1qwe1YgyO/iwDeY/Bsy6stTjNfCp7IjnLo+xqVK3oBwWHDxCgidk15wzeDTYyEltbCwo 7DgWJLRt+k1oO6zXdYhex3T0dTi/tKLKL6rmoNfvqiytviC4sTDmXmJPx42iZXnsIPfs sg82Bc6k8oZyPMy1dfjZiZCxBSjaJOspAN95jyWHh+6N09CuwGBVcRhp7kveoxG8XBbn FFhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=HlbE3xQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k63-20020a638442000000b00578ca217736si57207pgd.719.2023.10.04.15.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 15:11:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=HlbE3xQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A2944807D8CC; Wed, 4 Oct 2023 15:10:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236966AbjJDWKJ (ORCPT + 99 others); Wed, 4 Oct 2023 18:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233516AbjJDWJ5 (ORCPT ); Wed, 4 Oct 2023 18:09:57 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 80E98DC; Wed, 4 Oct 2023 15:09:54 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1052) id C517A20B74D6; Wed, 4 Oct 2023 15:09:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C517A20B74D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1696457390; bh=cW99n8OXkptGYBwo2lvuMipxJldHT9R48ujQFfMBHAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlbE3xQQD91xPZObjg/CgUE2QU0zJNs+fz69nDWpG2Pro/oeWXN/aaXplO/MMdwnC flp9VyW+sc5xtgwh7Sv8472Td4ThXyh32Q2LzLtm/FCK7mFyD2as88RP80K0dMVIxo bet1LExMUHKfFUO1fcNWYtbZGl7LrIidZ5H9/AcQ= From: Fan Wu To: corbet@lwn.net, zohar@linux.ibm.com, jmorris@namei.org, serge@hallyn.com, tytso@mit.edu, ebiggers@kernel.org, axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, eparis@redhat.com, paul@paul-moore.com Cc: linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org, dm-devel@redhat.com, audit@vger.kernel.org, roberto.sassu@huawei.com, linux-kernel@vger.kernel.org, Fan Wu Subject: [RFC PATCH v11 11/19] dm verity: set DM_TARGET_SINGLETON feature flag Date: Wed, 4 Oct 2023 15:09:38 -0700 Message-Id: <1696457386-3010-12-git-send-email-wufan@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1696457386-3010-1-git-send-email-wufan@linux.microsoft.com> References: <1696457386-3010-1-git-send-email-wufan@linux.microsoft.com> X-Spam-Status: No, score=-17.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,SPF_HELO_PASS,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 15:10:12 -0700 (PDT) The device-mapper has a flag to mark targets as singleton, which is a required flag for immutable targets. Without this flag, multiple dm-verity targets can be added to a mapped device, which has no practical use cases and will let dm_table_get_immutable_target return NULL. This patch adds the missing flag, restricting only one dm-verity target per mapped device. Signed-off-by: Fan Wu --- v1-v10: + Not present --- drivers/md/dm-verity-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 26adcfea0302..80673b66c194 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1503,7 +1503,7 @@ int dm_verity_get_root_digest(struct dm_target *ti, u8 **root_digest, unsigned i static struct target_type verity_target = { .name = "verity", - .features = DM_TARGET_IMMUTABLE, + .features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE, .version = {1, 9, 0}, .module = THIS_MODULE, .ctr = verity_ctr, -- 2.25.1