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 857B617FD; Thu, 13 Jun 2024 12:39:11 +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=1718282351; cv=none; b=l+ex5nltNls/ZY5igCwoVIHyZLum7e6DYGPpBiOyJFHsqLAs5LRD8KEc+wjC0kcKjqcxlDNI7mmcYHCM1bT0NGPhyHE2+Z3lwlRen4EbJgW857GaKHxYHlisk+yde/hMMPfXsFpU0phDbs6ZqJ63deA7E+aQEYTBZssKcR3XoYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718282351; c=relaxed/simple; bh=S3ts4YEHZlxX1UomXpuMncq6Y2TS4C1nnzYQwmJMM3Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=buY+kxVWCt5GB6mioc1MCbDr0YtinGvOxc0wjaokJ30F1B3Eu0PeBrE3GdTWjbESonhYxjNywn/h8OL2BtBD0Bs9Uj5sUBW7MYeHCnZz5KVaOZ1jp7zzXiG2gTGlE2J+4B8XEiHABqK3X+G9VhA9yhfDSmlXGNr7TzL6WOAQhvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zTjrrsuE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zTjrrsuE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05B82C2BBFC; Thu, 13 Jun 2024 12:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718282351; bh=S3ts4YEHZlxX1UomXpuMncq6Y2TS4C1nnzYQwmJMM3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zTjrrsuERDGrq7Y4xMSOGAtLy2+pSH1PxIlGu2llf59e+IPS/o4AS1awMCOmVi1Hg 4IkI60dvbnqh6yIELnmMdt/emg/IQnf2aLAu54k7IcpZPL7aj3b6Exk5Iyl0Ad5bch V1Y95g/rTjgQGlTkdfby+cYlfoqLnihSPODU3j5M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.15 246/402] Input: ims-pcu - fix printf string overflow Date: Thu, 13 Jun 2024 13:33:23 +0200 Message-ID: <20240613113311.744844202@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113302.116811394@linuxfoundation.org> References: <20240613113302.116811394@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit bf32bceedd0453c70d9d022e2e29f98e446d7161 ] clang warns about a string overflow in this driver drivers/input/misc/ims-pcu.c:1802:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation] drivers/input/misc/ims-pcu.c:1814:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation] Make the buffer a little longer to ensure it always fits. Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20240326223825.4084412-7-arnd@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/misc/ims-pcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 6f38aa23a1ff6..b3215c97ee02d 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -42,8 +42,8 @@ struct ims_pcu_backlight { #define IMS_PCU_PART_NUMBER_LEN 15 #define IMS_PCU_SERIAL_NUMBER_LEN 8 #define IMS_PCU_DOM_LEN 8 -#define IMS_PCU_FW_VERSION_LEN (9 + 1) -#define IMS_PCU_BL_VERSION_LEN (9 + 1) +#define IMS_PCU_FW_VERSION_LEN 16 +#define IMS_PCU_BL_VERSION_LEN 16 #define IMS_PCU_BL_RESET_REASON_LEN (2 + 1) #define IMS_PCU_PCU_B_DEVICE_ID 5 -- 2.43.0