stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] iio: adc: rockchip_saradc: fix information leak in triggered" failed to apply to 6.1-stable tree
@ 2025-01-13 10:40 gregkh
  2025-01-15 11:18 ` [PATCH 6.1.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer lanbincn
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2025-01-13 10:40 UTC (permalink / raw)
  To: javier.carrasco.cruz, Jonathan.Cameron; +Cc: stable


The patch below does not apply to the 6.1-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 <stable@vger.kernel.org>.

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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 38724591364e1e3b278b4053f102b49ea06ee17c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025011309-swab-bootie-b4f4@gregkh' --subject-prefix 'PATCH 6.1.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 <javier.carrasco.cruz@gmail.com>
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.

Cc: stable@vger.kernel.org
Fixes: 4e130dc7b413 ("iio: adc: rockchip_saradc: Add support iio buffers")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-4-0cb6e98d895c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 240cfa391674..dfd47a6e1f4a 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -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) {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 6.1.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer
  2025-01-13 10:40 FAILED: patch "[PATCH] iio: adc: rockchip_saradc: fix information leak in triggered" failed to apply to 6.1-stable tree gregkh
@ 2025-01-15 11:18 ` lanbincn
  2025-01-16  0:25   ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: lanbincn @ 2025-01-15 11:18 UTC (permalink / raw)
  To: stable; +Cc: Javier Carrasco, Jonathan Cameron, Bin Lan

From: Javier Carrasco <javier.carrasco.cruz@gmail.com>

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.

Cc: stable@vger.kernel.org
Fixes: 4e130dc7b413 ("iio: adc: rockchip_saradc: Add support iio buffers")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-4-0cb6e98d895c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
(cherry picked from commit 38724591364e1e3b278b4053f102b49ea06ee17c)
Signed-off-by: Bin Lan <lanbincn@qq.com>
---
 drivers/iio/adc/rockchip_saradc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index b87ea7148b58..0861885fa2a5 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -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) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6.1.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer
  2025-01-15 11:18 ` [PATCH 6.1.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer lanbincn
@ 2025-01-16  0:25   ` Sasha Levin
  0 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-01-16  0:25 UTC (permalink / raw)
  To: stable; +Cc: lanbincn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 38724591364e1e3b278b4053f102b49ea06ee17c

WARNING: Author mismatch between patch and upstream commit:
Backport author: lanbincn@qq.com
Commit author: Javier Carrasco<javier.carrasco.cruz@gmail.com>


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

Note: The patch differs from the upstream commit:
---
1:  38724591364e ! 1:  a5b3d23cd86f 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
         Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
         Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-4-0cb6e98d895c@gmail.com
         Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    +    (cherry picked from commit 38724591364e1e3b278b4053f102b49ea06ee17c)
    +    Signed-off-by: Bin Lan <lanbincn@qq.com>
     
      ## 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-6.1.y        |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-16  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 10:40 FAILED: patch "[PATCH] iio: adc: rockchip_saradc: fix information leak in triggered" failed to apply to 6.1-stable tree gregkh
2025-01-15 11:18 ` [PATCH 6.1.y] iio: adc: rockchip_saradc: fix information leak in triggered buffer lanbincn
2025-01-16  0:25   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).