Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp64418iof; Sun, 5 Jun 2022 21:14:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvE5FqvMgf/ka2L5f4iz/iiCIZ1t62OwZra+rAWM85xvwzEQ/pBpOJd7oWyAvmM8KALgWC X-Received: by 2002:a17:902:f541:b0:163:f64a:6127 with SMTP id h1-20020a170902f54100b00163f64a6127mr21985131plf.134.1654488857206; Sun, 05 Jun 2022 21:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654488857; cv=none; d=google.com; s=arc-20160816; b=UzGB5lKo+kMLHRyrvFJdmg01QrNj4NFI4u9bqLypoxAnYcP4cuXxZ/C2I7lmfTZCyx bNNiJivgeopq5OVFWL3nAwqhnxtffe+pYCutYb62RBfyhnaxLWyOSMnk3of53SGwMwIx EDtgYiVNcg5JzmtaUfZ7a9OsLyNgHDw0BoxDzH20qNayc5mf9C/bvAa7i8rpcZJ+QKni t3o0nRoxQrCgQivY7ACZOzxU+fRKS9FZkyFWwM5P4w0DTFp5iI7MRuEYZkUZmhBiUYzj kZFv0jE2OnmKriDwSpgdj71+cpUir1wztf53GNfDYb9b1WXYPn5X2XbWM+mNz7QIB+W7 Jzsg== 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=cEC5/u8u9Zyn18+fdJQRPVTXCs6RfwzGQ+HOpwfiyI4=; b=ptFEJZknF54bNwJpFI45k0j9/Rs4mw5sv+WakP/B/PiGsdMZpu03o8HYD4eRjTIWnS sI6KbNn8o3XrPFHCp8r08aASJiYEmFiRNL755seHURgi15qn8VZvct5ChvipZkoa3GpG xyLRwHi2rr2xA+Q8Sgys1yI/nJqUkKfZD7T5HY3CzsIqCcvjDEjwPdsfQQZHXd3CGPjt 4gh1gQY7odip12oH4Q/m8vgUqKqKUJxzkXvIXi4UFWv3OAxejSsyOO/6QclN0gS904xM mhpsXz3WU/r7Xh9zMmlWRupqmCkHvrzcFAYUvr3RlFvS6p3Tc9eixnrb08WinKrI+sXr 7Hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1WYb1BAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u21-20020a056a00159500b0050d8195100bsi8924533pfk.7.2022.06.05.21.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1WYb1BAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 750E77B9ED; Sun, 5 Jun 2022 20:51:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345246AbiFCRqR (ORCPT + 99 others); Fri, 3 Jun 2022 13:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345419AbiFCRpU (ORCPT ); Fri, 3 Jun 2022 13:45:20 -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 B386A562C9; Fri, 3 Jun 2022 10:43:10 -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 36E7FB823B0; Fri, 3 Jun 2022 17:43:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92322C385A9; Fri, 3 Jun 2022 17:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278188; bh=iPOD9cBIGaL31sCMFKggP2a5oP8aJPGCy6oGbeLLb/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1WYb1BAiIGfoHnQfvsod98HiC+S8SSTh0m6Y8aFmdjjwCfvafa6rbI+3tJrq7Dc75 zZIPdEhxU/CbSMnDTtUWAL9OV57CQpkmBZhbY+pD63eM2P0lmXK9EF33Myk8B0U9sM +QbfHhZso/Jl6xSoG43ies8sjJ5+EkGVAwh9DnYQ= 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 4.19 24/30] dm verity: set DM_TARGET_IMMUTABLE feature flag Date: Fri, 3 Jun 2022 19:39:52 +0200 Message-Id: <20220603173815.803602103@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173815.088143764@linuxfoundation.org> References: <20220603173815.088143764@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 @@ -1176,6 +1176,7 @@ bad: static struct target_type verity_target = { .name = "verity", + .features = DM_TARGET_IMMUTABLE, .version = {1, 4, 0}, .module = THIS_MODULE, .ctr = verity_ctr,