Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2649306pxj; Mon, 14 Jun 2021 04:02:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY/1uPO4Qmu6nGV81k+WFFnZnxOyU0m81BxYHdvZyY/r+apGnqH2uPIW1f5IrjLK37bGez X-Received: by 2002:a17:906:2dcb:: with SMTP id h11mr14709096eji.52.1623668528495; Mon, 14 Jun 2021 04:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623668528; cv=none; d=google.com; s=arc-20160816; b=seGIoIpa5xcDZjllYsrJlTQ3EYb4q55Rct9hFvm33ptFVSLepdZvFapqZaLqMJkuwD zcdZDgVK4aj975lmZ+xX8x+Hri3sB/bBZqccTGiiZY6MGFaJwpjYG0LlfilBolbtm9Nw 1fTdMUpM7IVqU1klXe/R88qQIDqmEYojSF+pF+FKhpLYXvMZGP04s8QDHhynlJLT0j66 CJ43OXyKtxqCDC2cZtBdsifEf7lFOk0ma9FjtLX/PHvVKQsiUdjVremdDlhaWchpW+9E Rtm21ZTooCySNnrzwrDXTPNwDxvWt2LVS+vM+C7tAnGv5GprsHMQ4WwoHmbOSP9Cb9ea UJkw== 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=YJJPSxQPnqPf1Nnh6Y5R7u7LRuShD4N9WkohQBmvWKc=; b=mho3bvx3J2f93lVzHZSHOwxf9vsBA3YtWqs/FhREVyDPHINf9Sy6Q0t6zZUxb9eKmg NAk6TC2oJ9RUx5NRohsX27pQKmrnWaRS7JgE5BHlF9e2ou2T9QK/a+Eo05dZVrYaG4yZ 11wdcFHBZ78w26VEFiMAr/R80BwY9jKHi6DpQLlrNBjCCa//Z3prK6d7LXFsKw2EFRW5 2oVRFY+iaR1PUpmMruGfsy8xzlt3F3vOUItoSgmCXE7lXuDIPlLZ2Q09p666rMWuokyJ T6CYOMzpn9t2Hy2jcbw/HvivI9lsWGKnLrBd7wstAhbUorGPa4epZJ0GDoOtJSJaVht1 nHNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="G/eh3Mx3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si11215307edr.161.2021.06.14.04.01.45; Mon, 14 Jun 2021 04:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="G/eh3Mx3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233411AbhFNLB2 (ORCPT + 99 others); Mon, 14 Jun 2021 07:01:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:58832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234575AbhFNKxZ (ORCPT ); Mon, 14 Jun 2021 06:53:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D3036148E; Mon, 14 Jun 2021 10:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667190; bh=VHAXdjdcllNCvOk3Jm+KgEHu0Sx0iGudak86gchl8V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G/eh3Mx36bEIlXHwjl8WwO5AWoTCIuYnfGkAp0fZQlsSJ0a4T6BzbvSYH4UyCKskE ynYxNnyZ8fbM+D7FtN3LAgERYVusTWlYnyyOhWKoHHz6QLBwL+5erbtKvOG8yMndwn L5NMDkFE1sPZrvqbblhNFAys3WKf+dHfrcB7Il+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Keeping , Mike Snitzer , Sasha Levin Subject: [PATCH 5.4 28/84] dm verity: fix require_signatures module_param permissions Date: Mon, 14 Jun 2021 12:27:06 +0200 Message-Id: <20210614102647.311916724@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102646.341387537@linuxfoundation.org> References: <20210614102646.341387537@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Keeping [ Upstream commit 0c1f3193b1cdd21e7182f97dc9bca7d284d18a15 ] The third parameter of module_param() is permissions for the sysfs node but it looks like it is being used as the initial value of the parameter here. In fact, false here equates to omitting the file from sysfs and does not affect the value of require_signatures. Making the parameter writable is not simple because going from false->true is fine but it should not be possible to remove the requirement to verify a signature. But it can be useful to inspect the value of this parameter from userspace, so change the permissions to make a read-only file in sysfs. Signed-off-by: John Keeping Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-verity-verify-sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-verity-verify-sig.c b/drivers/md/dm-verity-verify-sig.c index 614e43db93aa..919154ae4cae 100644 --- a/drivers/md/dm-verity-verify-sig.c +++ b/drivers/md/dm-verity-verify-sig.c @@ -15,7 +15,7 @@ #define DM_VERITY_VERIFY_ERR(s) DM_VERITY_ROOT_HASH_VERIFICATION " " s static bool require_signatures; -module_param(require_signatures, bool, false); +module_param(require_signatures, bool, 0444); MODULE_PARM_DESC(require_signatures, "Verify the roothash of dm-verity hash tree"); -- 2.30.2