Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp9226528ioo; Sun, 5 Jun 2022 08:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2JT72MmftXNWOAfy6bHT+q+/4Cgim3TK3ef/4s1T4HHtbEVAwBGuESsa0k7Xx3swOvNQ7 X-Received: by 2002:a17:907:971a:b0:6fe:bdf6:b67e with SMTP id jg26-20020a170907971a00b006febdf6b67emr16979508ejc.312.1654442822519; Sun, 05 Jun 2022 08:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654442822; cv=none; d=google.com; s=arc-20160816; b=Yhq4hLlyE4zjfZtXPuqFt3xMAadDoJ4CrvFf+pRK/nIv3A094cEZWANSyIOlABeoDD CUZbKlgutoLXbEXGiEvW26s6E8QVpnVuHBqGrdqh6/tgqCLP8T5nzPyfAjoQWNYKiJVQ 8A4NwiUMDej1+5/gkshPY61ohedDHkHMMxsGdCmqRii5Yu8CUwDAJJQy4WMCFozBof6i 7vWh3vUJT0WenaQCAowCu3zIzOG+XdeYE4Q62Ym8ki5u2IpMVo+HNZjywOOoiJVL3ztW 3QQFehtQ7fp4zPP4fztJqdzdVu1q9gMvW1F/8w4ib/nsi4x6Z1sFcTtfeKhZqFqTRUSP RchQ== 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=BMT0EKhj8lPmkL2R5UcSPUkXs8HD09tVy4mnsXZLltw=; b=AY9uyrrV+rsQD6KjllUueNg4kMYvBAog8wQ0QmRKY1RCvnfASAVTKpI1TUVVPLMDmX P5Jv5mLOVHm9Tm9Rq1+8FNmqO1UmWO1VTk4+cm33alumv+F1nR6cUfXHv8le0BSTMALE ewNWOlvC8NlO9j5Zj6qUh2j8pF1kgMXTImN75njqRQw8WptnPWSZwiXXq9COvDuDcWtf WvjoYV699lD6Cdx3Lqt9YFDDSbtaV4y2nWcZlZAbaZhb21sy0HT+63PTV20oMUX+nSiD 1qxTdLI+Zr3z552Nb15U8kn8gTd1NLQPdmzOP0iK7Z9hGcsy4cBkecWETgVW1PcQLAmZ QoJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="T/CdcPna"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a056402350b00b00430328fe4a1si6696858edd.402.2022.06.05.08.26.27; Sun, 05 Jun 2022 08:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="T/CdcPna"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345288AbiFCRtM (ORCPT + 99 others); Fri, 3 Jun 2022 13:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345301AbiFCRsN (ORCPT ); Fri, 3 Jun 2022 13:48:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE6E5419E; Fri, 3 Jun 2022 10:45:15 -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 2B5E6B8241E; Fri, 3 Jun 2022 17:45:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F62FC385B8; Fri, 3 Jun 2022 17:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278312; bh=47f7J/bvqDmwI8W51pEpNDULYt1Cvzwange2OEDeQes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/CdcPna1r37hO6SWu8/MF86llSCejlqO8zNLN6l7VbCP0ZrtmlhNtKz5KhR46S3c kIy5nECZCOyQ7/z5ocL8tr7sut4VPWI4/PaOsPTfgOFYLHuq9pS56uxFnEz93vFpiw 0jU+5wo9CPt2Rn3yyfoxRbeC6siovqHajTtH/GtU= 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.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag Date: Fri, 3 Jun 2022 19:43:22 +0200 Message-Id: <20220603173816.944766454@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173815.990072516@linuxfoundation.org> References: <20220603173815.990072516@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 @@ -1217,6 +1217,7 @@ bad: static struct target_type verity_target = { .name = "verity", + .features = DM_TARGET_IMMUTABLE, .version = {1, 5, 0}, .module = THIS_MODULE, .ctr = verity_ctr,