From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796386120; b=qjGzerEwVLsrPwe3zn1H5uWPudxw8JlkyiVq39L7NyT6EWGqJHsVUyfRcd0+W/jlysDJ cDz2iJANf4rXZR6wRLZPXnVarjclmh9/IogP9fYbv0Cq47IBw4QwD9vA9dTVzD98hJZWE 6Myi6cgZ1E5kW1+IDyzKVF4COTzBwKb3TqKlZNhg8cK9X7mVR6lP/CNe5JBjgys5J9u2a hzVkiXiU5QFhvBQWB9SK8gTMAIg6MXGDcNKZ5VCQSB7hNL6tTtuxsrlURQdsTlq9vOur7 eX5+iHew1p59XRGGB56nWtTjHwkFJwOV3CvYUe4/ixeubvrIsnRoS5OJ+SN2Ke/Du8Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386120; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=OhzZyUdHu6LwSj9kpIemj/lfNZj6r9TQjMWtZXZwLq0=; b=I+Gy/nqr1o4J1vuwLP8zRt5HD12YblH8VHblmo+FwVIXaf5BRxCxsreDBC9sr0dgulvB VI1YtxFujvl424R4FyI/pPzsbZYP26ACIkGTWZH4lVSibXQHKk/XCMqTYwKcQ2LhWe+tK PTIMBx2t3t3LHZ/zMpbrFqtUF7vvXWZ6deBolvikTEuNcExlqTekDfBe2TMIDTpevHPPH eZYeVDnwkJFHpB5QHSEgZBs4wSGLMog0mLTKQnNUji5Am0ddKm//dzT1XABUltAZeqpOe sTPgMP1w2XFvCULdZ7z1MTXzc0VkdbPofdhI+ogVh2WLmYzStca2MR1obMBqaFkiycw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=oG7UUxo2; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D525E606A322; Fri, 4 Dec 2026 12:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=oG7UUxo2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBD2A1F00931; Fri, 4 Dec 2026 12:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386120; bh=OhzZyUdHu6LwSj9kpIemj/lfNZj6r9TQjMWtZXZwLq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oG7UUxo2wlEl6/MYB+HNLWuo1ckXY4TyMYi0iVPudtHxXffehnFHYuH5kN+isSSzw qmep1YzRh1gedJ8OoaeC5+yiP+wvmdSoN60VNqgAPD5dJPH2/rKCc9y8XBqIfjFZD3 urcUhg09Bl1Z4/LGhG+kbHb0rvLketCnxq5J/cu0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karan Sanghavi , Jonathan Cameron , Sasha Levin Subject: [PATCH 6.6 0835/1167] iio: invensense: Prevent possible integer overflow while multiplication Date: Fri, 4 Dec 2026 19:04:22 +0900 Message-ID: <20261204100723.875376400@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karan Sanghavi [ Upstream commit 6dfc256151e842fa894a2b579f9a4551c6961e2c ] Typecast a variable to int64_t for 64-bit arithmetic multiplication. Signed-off-by: Karan Sanghavi Link: https://scan7.scan.coverity.com/#/project-view/51946/11354?selectedIssue=1586045 Link: https://patch.msgid.link/20241103-coverity1586045integeroverflow-v1-1-43ea37a3f3cd@gmail.com Signed-off-by: Jonathan Cameron Stable-dep-of: 3785dffc7c68 ("iio: inv_sensors: prevent timestamps going back in time in transitions") Signed-off-by: Sasha Levin --- drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c index 37d0bdaa8d824..327f456b53c5c 100644 --- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c +++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c @@ -109,8 +109,8 @@ static bool inv_update_chip_period(struct inv_sensors_timestamp *ts, static void inv_align_timestamp_it(struct inv_sensors_timestamp *ts) { - const int64_t period_min = ts->min_period * ts->mult; - const int64_t period_max = ts->max_period * ts->mult; + const int64_t period_min = (int64_t)ts->min_period * ts->mult; + const int64_t period_max = (int64_t)ts->max_period * ts->mult; int64_t add_max, sub_max; int64_t delta, jitter; int64_t adjust; -- 2.53.0