From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2A8F642D99A; Sat, 28 Feb 2026 17:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300809; cv=none; b=sudeOMqMlAfzfZGJ48IYwad3jKxcFBT9bChV+KCuuGUlEoq8HYZgM9NhuX0atQizZmCOLTMU1oUoxRjXSVu28LCGCum896s2ZtwJCUzbN7XBJWskrQkNMx4TjYSqrfpcP7Ci255A/YlmhUSysg6GKAhEIlSR1XEMWO1wZam6jig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300809; c=relaxed/simple; bh=0ke89qIkCP1Vx3mCNyJmsf87GelHhrDmZ1+IDmagLCk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WErKWPgJ3n264AJT1R5jfxquA83rRFp7D7Vpu6H904PSNhNz/tDm5yCCX8AIgUEdtIVPSGArsBaOqKNhG+XzDIPntst4kNxtgkDLzzS/muUR9z+Kv/x+rYdOU5crilAvJK8N9Ky/eFbqdusOJr7boQKokq8mIxHTw7unlgjDQa4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fk8n1OrY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fk8n1OrY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F7B0C116D0; Sat, 28 Feb 2026 17:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300809; bh=0ke89qIkCP1Vx3mCNyJmsf87GelHhrDmZ1+IDmagLCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fk8n1OrYSSpQub0by70LdTJq5p3GpB2x3P0LUyTLtohEiHhL/PS66RDnvrqX6duk2 2gKxGkg1+reHmTmYXzH/xjRT4iQ60HzQnpn416HbuUnIM9cLRYYsB+TSqiFWuKKudg Im3K3IKpA/60SUWSL1Kqphtpn31m6uBMA9iS61r/IfQ/gGqeSyomtDTo/D4cPMwUVl rurwwyie59MUriFl6M7qKiHhxyX2jp4tCpcTs1arrGklUS8UNgumkKBCy2vAGoQd+S /KuAQs/cKBDj1/iF+bKdjWSGghKvrfb66DduhIMlzQHjN8xjWQ0/f2PD+QKeYuSOH1 dLv95sqlXC7iQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Koichiro Den , Frank Li , Dave Jiang , Jon Mason , Sasha Levin Subject: [PATCH 6.19 841/844] NTB: ntb_transport: Fix too small buffer for debugfs_name Date: Sat, 28 Feb 2026 12:32:34 -0500 Message-ID: <20260228173244.1509663-842-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Koichiro Den [ Upstream commit 6a4b50585d74fe45d3ade1e3e86ba8aae79761a5 ] The buffer used for "qp%d" was only 4 bytes, which truncates names like "qp10" to "qp1" and causes multiple queues to share the same directory. Enlarge the buffer and use sizeof() to avoid truncation. Fixes: fce8a7bb5b4b ("PCI-Express Non-Transparent Bridge Support") Cc: # v3.9+ Reviewed-by: Frank Li Reviewed-by: Dave Jiang Signed-off-by: Koichiro Den Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- drivers/ntb/ntb_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 71d4bb25f7fdd..4d00263ebc934 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -1236,9 +1236,9 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt, qp->tx_max_entry = tx_size / qp->tx_max_frame; if (nt->debugfs_node_dir) { - char debugfs_name[4]; + char debugfs_name[8]; - snprintf(debugfs_name, 4, "qp%d", qp_num); + snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num); qp->debugfs_dir = debugfs_create_dir(debugfs_name, nt->debugfs_node_dir); -- 2.51.0