Skip to contentSkip to conversation

FAILED: patch "[PATCH] iio: adc: rockchip_saradc: fix information leak in triggered" failed to apply to 5.15-stable tree

PATCH In review [email protected] 3 participants 3 messages Jan 13, 2025 – Jan 16, 2025

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 38724591364e1e3b278b4053f102b49ea06ee17c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025011310-spider-motor-0ef7@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 38724591364e1e3b278b4053f102b49ea06ee17c Mon Sep 17 00:00:00 2001
From: Javier Carrasco <[email protected]>
Date: Mon, 25 Nov 2024 22:16:12 +0100
Subject: [PATCH] iio: adc: rockchip_saradc: fix information leak in triggered
buffer

The 'data' local struct is used to push data to user space from a triggered buffer, but it does not set values for inactive channels, as it only uses iio_for_each_active_channel() to assign new values.

Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace.

Fixes 4e130dc7b413 ("iio: adc: rockchip_saradc: Add support iio buffers")
drivers/iio/adc/rockchip_saradc.c +2 -0
index 240cfa391674..dfd47a6e1f4a 100644
@@ -368,6 +368,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
 	int ret;
 	int i, j = 0;
 
+	memset(&data, 0, sizeof(data));
+
 	mutex_lock(&info->lock);
 
 	iio_for_each_active_channel(i_dev, i) {
#1 lore raw

PATCH 1/1 iio: adc: rockchip_saradc: fix information leak in triggered buffer

From: Javier Carrasco <[email protected]>

commit 38724591364e1e3b278b4053f102b49ea06ee17c upstream.

The 'data' local struct is used to push data to user space from a triggered buffer, but it does not set values for inactive channels, as it only uses iio_for_each_active_channel() to assign new values.

Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace.

Fixes 4e130dc7b413 ("iio: adc: rockchip_saradc: Add support iio buffers")
(cherry picked from commit 38724591364e1e3b278b4053f102b49ea06ee17c)
---
 drivers/iio/adc/rockchip_saradc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/adc/rockchip_saradc.c +2 -0
index a237fe469a30..3197fd2b3aad 100644
@@ -270,6 +270,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
 	int ret;
 	int i, j = 0;
 
+	memset(&data, 0, sizeof(data));
+
 	mutex_lock(&i_dev->mlock);
 
 	for_each_set_bit(i, i_dev->active_scan_mask, i_dev->masklength) {
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [PATCH 5.15.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 38724591364e1e3b278b4053f102b49ea06ee17c

WARNING: Author mismatch between patch and upstream commit:
Backport author: [email protected]
Commit author: Javier Carrasco<[email protected]>

Status in newer kernel trees:
6.12.y | Present (different SHA1: 4291becc8b99) 6.6.y | Present (different SHA1: 0b5e30f0aceb) 6.1.y | Not found
5.15.y | Not found

Note: The patch differs from the upstream commit:
---
1: 38724591364e ! 1: bc61bac32997 iio: adc: rockchip_saradc: fix information leak in triggered buffer
@@ Metadata
## Commit message ##
iio: adc: rockchip_saradc: fix information leak in triggered buffer

+ commit 38724591364e1e3b278b4053f102b49ea06ee17c upstream.
+
The 'data' local struct is used to push data to user space from a triggered buffer, but it does not set values for inactive channels, as it only uses iio_for_each_active_channel() to assign new values.
@@ Commit message

+ (cherry picked from commit 38724591364e1e3b278b4053f102b49ea06ee17c)
+ Signed-off-by: Bin Lan <[email protected]>

## drivers/iio/adc/rockchip_saradc.c ##
@@ drivers/iio/adc/rockchip_saradc.c: static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
@@ drivers/iio/adc/rockchip_saradc.c: static irqreturn_t rockchip_saradc_trigger_ha

+ memset(&data, 0, sizeof(data));
+
- mutex_lock(&info->lock);
+ mutex_lock(&i_dev->mlock);

- iio_for_each_active_channel(i_dev, i) {
+ for_each_set_bit(i, i_dev->active_scan_mask, i_dev->masklength) {
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y       |  Success    |  Success   |