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 06CD320323; Sun, 8 Dec 2024 16:52:14 +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=1733676735; cv=none; b=HAAWDcRktf0jWjcrM2PYp0sH8Ax6qkCkm0uBqnosYVBdXI8Re3YN5AoA0e22XkposPR7P9q1ZSoA9c4PgWNztlTQTVMMcS4kq1RQzqjOMaWQp9Lf5pHc8Uwdx2dkB4RY0vI0FbQBTUqR/PPC5YJNyJUox9Duf8PEkf8yaBM8XtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733676735; c=relaxed/simple; bh=bEBYco6/srzwb/gQhGO1rybBf+L9L5uWjd+rO+bMRf0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hbdHksr7qWlavNDGVvoUHI3x1U64OsVpjZkwO+G0t0wqXYTOBhfpd/7dwV5qwT/paTwZVEBq/EQZHjpu20nlGqwRScORVkA1txaFZqyLBOGoHHS0lK3paRf3p67Fxat2v6DopOOhHA1bh4yGvJgydfjh8n5KUvRGIHE/lmo3CtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s4SMdZPq; 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="s4SMdZPq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EC4BC4CED2; Sun, 8 Dec 2024 16:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733676733; bh=bEBYco6/srzwb/gQhGO1rybBf+L9L5uWjd+rO+bMRf0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s4SMdZPqb+sW5P5yO7g/awl5XvRH9cbqDFEz+Zn0i8Q7lHVvDWZqVDvIemGG7SDOR 4WdV8DPFhuq/SsFnH0y/aYWEUBAr/qjrYenRUt72mQW/ra2kQC6c6ojGNLFKmKVjS2 +36YQN5OyjiVNqd0D+nFrsE/3XL/MTmF5P0EchkX8v7K+PBMbS6/g0QQYoyjiiRwUp VarJqlpdhGIMLvFGvr5U4bq/Ljz1lTpoNmSlTNNAYFpg1Ff2KJ/w3VWTjqEfbXjiNl BL9tAGCu9/wHCTk1Dq8AbPSrAVvLd0OA5El7jWV89OYKCU2BFsmG01msFz2Xbg5Hi6 HtR8WMurw6RWg== Date: Sun, 8 Dec 2024 16:52:04 +0000 From: Jonathan Cameron To: Javier Carrasco Cc: Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?UTF-8?B?Sm/Do28=?= Paulo =?UTF-8?B?R29uw6dhbHZlcw==?= , Christian Eggers , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?B?Sm/Do28=?= Paulo =?UTF-8?B?R29u?= =?UTF-8?B?w6dhbHZlcw==?= , Francesco Dolcini , stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] iio: temperature: tmp006: fix information leak in triggered buffer Message-ID: <20241208165204.20b5bbd4@jic23-huawei> In-Reply-To: <20241204-iio_memset_scan_holes-v2-1-3f941592a76d@gmail.com> References: <20241204-iio_memset_scan_holes-v2-0-3f941592a76d@gmail.com> <20241204-iio_memset_scan_holes-v2-1-3f941592a76d@gmail.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-iio@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 Wed, 04 Dec 2024 00:55:31 +0100 Javier Carrasco wrote: > The 'scan' local struct is used to push data to user space from a > triggered buffer, but it has a hole between the two 16-bit data channels > and the timestamp. This hole is never initialized. > > Initialize the struct to zero before using it to avoid pushing > uninitialized information to userspace. > > Cc: stable@vger.kernel.org > Fixes: 91f75ccf9f03 ("iio: temperature: tmp006: add triggered buffer support") > Signed-off-by: Javier Carrasco Applied but dropped the stable tag. The patch this is fixing isn't in a release yet. Jonathan > --- > drivers/iio/temperature/tmp006.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c > index 0c844137d7aa..02b27f471baa 100644 > --- a/drivers/iio/temperature/tmp006.c > +++ b/drivers/iio/temperature/tmp006.c > @@ -252,6 +252,8 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p) > } scan; > s32 ret; > > + memset(&scan, 0, sizeof(scan)); > + > ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT); > if (ret < 0) > goto err; >