From nobody Sun Feb 8 14:22:34 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A55931B1401; Thu, 29 Aug 2024 14:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724942783; cv=none; b=O6TAvNF7GFmgDoje3n8b2+vS2cJJzxfp4/2TTfFzwNPqRGr1p4K7EHbxYYAyhRGSLg+XU8wyNYR6RxjTkVMgMZY4lU4goB11AdayPelZRPLGEwTLfeaxElrwJGpekZr5Wf2ueVq2HfqXfCvt87fjmb6A39xnyR/gNQ+WMwHMZSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724942783; c=relaxed/simple; bh=SL8jUwSn4pyzmILjnoyQuZItYZkNCsokx3+ePrFrEmE=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=So54IQZ83oJALil1BZuWG4W4KF14Q95m7qq5LQNg0st7L8MIbx4zokUxwcXRa1vXuAxUp6Rx6+jlLuCKjRf1i+O2Jb16fOrq+PXmT3k313wA2u4amuF+nKBUiVcxrc8Nwv4swJGyFCWdlU09Zq2h3hEcXR/LrgXlsUnUbWCqQHM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Q0bLCT/9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EtZIN4q1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q0bLCT/9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EtZIN4q1" Date: Thu, 29 Aug 2024 14:46:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1724942779; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6e77kthwKCJKs7mvJV35ELYZo/db7mzAreQUgy63BbY=; b=Q0bLCT/918IjyIXj+3x2l+6S+3hHny9lcwqqRaxpo6ZvzgGxQc1j4RmcqsSAnK64vyzXrc kWTHBO6hemdB1oecAjm99ydIiEp6UHdS71lLeqDLdQJqLE6drQpwM4R4gX8lbNNBQMNWws sDfC0NuJ0Rlx8QmK/z2Orz+g+eszxNyxyXfxPTRqjj3/Z6vstvt8xAk727AOKUAmDaHr91 zxidoUOfiSPibsAvu0CJu3MuQJfKg7KMykSNWXG5apzjc77IuN43ezJXEx7HgfpmkAgUWN 1FXwAslSmgu/XgFS+wB/gL3oAVBe+ZZuJynhdUSFuC+h2t+WR4kO8oXxvZGc9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1724942779; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6e77kthwKCJKs7mvJV35ELYZo/db7mzAreQUgy63BbY=; b=EtZIN4q1cbDEL+Yvq4tFo5gE3LBkNJu6NkMbSVWwngCGHtULRKKydjesSDfzbGgv3QiDoW f8kbY/Ckafn88MCw== From: "tip-bot2 for Jeff Xie" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] genirq/proc: Correctly set file permissions for affinity control files Cc: Jeff Xie , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240825131911.107119-1-jeff.xie@linux.dev> References: <20240825131911.107119-1-jeff.xie@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <172494277939.2215.420047136899839963.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: c7718e5c76d49b5bb394265383ae51f766d5dd3a Gitweb: https://git.kernel.org/tip/c7718e5c76d49b5bb394265383ae51f76= 6d5dd3a Author: Jeff Xie AuthorDate: Sun, 25 Aug 2024 21:19:11 +08:00 Committer: Thomas Gleixner CommitterDate: Thu, 29 Aug 2024 16:41:42 +02:00 genirq/proc: Correctly set file permissions for affinity control files The kernel already knows at the time of interrupt allocation whether affinity of an interrupt can be controlled by userspace or not. It still creates all related procfs control files with read/write permissions. That's inconsistent and non-intuitive for system administrators and tools. Therefore set the file permissions to read-only for such interrupts. [ tglx: Massage change log, fixed UP build ] Signed-off-by: Jeff Xie Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20240825131911.107119-1-jeff.xie@linux.dev --- kernel/irq/proc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 8cccdf4..9b3b12a 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -362,8 +362,13 @@ void register_irq_proc(unsigned int irq, struct irq_de= sc *desc) goto out_unlock; =20 #ifdef CONFIG_SMP + umode_t umode =3D S_IRUGO; + + if (irq_can_set_affinity_usr(desc->irq_data.irq)) + umode |=3D S_IWUSR; + /* create /proc/irq//smp_affinity */ - proc_create_data("smp_affinity", 0644, desc->dir, + proc_create_data("smp_affinity", umode, desc->dir, &irq_affinity_proc_ops, irqp); =20 /* create /proc/irq//affinity_hint */ @@ -371,7 +376,7 @@ void register_irq_proc(unsigned int irq, struct irq_des= c *desc) irq_affinity_hint_proc_show, irqp); =20 /* create /proc/irq//smp_affinity_list */ - proc_create_data("smp_affinity_list", 0644, desc->dir, + proc_create_data("smp_affinity_list", umode, desc->dir, &irq_affinity_list_proc_ops, irqp); =20 proc_create_single_data("node", 0444, desc->dir, irq_node_proc_show,