Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp663605pxj; Tue, 18 May 2021 11:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ0ROflYTMobfqlFi9q8YwaNXgERoq6rGOpMiS9iMrrgMbWMZkVvcQnOf/8Yd0H6EksbjU X-Received: by 2002:aa7:c488:: with SMTP id m8mr8432020edq.193.1621361889478; Tue, 18 May 2021 11:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621361889; cv=none; d=google.com; s=arc-20160816; b=lopzLzNtF6bWxgBIjyjo+kx9D8bVlSngKM0MI9KZDUAS1vSvHBYPa1JWtlKVoyK4ps OEHt25WSnU//6pp9A8S5rXDLYK5gkkcI7IifhkMBk1xzljw3GMzv03cGGr+EVurPcs1Y Iwk5D99K4g1eNrSjHTQanQo1U/zgZwP0bowlOKMJpvR0N4Q9pRHKDz1JcukcoeG8oSig jlDC6y+VZOY7uyxcHPLgIOSHJWj755intY/mWaiDFOXb8vH4Kz0UGMI3x1tSKWHLaHkd Kjuaslejk9KuNhACFKY1c3ZxYBSpjLl72CNukRfiJAM29eFBSJu24E+v/NF0pg3lzoWS VncQ== 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=Gj+0GCXSBHwuFHz0aon+nwJozF2T9tQnv2f55Fi1T1jk5yazM/TFel+7JDJtg42HRE 3y+h2ONQyNs2pnverTcEwaN2EkidYwkzeU1K4bNagLpyCe/YtThKjgjUP377bCpGNh3j o47aGV7Wy7S0BESIO2gIyEydrYsaeM/+Vf3A/izKES1DXW54VksRCHi3umOD00Qy3x+l DEy6CNO0CYNasn4hqFkMevninRmCJUx1T3P3INMUYw8ci/DOT6W+b7I1scb7ISNLLeYa 1l+iClROqOmfhzcvHmeH4fp1xaZTnA6xHGkauwxZDPvvuDGsZsjUffW7YYNk/X2QzXO+ OF+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xqUWHg0G; 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 u10si18430712ejk.397.2021.05.18.11.17.46; Tue, 18 May 2021 11:18:09 -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=xqUWHg0G; 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 S1343966AbhEQQOL (ORCPT + 99 others); Mon, 17 May 2021 12:14:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345105AbhEQPuN (ORCPT ); Mon, 17 May 2021 11:50:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B48C2613B0; Mon, 17 May 2021 14:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262739; bh=eFLFcCVjj/Juat7SVA7Sv9+IO9Wv0EhmVYpN/GkN9u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqUWHg0GNe89hJ2RWT/fkAERF0uoRweX72wZSJz+a5k72rHb9eH/ZV5g+YtfhkDN/ RL/dOXXTnQQAd88qnESWk28n515BmfmgYVSoWqnIE6CnWr1k60uCxcdlewuGFemWmz mH/V7gNfTxVFNiuex6kFaUgUhzIWrMPA18hTXkxk= 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.10 286/289] debugfs: Make debugfs_allow RO after init Date: Mon, 17 May 2021 16:03:31 +0200 Message-Id: <20210517140314.774159493@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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