From nobody Sat Jun 13 02:07:58 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 7B47B26FDBF; Mon, 11 May 2026 14:37:06 +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=1778510227; cv=none; b=i4OHFdXgddh67CB/3yvI3xQ8lUBw8zL0ljjoVMdtU9lV28ZJyQowCunrHZfdD6usorbYaJ173GwDXAEyQH1vbfBDhU6dJ8+/SEMpNZCXWQfnFTwv3ZWLdeRgbQS+mrsqNNRPmGsLnaSOejTFv28K7uCLFGWeFjr4qy0hOksXjkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510227; c=relaxed/simple; bh=f7H4qeOpmMDLBHuAUhgkjy3JeNGFOxiS7YbmFahEsgg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=uDmyea/q+d51Wag7waoUhogFTg+IsU/Gy1QTPpGmmPB/WGOoZsrrAV78kkxetFCWm9J17ERg+UVWq2D/ZoXzmj90S/519NwfiXg9bq+a7VJbk1um8z0NOlM1Q+nJJydBxZA6EobS+YdTjOJ5QpOPrnRlYN6W7E0DnJbH8V6WTLQ= 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=qWztgZMB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WmnMl1+p; 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="qWztgZMB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WmnMl1+p" Date: Mon, 11 May 2026 14:37:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778510225; 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=WMQ+waEMH4B/YRCSRptgC5sta+5tAG4R7k/Biz/yfbU=; b=qWztgZMBzwmSZgRo6FFuVS/I48BbqnGK7lZ5fa5oxMLqgdeWlXNOM9thaipeKTWufO+9I/ +hcbCZAGMwrIbYnSRakIEtIkYpjbFIzZcLkyGlF81ScKirfCe8YBRDgCLdi42OOzt/Q+vg TqTe0elUK4rd8wr07ciwxSYpAlz3aQ+rrZYayAFH59HDVEj5Re9fH2NLKF6+26MPvCxuao IZWfvR48tDqijEmoe7r0fJHbyd4uTLVPA/Md7EklcqGrx+aeyYxJJCjj98EVk23xcetZ51 Z7PZ5y8TyCZTpCGmtWMPQ6OCCh+6TMljwH4l8Z2SmuIZFQzoGi499t36czccKA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778510225; 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=WMQ+waEMH4B/YRCSRptgC5sta+5tAG4R7k/Biz/yfbU=; b=WmnMl1+pZ2M0/PBKapL53fcp4mFnsiK10luUzjhGrbgzx7+KBUh2p+q/iPXRiixqEn9yFz UUnGUbV6sfEEvyAQ== From: "tip-bot2 for Pengpeng Hou" 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: Size interrupt directory names for 10-digit interrupt numbers Cc: Pengpeng Hou , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20260404101001.1-genirq-proc-pengpeng@iscas.ac.cn> References: <20260404101001.1-genirq-proc-pengpeng@iscas.ac.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177851022343.188840.1558257351573611884.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: c2c7983c93f5d86962318be7e7298f1bc3feb1a6 Gitweb: https://git.kernel.org/tip/c2c7983c93f5d86962318be7e7298f1bc= 3feb1a6 Author: Pengpeng Hou AuthorDate: Fri, 03 Apr 2026 16:55:56 +08:00 Committer: Thomas Gleixner CommitterDate: Mon, 11 May 2026 16:32:30 +02:00 genirq/proc: Size interrupt directory names for 10-digit interrupt numbers /proc/irq// directory names are built in `char name[10]` buffers with `sprintf(name, "%u", irq)`. Ten-digit IRQ numbers already need 11 bytes including the trailing NUL, and current sparse-IRQ configurations allow interrupt numbers in that range. Size the temporary name buffer for the current decimal form and switch to bounded formatting when creating or removing the proc entry. Signed-off-by: Pengpeng Hou Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260404101001.1-genirq-proc-pengpeng@iscas.= ac.cn --- kernel/irq/proc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index b0999a4..dfa0b07 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -326,7 +327,7 @@ void register_handler_proc(unsigned int irq, struct irq= action *action) =20 #undef MAX_NAMELEN =20 -#define MAX_NAMELEN 10 +#define MAX_NAMELEN 11 =20 void register_irq_proc(unsigned int irq, struct irq_desc *desc) { @@ -348,7 +349,7 @@ void register_irq_proc(unsigned int irq, struct irq_des= c *desc) return; =20 /* create /proc/irq/1234 */ - sprintf(name, "%u", irq); + snprintf(name, MAX_NAMELEN, "%u", irq); desc->dir =3D proc_mkdir(name, root_irq_dir); if (!desc->dir) return; @@ -401,7 +402,7 @@ void unregister_irq_proc(unsigned int irq, struct irq_d= esc *desc) #endif remove_proc_entry("spurious", desc->dir); =20 - sprintf(name, "%u", irq); + snprintf(name, MAX_NAMELEN, "%u", irq); remove_proc_entry(name, root_irq_dir); } =20