linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma: stm32: replace "%p" with "%pK"
@ 2018-07-06 13:02 Benjamin Gaignard
  2018-07-06 19:38 ` Geert Uytterhoeven
  2018-07-09 17:27 ` Vinod
  0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Gaignard @ 2018-07-06 13:02 UTC (permalink / raw)
  To: vkoul, dan.j.williams, mcoquelin.stm32, alexandre.torgue
  Cc: dmaengine, linux-arm-kernel, linux-kernel, Benjamin Gaignard

The format specifier "%p" can leak kernel addresses.
Use "%pK" instead.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
 drivers/dma/stm32-dma.c  | 4 ++--
 drivers/dma/stm32-mdma.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 8c5807362a25..379e8d534e61 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -594,7 +594,7 @@ static void stm32_dma_start_transfer(struct stm32_dma_chan *chan)
 
 	chan->busy = true;
 
-	dev_dbg(chan2dev(chan), "vchan %p: started\n", &chan->vchan);
+	dev_dbg(chan2dev(chan), "vchan %pK: started\n", &chan->vchan);
 }
 
 static void stm32_dma_configure_next_sg(struct stm32_dma_chan *chan)
@@ -693,7 +693,7 @@ static void stm32_dma_issue_pending(struct dma_chan *c)
 
 	spin_lock_irqsave(&chan->vchan.lock, flags);
 	if (vchan_issue_pending(&chan->vchan) && !chan->desc && !chan->busy) {
-		dev_dbg(chan2dev(chan), "vchan %p: issued\n", &chan->vchan);
+		dev_dbg(chan2dev(chan), "vchan %pK: issued\n", &chan->vchan);
 		stm32_dma_start_transfer(chan);
 
 	}
diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index 9dc450b7ace6..06dd1725375e 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -1170,7 +1170,7 @@ static void stm32_mdma_start_transfer(struct stm32_mdma_chan *chan)
 
 	chan->busy = true;
 
-	dev_dbg(chan2dev(chan), "vchan %p: started\n", &chan->vchan);
+	dev_dbg(chan2dev(chan), "vchan %pK: started\n", &chan->vchan);
 }
 
 static void stm32_mdma_issue_pending(struct dma_chan *c)
@@ -1183,7 +1183,7 @@ static void stm32_mdma_issue_pending(struct dma_chan *c)
 	if (!vchan_issue_pending(&chan->vchan))
 		goto end;
 
-	dev_dbg(chan2dev(chan), "vchan %p: issued\n", &chan->vchan);
+	dev_dbg(chan2dev(chan), "vchan %pK: issued\n", &chan->vchan);
 
 	if (!chan->desc && !chan->busy)
 		stm32_mdma_start_transfer(chan);
@@ -1203,7 +1203,7 @@ static int stm32_mdma_pause(struct dma_chan *c)
 	spin_unlock_irqrestore(&chan->vchan.lock, flags);
 
 	if (!ret)
-		dev_dbg(chan2dev(chan), "vchan %p: pause\n", &chan->vchan);
+		dev_dbg(chan2dev(chan), "vchan %pK: pause\n", &chan->vchan);
 
 	return ret;
 }
@@ -1240,7 +1240,7 @@ static int stm32_mdma_resume(struct dma_chan *c)
 
 	spin_unlock_irqrestore(&chan->vchan.lock, flags);
 
-	dev_dbg(chan2dev(chan), "vchan %p: resume\n", &chan->vchan);
+	dev_dbg(chan2dev(chan), "vchan %pK: resume\n", &chan->vchan);
 
 	return 0;
 }
-- 
2.15.0


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

* Re: [PATCH] dma: stm32: replace "%p" with "%pK"
  2018-07-06 13:02 [PATCH] dma: stm32: replace "%p" with "%pK" Benjamin Gaignard
@ 2018-07-06 19:38 ` Geert Uytterhoeven
  2018-07-07 11:28   ` Benjamin Gaignard
  2018-07-09 17:27 ` Vinod
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-07-06 19:38 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: vkoul, Dan Williams, Maxime Coquelin, Alexandre Torgue,
	dmaengine, Linux Kernel Mailing List, Linux ARM,
	Benjamin Gaignard

Hi Benjamin,

On Fri, Jul 6, 2018 at 3:03 PM Benjamin Gaignard
<benjamin.gaignard@linaro.org> wrote:
> The format specifier "%p" can leak kernel addresses.
> Use "%pK" instead.

Still? Isn't the value randomized these days?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] dma: stm32: replace "%p" with "%pK"
  2018-07-06 19:38 ` Geert Uytterhoeven
@ 2018-07-07 11:28   ` Benjamin Gaignard
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Gaignard @ 2018-07-07 11:28 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: vkoul, Dan Williams, Maxime Coquelin, Alexandre Torgue,
	dmaengine, Linux Kernel Mailing List, Linux ARM,
	Benjamin Gaignard

2018-07-06 21:38 GMT+02:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Benjamin,
>
> On Fri, Jul 6, 2018 at 3:03 PM Benjamin Gaignard
> <benjamin.gaignard@linaro.org> wrote:
>> The format specifier "%p" can leak kernel addresses.
>> Use "%pK" instead.
>
> Still? Isn't the value randomized these days?

%p give an hashed value, with %pK you can use a sysctl to get the real
value if you are root

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] dma: stm32: replace "%p" with "%pK"
  2018-07-06 13:02 [PATCH] dma: stm32: replace "%p" with "%pK" Benjamin Gaignard
  2018-07-06 19:38 ` Geert Uytterhoeven
@ 2018-07-09 17:27 ` Vinod
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod @ 2018-07-09 17:27 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: dan.j.williams, mcoquelin.stm32, alexandre.torgue, dmaengine,
	linux-arm-kernel, linux-kernel, Benjamin Gaignard

On 06-07-18, 15:02, Benjamin Gaignard wrote:
> The format specifier "%p" can leak kernel addresses.
> Use "%pK" instead.

The subsystem name is 'dmaengine' and not dma.
The git log on the subsystem should have told you this

Applied after fixing the tag, thanks.
-- 
~Vinod

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

end of thread, other threads:[~2018-07-09 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 13:02 [PATCH] dma: stm32: replace "%p" with "%pK" Benjamin Gaignard
2018-07-06 19:38 ` Geert Uytterhoeven
2018-07-07 11:28   ` Benjamin Gaignard
2018-07-09 17:27 ` Vinod

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).