Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp63272iof; Sun, 5 Jun 2022 21:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF5G6+ABAWWHlDToWShLQ+VDEF81KRrt7NSRSyeEUb5Ac5skZWL5gwpUcmaIgY1T2tb2rL X-Received: by 2002:a05:6a00:807:b0:51b:f4b5:db82 with SMTP id m7-20020a056a00080700b0051bf4b5db82mr10313683pfk.57.1654488728236; Sun, 05 Jun 2022 21:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654488728; cv=none; d=google.com; s=arc-20160816; b=R479ZfDUyVAXhqMKVYkBamxUo5vf7WTWG4fQCw2oxUE9R122xonRG2O4VU75VUvz8O nHGWv8ManerXH+J3AH7OiRf8R2Ig2bP0wew/+jMs1AamWgAeJT1jsrwS5AdMdYOKuSx+ d/DTPUHrl8m0u8EVF1UwTNawYdQt63Xlv8g+HEyIfU5XkhDpBKdlIFPJCsWiGvXdmlUn 7xRe9nbbd719cuuhpFT6qYUknJHCIg62H7VGV2lIgkggoTx1rUPXr/KKBMdZM38V9+AN vNyYWnddUOXHoLPODz9iwsdNbmd0Ev1915YF66su1mh1bWmJuy7oQnFYzNlUzjAwHFZu L7mQ== 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=IuE5dkIFRc2nH8wc+tpsg0uetyj9pGhZtrRQmjZ7xpA=; b=P78VkG6IdY3mMZ3EvLmx3DrNAZWXBXOTwRY35rjvujhLrGXzF6MSpiuFaLkILXtPUG M2Fv+GtHXTABG00qMmeduV9DpsmU4d+cKck0i9SSfuISH3BAnRWiVdPEHINPP/v/JUfZ jO9Ckxih1ov3Whji8BXjHRnhPNBxSDX4s98ca3yCuPJnie497QtTjTcDFbfl08MOWgJc 09uR6RfnKCZl2MoDumhYJhlCwLbtr8DFr+GW4DGEt3Tu3XJNwu/QYq33FD04fTXvAffO Z6WP13aoUNuwZkbk3bUdN/JvQucRDQdbx03S2/MsHdlNvrlOyt34zhQWAQZXxWtdBjT3 zpOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=htcfgWiu; 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 f15-20020a170902684f00b0015893aa584csi17348358pln.272.2022.06.05.21.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:12:08 -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=htcfgWiu; 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 2D66972E00; Sun, 5 Jun 2022 20:50:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbiFCRmq (ORCPT + 99 others); Fri, 3 Jun 2022 13:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344897AbiFCRl6 (ORCPT ); Fri, 3 Jun 2022 13:41:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F8E53A66; Fri, 3 Jun 2022 10:41:24 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 935CB61B00; Fri, 3 Jun 2022 17:41:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D942C385A9; Fri, 3 Jun 2022 17:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278083; bh=SNi0esmcOt+osBhcDREYjYRuCny0Bw5N6A5oulrF3Mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=htcfgWiuFj57+5iyuK1S56ioyfzxJgNELoeUOJYpQfuhpb+ofwqvrVMyA40D23hsX xxmmoCQzRAPKC7ylQi0CvRB+fS59ycN16l2P2soxNrHlEt3z92U8c8amkclg47oKCs XBUOmpsai1ICZXAFepyr5jycYUrXcGk4bVC0Y0PE= 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.14 19/23] dm verity: set DM_TARGET_IMMUTABLE feature flag Date: Fri, 3 Jun 2022 19:39:46 +0200 Message-Id: <20220603173814.944801303@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173814.362515009@linuxfoundation.org> References: <20220603173814.362515009@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 @@ -1163,6 +1163,7 @@ bad: static struct target_type verity_target = { .name = "verity", + .features = DM_TARGET_IMMUTABLE, .version = {1, 3, 0}, .module = THIS_MODULE, .ctr = verity_ctr,