From nobody Mon Jun 15 09:43:01 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.4]) (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 B0EDC2DF132; Thu, 9 Apr 2026 06:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775717540; cv=none; b=oLIUh90aUhjbCbQZLidGUAaFJqlqe0Yr2rFgKXN5y3TpEIQIIf7BXHqKAguIsSUIGx1rD1jKr5KuonLudeLQICADITabyGLq0ylp5KvQLPwSIbAtwuiQ96oWkJrCpwRRXQ3cqRpWJbLZY8+KGliZOdbIy6n3SDJ7VXdXYslARRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775717540; c=relaxed/simple; bh=Np5Lt5ETnUEaipPxhdY64Brx8L+nmKdeJoYDj9q6ynY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=b+wXqc7sAKZ4Y5oRappJ1TMTswHUwleLYXUxXIrzDsDK4mco4GmnXASwaiEmeK/r3qdmqsGc9ZO6horjadAYL6QJJiCLtTkWcRyF6DCCSYJ3BlYfIu7AE9tjfR2e/naeHG3sb994lHBLtn9qqbhqA1fuWUMpxY0wDA/9ClGCJXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=BcF8Kb7O; arc=none smtp.client-ip=220.197.31.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="BcF8Kb7O" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=td 6JF46MJVa/vlsyoVQQDQ8QJpiXMdq2Ddm53feU6OU=; b=BcF8Kb7OtHYkJwRi9t SQka+hvI/c/Srni/fKJHLNqyA1ztu1b5v52YFRiP2NInvUUzAJo5ttrJbdQHGxqB B7Qi9eSHnXaw70TKBrb9N/V+fc8tMX2Iqu8hgeE3OYO+2TYIeHZD1tSlfaoOwE5v zQypDSyZNI+hVvqmq8dVRh8WE= Received: from pek-lpg-core5.wrs.com (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wCHUbCDTNdp0ADzDw--.61243S2; Thu, 09 Apr 2026 14:51:49 +0800 (CST) From: Robert Garcia To: stable@vger.kernel.org, Nuno Sa Cc: Jonathan Cameron , Robert Garcia , Zicheng Qu , Lars-Peter Clausen , Michael Hennerich , Daniel Junho , Alexandru Ardelean , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5.15.y] iio: adc: ad7923: Fix buffer overflow for tx_buf and ring_xfer Date: Thu, 9 Apr 2026 14:51:47 +0800 Message-Id: <20260409065147.136824-1-rob_garcia@163.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wCHUbCDTNdp0ADzDw--.61243S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WF4kXw43WrW7CFW8Kw1xKrg_yoW8XFyrpF 4YkrWjkF47CF1UCF45Ww1UCFWfWa1DKry2ganrCa9Ivr15ZFy5CrWUK34FvF1rJFW7C39F vr1q9ry5Ww109rUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pESfODUUUUU= X-CM-SenderInfo: 5uresw5dufxti6rwjhhfrp/xtbC5QWE72nXTIV5+gAA3- Content-Type: text/plain; charset="utf-8" From: Nuno Sa [ Upstream commit 3a4187ec454e19903fd15f6e1825a4b84e59a4cd ] The AD7923 was updated to support devices with 8 channels, but the size of tx_buf and ring_xfer was not increased accordingly, leading to a potential buffer overflow in ad7923_update_scan_mode(). Fixes: 851644a60d20 ("iio: adc: ad7923: Add support for the ad7908/ad7918/a= d7928") Cc: stable@vger.kernel.org Signed-off-by: Nuno Sa Signed-off-by: Zicheng Qu Link: https://patch.msgid.link/20241029134637.2261336-1-quzicheng@huawei.com Signed-off-by: Jonathan Cameron [ Context change fixed. ] Signed-off-by: Robert Garcia Acked-by: Jonathan Cameron --- drivers/iio/adc/ad7923.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c index b8cc94b7dd80..a8e59fd2dcf3 100644 --- a/drivers/iio/adc/ad7923.c +++ b/drivers/iio/adc/ad7923.c @@ -47,7 +47,7 @@ =20 struct ad7923_state { struct spi_device *spi; - struct spi_transfer ring_xfer[5]; + struct spi_transfer ring_xfer[9]; struct spi_transfer scan_single_xfer[2]; struct spi_message ring_msg; struct spi_message scan_single_msg; @@ -63,7 +63,7 @@ struct ad7923_state { * Length =3D 8 channels + 4 extra for 8 byte timestamp */ __be16 rx_buf[12] ____cacheline_aligned; - __be16 tx_buf[4]; + __be16 tx_buf[8]; }; =20 struct ad7923_chip_info { --=20 2.34.1