Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1307558rdb; Tue, 30 Jan 2024 14:41:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcuTUEBa4UX0X/PRPFElxRptaLYAfEXPzIlXhLO3/bOLADAaw9ITcn0fzi9XbOWb46M1Id X-Received: by 2002:a17:902:7ed6:b0:1d5:36db:e8b0 with SMTP id p22-20020a1709027ed600b001d536dbe8b0mr7717519plb.63.1706654491338; Tue, 30 Jan 2024 14:41:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706654491; cv=pass; d=google.com; s=arc-20160816; b=BNa22gziBErht6qdvjueqDbw+7QzryAGytKWSV0NHJ97rz+rbf0YWrRCR3IhqqbPlq Vtmg8c2yE9EwPF+bIcIroZ7F+/SxcopUMM9/mGZJQDBm/430A5lq+egPmkmru1KRmLQ/ HfcbMYbqXE/ETPCMIuH3PCb/tKfjbiuVoFctADyefTMXVw5/RztApaDbnXsh1fUgYagx GgNMK5rvXaAbLA8LDqB+QP2I6c6tP8il8z56rYp8fkcs5Ic9XSLjOYR33N6wJrPSWXoD O4rBgnzovXaY5sWrpavuOl9Tpv3hcmMLg+mDxiIqgU17CihbnR6JHRr6w1zi6919UJA6 to8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=Bn8u6PAyziVes0s1hsHk4jpq4JCxu5y2joWk5Bg0G+0=; fh=OyVWwaN4k6amVBbLsUrv/LtzT4uXeXlIwg6oMI9yoyM=; b=vQ+zAbiOC0fLaic5Oo7bLAV54ZtLLofDjOOuOp1KcfnNqv/HmRcJGjYbU/kg+Ja1t1 lBClPqRyICwQ0sUuTDg7/padJGnv/KVpg7op9PHPdzKDs1xOx3wuLUjrF87DkX+6grMd 1O1eSMRkwXGgfnBAJwt0qJ2t3JyBKB1Za6f63V8rj/tq+T2RnxnfDGiH0pcRQX3ljqaF 7wqRXey3LWWEWXi99Kg49iwHv428TB9DvN+7ZJSLeZAEJsqnAmtZ772GypDfss2dOIH0 hxuoIdSWtwC0sLVHbLCPaWYKAqpakQqDyOa7khfxoS2Y4Sv81nNL5VRu3azpt8Lp7fKY M95g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Rh9EW82U; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-45415-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d21-20020a170902b71500b001d74bf99a3bsi8079169pls.575.2024.01.30.14.41.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 14:41:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45415-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Rh9EW82U; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-45415-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 53DAE28857E for ; Tue, 30 Jan 2024 22:41:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E52079DC4; Tue, 30 Jan 2024 22:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Rh9EW82U" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D0B512CD87; Tue, 30 Jan 2024 22:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706654250; cv=none; b=ncXNAMheC9skD4JLf7ijxbhCVkaPmNmSk01UUH63fzP+rg+lTO86m1dfqaQMx2Z2bWdpotraF+VdmTqwxSWfryBWta576jjUgBqaM1HDlimsXmW/aSzZR9ZeTWZTdO3NiDsjil5jzTxseSTw2XKxAINsXz6qyESGRbTk2cRMMbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706654250; c=relaxed/simple; bh=e+4lAQRk+1sqWv+mWddB1VL2xD4FFXo+2TSqecsvggQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=kE7SLa9w5Vjgg+4HTPI24AnBM9cPfUvqHuHID7eMMxVC3YwMnWKfQlBx2Q1BG2/m6Y70iT7aUDXapZNdlfvndJneq00eTw7LVNGOYj1qGPExoBLXtHLbGfTYZerP1tTPDV8sKCnFDnAraOQH3ambwEpfGHEkf60kvefFZnk7mtc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Rh9EW82U; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1052) id 9987720B2015; Tue, 30 Jan 2024 14:37:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9987720B2015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1706654242; bh=Bn8u6PAyziVes0s1hsHk4jpq4JCxu5y2joWk5Bg0G+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rh9EW82UHPEc63gzo6A71jZ0RXefXsNEOrBrjIzHQOH6O3ROai3DR6IzwuFsQS52P d4VHrYnGT+n1wBbLsv7kWO69RcAyb6EztZUaAOv5rjr2HGBB6y4cCyX8SHskPEzgSY jtE6s7yVHZGWgBIbuhej61FM7JlaTjOKe10n4Bw0= 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@lists.linux.dev, audit@vger.kernel.org, linux-kernel@vger.kernel.org, Fan Wu Subject: [RFC PATCH v12 12/20] dm verity: set DM_TARGET_SINGLETON feature flag Date: Tue, 30 Jan 2024 14:37:00 -0800 Message-Id: <1706654228-17180-13-git-send-email-wufan@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1706654228-17180-1-git-send-email-wufan@linux.microsoft.com> References: <1706654228-17180-1-git-send-email-wufan@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 v11: + Introduced v12: + No changes --- 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 14e58ae70521..66a850c02be4 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1507,7 +1507,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.43.0