diff mbox series

sound: stm32: replace "%p" with "%pK"

Message ID 20180706130703.22352-1-benjamin.gaignard@st.com
State Accepted
Commit 8db339d66774821091f73bd0e57c8a7511c5988e
Headers show
Series sound: stm32: replace "%p" with "%pK" | expand

Commit Message

Benjamin Gaignard July 6, 2018, 1:07 p.m. UTC
The format specifier "%p" can leak kernel addresses.
Use "%pK" instead.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>

---
 sound/soc/stm/stm32_adfsdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.15.0

Comments

Takashi Iwai July 6, 2018, 2:59 p.m. UTC | #1
On Fri, 06 Jul 2018 15:07:03 +0200,
Benjamin Gaignard wrote:
> 

> The format specifier "%p" can leak kernel addresses.

> Use "%pK" instead.

> 

> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>


The code change itself is OK (apart from the subject prefix to be
"ASoC").  But do we really want to patch manually every single place
like this?  There are thousands of files using '%p'.


thanks,

Takashi
Benjamin Gaignard July 7, 2018, 11:29 a.m. UTC | #2
2018-07-06 16:59 GMT+02:00 Takashi Iwai <tiwai@suse.de>:
> On Fri, 06 Jul 2018 15:07:03 +0200,

> Benjamin Gaignard wrote:

>>

>> The format specifier "%p" can leak kernel addresses.

>> Use "%pK" instead.

>>

>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>

>

> The code change itself is OK (apart from the subject prefix to be

> "ASoC").  But do we really want to patch manually every single place

> like this?  There are thousands of files using '%p'.


I have limited myself to the few remaining %p in STM32 architecture.

>

>

> thanks,

>

> Takashi
diff mbox series

Patch

diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index db73fef3e500..0e9373064032 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -149,7 +149,7 @@  static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
 	unsigned int old_pos = priv->pos;
 	unsigned int cur_size = size;
 
-	dev_dbg(rtd->dev, "%s: buff_add :%p, pos = %d, size = %zu\n",
+	dev_dbg(rtd->dev, "%s: buff_add :%pK, pos = %d, size = %zu\n",
 		__func__, &pcm_buff[priv->pos], priv->pos, size);
 
 	if ((priv->pos + size) > buff_size) {