From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 5FCBA24728F; Sun, 7 Jun 2026 10:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780827740; cv=none; b=WhWxShXz1Z/v5Lz6kYkB0VRrvsUSXZIXQr9yIPMQ8TF3EzBp4g8krgNRrNp9ijh4vK5aTE4FdPBKM0Tv7qoyxFA9Zbue2jczXodBJFb4JHG5f8WUbfWmdaM40hTY+JlsLI3dd9Bivpu35eUcU0EeiHxchD7fvgIu6pBMBtodbOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780827740; c=relaxed/simple; bh=rn1nUpqpzEkLyX6c778vYR4BD3RkqqaZ1XGMzGOECic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n0Qfs5H1QF1vptEiCuWeb8b8rZFuYtyx+P2uPimbXJOy9hb45CjCBwZTGx4oojGwI8+unBKHmFEN5UQ+/4Z4YE3jtl9OYG3y3i6QyOF1HVuwrvGBJctZUkv9B8ECTzDZ+Rdf+M9ctPC9gRlB4OIbARf7SauMUzrLnvponWETlrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JqWfA4kd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JqWfA4kd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EFAB1F00893; Sun, 7 Jun 2026 10:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780827739; bh=BfdNFXIj+bR6o63mFaVanLpQoWOgmEQwKSjhF2YSu40=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JqWfA4kd/UPtY9HcQ31RFIddrDN6HkDxuAiCsftFK8Jcu5caKeD6NLpBqkFueCZLe 8U5ZMVlqJRl0s2esbWdtJ0E2sWQoiEGOFVrl83Nq3wwlOnUCu7sOR5qq/Rs5Vg6TU6 4X6sa0HEyH8irWdbja/FeKZk4gUC32q+x9LFwVxs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lorenzo Bianconi , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , stable Subject: [PATCH 7.0 118/332] iio: imu: st_lsm6dsx: fix stack leak in tagged FIFO buffer Date: Sun, 7 Jun 2026 11:58:07 +0200 Message-ID: <20260607095732.444051517@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095728.031258202@linuxfoundation.org> References: <20260607095728.031258202@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit c9d8e9adaa63150ef7e833480b799d0bab83a276 upstream. The tagged FIFO path declares iio_buff on the stack with __aligned(8) but no initializer, but there is a hole in the structure, which will then leak to userspace as ST_LSM6DSX_SAMPLE_SIZE bytes (6) will be copied, but the space between that and the timestamp are not initialized. Commit c14edb4d0bdc ("iio:imu:st_lsm6dsx Fix alignment and data leak issues") moved the untagged FIFO path to a kzalloc'd buffer in hw->scan, but for the tagged path it only added the alignment qualifier and not the initializer :( Fix this by just zero-initializing the structure on the stack. Cc: Lorenzo Bianconi Cc: Jonathan Cameron Cc: David Lechner Cc: "Nuno Sá" Cc: Andy Shevchenko Fixes: c14edb4d0bdc ("iio:imu:st_lsm6dsx Fix alignment and data leak issues") Cc: stable Assisted-by: gregkh_clanker_t1000 Signed-off-by: Greg Kroah-Hartman Reviewed-by: David Lechner Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -609,7 +609,7 @@ int st_lsm6dsx_read_tagged_fifo(struct s * must be passed a buffer that is aligned to 8 bytes so * as to allow insertion of a naturally aligned timestamp. */ - u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE] __aligned(8); + u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE] __aligned(8) = { }; u8 tag; bool reset_ts = false; int i, err, read_len;