Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp121524iof; Sun, 5 Jun 2022 23:01:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6ZZQ12szJYikH1hRV5yuhql18xsyEhl3XIrpkjAMdhV65RhfKBc8Lwc5nGr+XihzPFTMp X-Received: by 2002:a17:902:9f96:b0:163:dc33:6b72 with SMTP id g22-20020a1709029f9600b00163dc336b72mr22871791plq.34.1654495281480; Sun, 05 Jun 2022 23:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495281; cv=none; d=google.com; s=arc-20160816; b=VMKwpXeqB8IPxtsXO0npIpGxoUr+6LFbYs78uZi4W5EuXayvRBWRWjfkOm6WTOvd5X VJRt3rwuHJI86SqJHuNNbywfP7IbYvfZrREzwz1YhXGDgSYV8o3ziFimGDTmpmqFmxOQ wQz/NHq24ah+xqT3EGN9Mog4RX3csXMWa92pxFxlV9sdsu+MiDBhpSrEahYKPm/tfs3Y eLffCCYA704iqfOByxd6GMvXDHu19sn5i3xiGwER2yyyeGIfLFudZcUeA38Mu0odUCiC 2J13kSiUfB2qQwOT45qm8JPcsRb1B1OM5q1Vpmq/DM8gHYiLycq8TeeMPxHVZLAcirCb h2hQ== 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=ByXtcM+OrOY1v6uCSNcvvX4gStw2O8mA50rcXNmuF4c=; b=AK9Ww93Yybc0MsVu3je7pmOx0/KRSzzJsVUcGvjAGMmH+g271/AvVuoVbnzut1g8lM VA9Wya9/HqdhHTvDYNrpLqGrXJIujgjZjpgOVPM5QJCkmjDRugNkVGS3HXImwAuvkq1B 80Y8xplF8aSqQnxXfyJk+IszMmb+RG6XI4LcHMEMgM4YbYy2MuiULSNOGIKwdDEEVBiP Z7O4t5GceFYRKKOeRngSQZISa7aFVpWb+EnTOAYuNpPC5igN79mXA0G186AcuD471bv+ +nqPcMkKwKnPeN8uLt44OQs7xMKyWzFMTnUBo/UJvVnaHej4lOPgJ++/83+M8PCBBi1H +lDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cnETZ8Mz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id 28-20020a630b1c000000b003fddf71dacasi877839pgl.666.2022.06.05.23.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:01:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cnETZ8Mz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 6F7032FFA97; Sun, 5 Jun 2022 21:49:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347352AbiFCSF4 (ORCPT + 99 others); Fri, 3 Jun 2022 14:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346382AbiFCRvH (ORCPT ); Fri, 3 Jun 2022 13:51:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA4454BEE; Fri, 3 Jun 2022 10:47:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id F1EBBB82419; Fri, 3 Jun 2022 17:47:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 455AFC385A9; Fri, 3 Jun 2022 17:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278471; bh=Q8CnHLsLepW4XKMWQD92Z0o3evO6/YHu3TkLR5iToKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnETZ8Mz7P4DY+Dvr+1WDDa64W+4Cn+C3AYWTI9SkoLOx3TWoN10dJhLem3KrTAJ1 6pxZrodxmmBy2MSoLl4zHE8XGR9+/M0L1RbcEUaUiroY0nhAGMDeLaoWpDsmoTfX9k XAjdpCzWi3oBGAAK/X0j8D323fSD9jh0VoBCHxI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sarthak Kukreti , Kees Cook , Mike Snitzer Subject: [PATCH 5.10 43/53] dm verity: set DM_TARGET_IMMUTABLE feature flag Date: Fri, 3 Jun 2022 19:43:28 +0200 Message-Id: <20220603173819.973095357@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173818.716010877@linuxfoundation.org> References: <20220603173818.716010877@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: Sarthak Kukreti commit 4caae58406f8ceb741603eee460d79bacca9b1b5 upstream. The device-mapper framework provides a mechanism to mark targets as immutable (and hence fail table reloads that try to change the target type). Add the DM_TARGET_IMMUTABLE flag to the dm-verity target's feature flags to prevent switching the verity target with a different target type. Fixes: a4ffc152198e ("dm: add verity target") Cc: stable@vger.kernel.org Signed-off-by: Sarthak Kukreti Reviewed-by: Kees Cook Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-verity-target.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1242,6 +1242,7 @@ bad: static struct target_type verity_target = { .name = "verity", + .features = DM_TARGET_IMMUTABLE, .version = {1, 7, 0}, .module = THIS_MODULE, .ctr = verity_ctr,