Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp452705lqp; Sun, 9 Jun 2024 04:02:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyGq7JeeB9LNYoAnEvFbFZWDniaL5CbycAB5VEDmR6PkM4Nb0F4ccYJ1B2fwWjpUBWpgRlypyQ3K3nGFiXcITn/qC+cNMhSpvSXM0xcA== X-Google-Smtp-Source: AGHT+IEgK8YkjiEhjgSHpaj6Cc6WXnoJgqJCmIFiEAytxoPhpaNlSGjDSj18YRDy0ljvIdFjlBwP X-Received: by 2002:a17:906:228b:b0:a6e:f62d:bd02 with SMTP id a640c23a62f3a-a6ef62dbe00mr276636566b.7.1717930951825; Sun, 09 Jun 2024 04:02:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717930951; cv=pass; d=google.com; s=arc-20160816; b=UCqrOKB1N4mGgt9U4RCrG00DotmaRtx44KLOpd1piTkMnsFmLGwbd4WpxWdzX/eHKF 7RYBAeWfUTVljX8uFGViNJ8Bsjd1mAQA8YyJcSxjkzNEeTCKsGvvJhs555GS3i8Q2Y4O AOneKpcsrd+1POi2Wi6oRtT7FD3y/G6jpRovZcJVpoBFjxHJlUWOw+Lf2YllVY/ehgCE FeUUx+dwJxCH3jn9chTOngqS+kNcpz9ENWvQ4iHv6IhmgXOF1pXwcnff3mg6GAQxQ5fK 5qL/GeJDp0c9DzASHzf+fvYOSWLjx20uTg2PJ++GM51FyS9YUJ3i/T/KC5sxT0zwxMTg v2mA== 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 :subject:cc:to:from:date:dkim-signature; bh=tW3EMVbPlfEhPu/VhlHKTtbeQo/vaOclNc619QRjDoE=; fh=Cd8u3PZDjy+Y8BQ+XI/2jO6YK3iYo3PiYmPQg6yMRwM=; b=XAxefMTDKVg4lFS6X1jNIyII8QFlSLl4qJMM0ncIBccaVV4CO6Y6J1/j8gBPkNVsOi KFPTFzKLjn8TZJJWcLQWHx5DL2bA832TfcqrGcOIhwEVfNJ6+SxoCPtDFuRbCgR+bLvK k2rf/qGWD0iVmw25t3U58zx9Vk4HO86EMUn82RuuqlHM90aLVGn1cmJNZEQvMJiRl0hN SvqroSSZIEHw8XENPU4t86a4EYsdkyAi4S3TjyGpnFt6PMTOsZSdVDfUAvV8B2n1qRoj 8GU+aoLGFlNQh20uHD+Z3on2Sb1dTIxnIGai6VhRqdkkPiLaZ6gC3P6uJcnlAHBLIPFr 4zKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WDeT0grw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef60fef25si205975166b.714.2024.06.09.04.02.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 04:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WDeT0grw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207332-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6C5FF1F216AD for ; Sun, 9 Jun 2024 11:02:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D4852D030; Sun, 9 Jun 2024 11:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WDeT0grw" 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 45E1B20310; Sun, 9 Jun 2024 11:02:24 +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=1717930944; cv=none; b=U5wmCLu7n1yAiAmUfsJZwiajAGq5/M4dJ/Z/UIUtTTsO7jyScMPXLzutdVdrevrDSOeERtw5M7Gh3y+Fm5J6WWsKEMelxTcL+UHIQCfH96PWzZLFFV7GneeuW1XRth/CqI+2FmSGDH/m398OsYW/AP7YyIZ+oHdVR9wp/fx7USA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717930944; c=relaxed/simple; bh=BYuNwJ0N6PcEiyA8zGc+9GkZM45vti7rmqGC85qqzlo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OXuq8JZ+TR3skPDp64Djsd7Xtp76FjJxGfvmqrTnmy3HH0yJJU4uv76fX97TI+xcYKizQK9ZXVtfI/mmYfSnLSXnGNdgnJMjQtBY7J1Nlh1XoO9hI+o7/vmJ5Cbzj78Vb0G8wGuGYK4uD1xNqP4XTLey+yp4s+EnX3ul2nC2yN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WDeT0grw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5770FC2BD10; Sun, 9 Jun 2024 11:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717930944; bh=BYuNwJ0N6PcEiyA8zGc+9GkZM45vti7rmqGC85qqzlo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WDeT0grwqJJYljdZuSZjgdFCsg/b3HPBkc+w69tpV6QXlWnoIe1+O2v+dUO17j+9e XuP+ngkWnyh5lMMd5XBXQTWTvgL9OYO5G70na+Wtfh11HK06fHSChCZvkvgD03GlCZ YXszG3iFLEbqvlGuaKVlSsHTpwadWVfM9mcgHltx8eVw6weSN2Z1QNoUrv6GpNJxTY zd3nEj0vPVIooIFlgF5iv2PNoRbfPDK8pPzpSMfpjmYrNzRgI9oxH+8h4cB/QfdoC7 f7/GVq22eoT0dgajsq7IuT267gnD9m+E00u4+BA9uf8N09Ft7AIOZo+RIeZgzsit5a l2fThFwedX9Xw== Date: Sun, 9 Jun 2024 12:01:47 +0100 From: Jonathan Cameron To: Vasileios Amoiridis Cc: dpfrey@gmail.com, himanshujha199640@gmail.com, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, mike.looijmans@topic.nl Subject: Re: [PATCH v2 03/19] iio: chemical: bme680: Fix overflows in compensate() functions Message-ID: <20240609120147.65c7001d@jic23-huawei> In-Reply-To: <20240606212313.207550-4-vassilisamir@gmail.com> References: <20240606212313.207550-1-vassilisamir@gmail.com> <20240606212313.207550-4-vassilisamir@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 6 Jun 2024 23:22:55 +0200 Vasileios Amoiridis wrote: > There are cases in the compensate functions of the driver that > there could be overflows of variables due to bit shifting ops. > These implications were initially discussed here [1] and they > were mentioned in log message of Commit 1b3bd8592780 ("iio: > chemical: Add support for Bosch BME680 sensor"). > > [1]: https://lore.kernel.org/linux-iio/20180728114028.3c1bbe81@archlinux/ > Fixes: 1b3bd8592780 ("iio: chemical: Add support for Bosch BME680 sensor") > Signed-off-by: Vasileios Amoiridis Applied and marked for stable Thanks, Jonathan