Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp182960rbe; Wed, 28 Feb 2024 16:59:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVy1CxCGB4/Mu5FpPjbBVvzLDuyWJ0LQtyIih1JRtcqsUiqa7E0cGvahmUlKdfrfRq0hwI8xwcSbDnUOWSt8JFWYcD0NuuOyaFEK8/h1g== X-Google-Smtp-Source: AGHT+IFeiwx6mM/NxQwfqdbTW7McF8q27mIKAjUW29Vmez6c0xzJ+++BrWjLl2+WG1ZiQ9QHiKIP X-Received: by 2002:a05:622a:1788:b0:42c:66fd:3fc with SMTP id s8-20020a05622a178800b0042c66fd03fcmr626844qtk.56.1709168375363; Wed, 28 Feb 2024 16:59:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709168375; cv=pass; d=google.com; s=arc-20160816; b=wWjLa8e11oN5PysPF4k5T9tBjV+FbmagLKzIMxVY27uB9xkh44iclkbP+AIJ4/EfbK B8hnsMyogGHBvSTMbrXT64N209LneDhhH2T1CYhtvvQjFASUM5M8QSzW6/V6nd/CVOVP Kt5ELrIwBuAmMtHcGF/yCrYJun369gRjnNKlQx0uo6Jb1ixStYEDD2azz6P3BWF5+mY/ x4gmhdRlYhMSCYOhXmF7uk+nN59fZijVLCXHqb9kXNUwt6S8mvNJYRJxOLBiAnAjg8Md Hitwhb+Vl8/lHCe21e62zEjQymxKgJuhGbWhXhFSxVjmkJU+49OZ7nVePKuZocVMNQq+ wVwg== 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=XBFNFhZO2C2cRsijb6fK7ukrFdTouoAgBmyOuq/elfU=; fh=OyVWwaN4k6amVBbLsUrv/LtzT4uXeXlIwg6oMI9yoyM=; b=WhfnL6ldC8nrGi217d0UnZFUNwALC64i/CEhBvNlgLWpFPJeiZqrzfXW5YfB2aiVgl 3onUMlgem7bF6uNcGBj6vgTryrUS4BtrZwx17tMSdk+pKhysTDIorIb11+mNy9Lgc8r4 vBb1xquZdyyvM2lBFdMbkxEzf+QFueMlfZVc4WzaCgDlzPj9x1nPekmw8M9cDmtxXWOf CuX7U0X2z5yghdyIUOgHy4bBgvLiQiD22N9cJ6XovYk5UdZ1bA8dL5ixqXiBaJli4zCg xzLIo5V1QixQO3VenE8l394YAUDL3AdORxEISsWpynla+yUQ6G0NQOkOSUriDzZ9sogk kFcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=akULg1jo; 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-85953-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85953-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 ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f17-20020ac87f11000000b0042c2eac1cf6si394318qtk.720.2024.02.28.16.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 16:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85953-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=akULg1jo; 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-85953-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85953-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1624E1C24084 for ; Thu, 29 Feb 2024 00:59:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 385C84EB4C; Thu, 29 Feb 2024 00:55:34 +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="akULg1jo" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C370F36AEE; Thu, 29 Feb 2024 00:55:23 +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=1709168127; cv=none; b=Yk4IoxQ1rKt3KigAyuehdhsgHTo5PXZEOr/MuAD56PrrsGznX79LZ33MM4PuP+ZHsJlEQPKXXrrjk7eeJ2rQH3eaZbPDUccar9s7k2/BdyXT0R2QLAvQEFme4TP5ivQRbDfWJPtDROfgTSkLGDlEpSa6cBo/MpIdz2o1H8ylLZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709168127; c=relaxed/simple; bh=nLFXtzeBcjiMKyMP6dpEwHa6q1zR5t7lNC5xVrWtFS8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=A/LF5O+REb+/XkdOTY32Zl85PjlNq0m8+Ylf/d9EfrjCxq+2tWZsfflPgwYY17gA5sDkXuszHV6mqF/UvUrGOLlWX/vDxWoKgmLMvGSniQFhNpmZZjBgBWTRI9PxRgeUdiGtI0T/x6Wzw7aXtAWBW76W9eSiEPBDQw8uRXY274M= 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=akULg1jo; 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 1564520B74D7; Wed, 28 Feb 2024 16:55:18 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1564520B74D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709168119; bh=XBFNFhZO2C2cRsijb6fK7ukrFdTouoAgBmyOuq/elfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=akULg1jo9HtuVSFYgZ5rHE30PjIwlaYO8eGr0+bgCMSgRzruoP0iDYZkNCxbB1/3W DAGe4s+Ugn5lUI1avwC6PBE/UyWsljIXqa5zo/+Y8UtoCKpTqdkn1b8KKXCHz9zxBj 267R6svgGCoUuVJERRazmMIXQZZFdBEkp6nWYNpE= 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 v13 12/20] dm verity: set DM_TARGET_SINGLETON feature flag Date: Wed, 28 Feb 2024 16:54:54 -0800 Message-Id: <1709168102-7677-13-git-send-email-wufan@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709168102-7677-1-git-send-email-wufan@linux.microsoft.com> References: <1709168102-7677-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. Also from dm_table_get_immutable_target(), it documented that "Immutable target is implicitly a singleton". 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 v13: + 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 1b591bfa90d5..a99ef30e45ca 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1559,7 +1559,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, 10, 0}, .module = THIS_MODULE, .ctr = verity_ctr, -- 2.43.1