Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp91818lqf; Tue, 26 Mar 2024 15:42:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVHaBKFiaOao7EmAJIZifFg8gHLR+ubH+atvM11dBqRx8RhsB25vSnDJfiI52lnB8L8KPZBJNlR0yGPSkFvynjxF6zCqKyTtfQ6B0Wsw== X-Google-Smtp-Source: AGHT+IEutQrPS9hsAkgOdwUSOqGH9TG6BjM/xgJNrlPEhFuNI6093PyFUQugNW2pJEwXwqqFOgPU X-Received: by 2002:a05:6a20:9184:b0:1a3:ac75:2890 with SMTP id v4-20020a056a20918400b001a3ac752890mr1247617pzd.46.1711492966832; Tue, 26 Mar 2024 15:42:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711492966; cv=pass; d=google.com; s=arc-20160816; b=iX5FNss8+xYFNIOIkd0xzbG7aMAznEiYcFM8vrue/qGAFfJnKjOWWpap2BLbMl2sVu FQsKbCa1LeJyGdq+Xl0a/kDFsVD8bu1KyeWgLDB/wV05qLmqtIKRJIkzYDS7sFywCYcR J1B5kLGsVcwonATis9MJQwrCkt6NgP7pqiFrTdl/V6nYvySQTXYQoiVDSJtxR3QBYJzw qjhVdqlsSE4yyF4CZJTqIEur0PfaXRBeen4STgy+x2OcIQ+pCk4tCoBqvCdRCvVFF3ay 1qiwiXlDzCKXR/1PBoKjEIkr43xaleepXvQ0c6LyqyEAaxAB2bRYaUJR7by07oyIpGDl rTeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uHzeKYCXMPIMLEvEQSHfBg2tEBzF09hkTYaXHZaum88=; fh=mC35t2mINdeQWqVgsTk+VeYKR+ySyQBrFerxqRtWcjk=; b=HwFk1IN9+PnFkPbqrafVELtM2uMTyox+zOVj/w8M9iQdHT+yEdcsuAHw+TJSvcCeeM 4IpomNYJX/5HKyX5SwPASE4D0E1fKVbdRXqBfQfli5QVWtA8Z1NQ67WaiSXBw+DfOoRg DTbl+/qqL8X1iUI5sk9E32WxFrVTB7uUQ4TeUuCBt1mhgxr2X2n6yySMPIDkToeALBdF ARJS8LkgxnA6cdL25/QLAD3bcXvxS/sxAzHUR/T7lDBYVqUgcGijAkB7+xSZquQw18FG DLUXJlPHFUF2Fj2dPtdg4D49WO0UvC+wL7M/5QuXX+/97LAj/YbCo+vZ/eA7p6E01of/ SVkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ODHnADV8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p24-20020a17090a931800b002a0911db70csi165522pjo.82.2024.03.26.15.42.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ODHnADV8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 31AF832290E for ; Tue, 26 Mar 2024 22:42:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AB3A13E6CB; Tue, 26 Mar 2024 22:40:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ODHnADV8" 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 00F4F13E6C5; Tue, 26 Mar 2024 22:40:47 +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=1711492848; cv=none; b=PKUMKEA/x6cnLaO28xanJeC67cSQVZ40BZm4jn8hAPhu4Jct+3+vOQhiIqyNCBOs8URRC+AW3woSLTIIC4pHNyGoSuTD4TYuVDpLAfAS99HFM0g/zPF8U3WMA+G3A70PirolyheqPHEu+WeGQXz9w3kMQclymBiju6Ys/h/5enw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492848; c=relaxed/simple; bh=iaotj1iZQ8IOaXKa3sSgBb9LPDG2URR87VML4Asl6ZI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VRBQknGcCgMEFY9pIY0qQhRKpUQp6Zx9//KkxlzYPt3oq+eiRaqcX4YW+9zS4Ue3ulJ5UzwnWJ4M6TJqPgU2409PRVDq/y5ZgK0ZbHNJGuOcwBjyrRPgIrQE+sgcnglOQgPMANLckm/au5Hso3ETLCFRguZzG/V4wLC+KNAYyTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ODHnADV8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 897A9C433F1; Tue, 26 Mar 2024 22:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711492847; bh=iaotj1iZQ8IOaXKa3sSgBb9LPDG2URR87VML4Asl6ZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ODHnADV8jbM1W2YmWlXbh+RY49mjLG3aluEG3tx+tMw+PQaTBk0E3Hn/ulcUNVdjw McUs8XBCAaX4PJeU7h+HtO5xr4XRyefi+bwFim4AgFaCvLpW4Z7RJyDojCYHnvUt2J s/D4ZNnNLr53uFEBh9q6QnsfcKbagk4CBO4zgit+qyqm5GI+xP3OFxeWeqcU5FsWvV U/h9UcDRN7Pwx/qFtLEkg2VRhcCqxik7J2ZQE3RM8ylDYnhepyIVgqzH4sojgBViDl I1VP9IkpTDXqdRvimcukslPS5JX7UKbWx09jD8NbcVDtswEQbCbfKx1IZCkQKhOTX8 Z4bWASyfJpaXw== From: Arnd Bergmann To: llvm@lists.linux.dev, Dmitry Torokhov , Nathan Chancellor Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , ye xingchen , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] Input: IMS: fix printf string overflow Date: Tue, 26 Mar 2024 23:38:05 +0100 Message-Id: <20240326223825.4084412-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326223825.4084412-1-arnd@kernel.org> References: <20240326223825.4084412-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann 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 --- 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 6e8cc28debd9..80d16c92a08b 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.39.2