Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp253882pxj; Tue, 18 May 2021 02:33:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA2Sd6PPPGWiQzT1lTSDg+u0t0RmMXTiVPm3oLfKfgOPFYpYBB7dMmnwg+mryZGY0foMKK X-Received: by 2002:a02:900b:: with SMTP id w11mr1897443jaf.5.1621330437749; Tue, 18 May 2021 02:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621330437; cv=none; d=google.com; s=arc-20160816; b=G7PbXMRQOyKB/SNmfYp6zI0SVs9OXa/5S7ggqNcmxV6jGObaakr1I+phkflyPO2MDI Vzfu+RZmnxnGn2Fk2Pc+kBbSlek8EEsLJYru96ufUs4CmYiKG8jJF9qqlN7Wu1ILpU9v +t9kEag6IwrKVM+ghTAe4zzrbMZ9cKWZq4+dBZIZ3AXSGMQk+isyqPebVBRIHhkIn15P SYYZpvRfaF5p6QSP9Lak8XbFmpSXYa1xeq30iZOfe4EabB8PIFAhAGB48e75F0AIQeNb kzvn6f8xMp+sMnuReZhTcpmcJ0oK1TohLjPeKDEKBMs4ez7sBAqEFJgZWqaG2STXE1S5 KXpw== 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=xsz+vGwRUxo0qPlFMYjycKErODu/8pRzdRcL630FiL0=; b=gcGNS2Br2zbIRdEhVHVUy0yzJU942TKUlhqndEwsWkaaWgfJ42FdY+VK/E+ZmRf6/i +HTQl5FO/zwNewbAJ8zussLfRdnl3vpH+mrCOQojq3NzH4atrF2sIwH7f0k+GpCD8WZr 6qHBQNcxhRyxvgYXA20L+qzDZywY/5HzwMrkTxkfchLFKoV76H/FGoQ/Ma4VeuQFHk32 SQguVCrMjXP/X/TeaVVPu4zFj3b92whW97My9V+pyIw2BV5WGI/WXoWBWixvFf5OPoyk 5vjR1cpm0azC4OVCD12YRd84QEqQP0bcQ3n6xCgd4e/Ygcl17P3amA3SI2ngsOX7JqTZ s8nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vFovEFYF; 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 o9si5785980ils.154.2021.05.18.02.33.43; Tue, 18 May 2021 02:33:57 -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=vFovEFYF; 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 S241419AbhEQPGn (ORCPT + 99 others); Mon, 17 May 2021 11:06:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:49854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241324AbhEQO5E (ORCPT ); Mon, 17 May 2021 10:57:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCF8B613C3; Mon, 17 May 2021 14:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261539; bh=eFLFcCVjj/Juat7SVA7Sv9+IO9Wv0EhmVYpN/GkN9u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFovEFYFLimZVP2c6h1UvSTQKETi0ZKgahMPy/bOXlFbjlr8NXoPHIedU1XpMYWTM BSOxI+r2YaFX4umv/Q6EnAzU9bm4/aCGZhJjQOzunVMRihhSa+axcjQWgiED+zbQUx gODXPhPxCZ9qL2BAPx8kukCoo4p7JSx4rrpZJ1Zk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Enderborg , Kees Cook Subject: [PATCH 5.12 360/363] debugfs: Make debugfs_allow RO after init Date: Mon, 17 May 2021 16:03:46 +0200 Message-Id: <20210517140314.768609213@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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: Kees Cook commit 312723a0b34d6d110aa4427a982536bb36ab8471 upstream. Since debugfs_allow is only set at boot time during __init, make it read-only after being set. Fixes: a24c6f7bc923 ("debugfs: Add access restriction option") Cc: Peter Enderborg Reviewed-by: Peter Enderborg Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210405213959.3079432-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman --- fs/debugfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -35,7 +35,7 @@ static struct vfsmount *debugfs_mount; static int debugfs_mount_count; static bool debugfs_registered; -static unsigned int debugfs_allow = DEFAULT_DEBUGFS_ALLOW_BITS; +static unsigned int debugfs_allow __ro_after_init = DEFAULT_DEBUGFS_ALLOW_BITS; /* * Don't allow access attributes to be changed whilst the kernel is locked down