From: Loic Pallardy <loic.pallardy@st.com> To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, arnaud.pouliquen@st.com, benjamin.gaignard@linaro.org, Loic Pallardy <loic.pallardy@st.com> Subject: [PATCH 1/1] remoteproc: replace "%p" with "%pK" Date: Fri, 6 Jul 2018 14:38:27 +0200 [thread overview] Message-ID: <1530880707-29333-1-git-send-email-loic.pallardy@st.com> (raw) The format specifier "%p" can leak kernel addresses. Use "%pK" instead. This patch proposes changes for remoteproc core only. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> --- drivers/remoteproc/remoteproc_core.c | 6 +++--- drivers/remoteproc/remoteproc_debugfs.c | 4 ++-- drivers/remoteproc/remoteproc_virtio.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index a9609d9..c597f0c 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -241,7 +241,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) if (notifyid > rproc->max_notifyid) rproc->max_notifyid = notifyid; - dev_dbg(dev, "vring%d: va %p dma %pad size 0x%x idr %d\n", + dev_dbg(dev, "vring%d: va %pK dma %pad size 0x%x idr %d\n", i, va, &dma, size, notifyid); rvring->va = va; @@ -497,7 +497,7 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, rproc->num_traces++; - dev_dbg(dev, "%s added: va %p, da 0x%x, len 0x%x\n", + dev_dbg(dev, "%s added: va %pK, da 0x%x, len 0x%x\n", name, ptr, rsc->da, rsc->len); return 0; @@ -635,7 +635,7 @@ static int rproc_handle_carveout(struct rproc *rproc, goto free_carv; } - dev_dbg(dev, "carveout va %p, dma %pad, len 0x%x\n", + dev_dbg(dev, "carveout va %pK, dma %pad, len 0x%x\n", va, &dma, rsc->len); /* diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index a204883..a5c29f2 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -231,7 +231,7 @@ static int rproc_rsc_table_show(struct seq_file *seq, void *p) } break; default: - seq_printf(seq, "Unknown resource type found: %d [hdr: %p]\n", + seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n", hdr->type, hdr); break; } @@ -260,7 +260,7 @@ static int rproc_carveouts_show(struct seq_file *seq, void *p) list_for_each_entry(carveout, &rproc->carveouts, node) { seq_puts(seq, "Carveout memory entry:\n"); - seq_printf(seq, "\tVirtual address: %p\n", carveout->va); + seq_printf(seq, "\tVirtual address: %pK\n", carveout->va); seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma); seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da); seq_printf(seq, "\tLength: 0x%x Bytes\n\n", carveout->len); diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index b0633fd..bbecd44 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -96,7 +96,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev, size = vring_size(len, rvring->align); memset(addr, 0, size); - dev_dbg(dev, "vring%d: va %p qsz %d notifyid %d\n", + dev_dbg(dev, "vring%d: va %pK qsz %d notifyid %d\n", id, addr, len, rvring->notifyid); /* -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: Loic Pallardy <loic.pallardy@st.com> To: <bjorn.andersson@linaro.org>, <ohad@wizery.com> Cc: <linux-remoteproc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <arnaud.pouliquen@st.com>, <benjamin.gaignard@linaro.org>, Loic Pallardy <loic.pallardy@st.com> Subject: [PATCH 1/1] remoteproc: replace "%p" with "%pK" Date: Fri, 6 Jul 2018 14:38:27 +0200 [thread overview] Message-ID: <1530880707-29333-1-git-send-email-loic.pallardy@st.com> (raw) The format specifier "%p" can leak kernel addresses. Use "%pK" instead. This patch proposes changes for remoteproc core only. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> --- drivers/remoteproc/remoteproc_core.c | 6 +++--- drivers/remoteproc/remoteproc_debugfs.c | 4 ++-- drivers/remoteproc/remoteproc_virtio.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index a9609d9..c597f0c 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -241,7 +241,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) if (notifyid > rproc->max_notifyid) rproc->max_notifyid = notifyid; - dev_dbg(dev, "vring%d: va %p dma %pad size 0x%x idr %d\n", + dev_dbg(dev, "vring%d: va %pK dma %pad size 0x%x idr %d\n", i, va, &dma, size, notifyid); rvring->va = va; @@ -497,7 +497,7 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, rproc->num_traces++; - dev_dbg(dev, "%s added: va %p, da 0x%x, len 0x%x\n", + dev_dbg(dev, "%s added: va %pK, da 0x%x, len 0x%x\n", name, ptr, rsc->da, rsc->len); return 0; @@ -635,7 +635,7 @@ static int rproc_handle_carveout(struct rproc *rproc, goto free_carv; } - dev_dbg(dev, "carveout va %p, dma %pad, len 0x%x\n", + dev_dbg(dev, "carveout va %pK, dma %pad, len 0x%x\n", va, &dma, rsc->len); /* diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index a204883..a5c29f2 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -231,7 +231,7 @@ static int rproc_rsc_table_show(struct seq_file *seq, void *p) } break; default: - seq_printf(seq, "Unknown resource type found: %d [hdr: %p]\n", + seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n", hdr->type, hdr); break; } @@ -260,7 +260,7 @@ static int rproc_carveouts_show(struct seq_file *seq, void *p) list_for_each_entry(carveout, &rproc->carveouts, node) { seq_puts(seq, "Carveout memory entry:\n"); - seq_printf(seq, "\tVirtual address: %p\n", carveout->va); + seq_printf(seq, "\tVirtual address: %pK\n", carveout->va); seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma); seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da); seq_printf(seq, "\tLength: 0x%x Bytes\n\n", carveout->len); diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index b0633fd..bbecd44 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -96,7 +96,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev, size = vring_size(len, rvring->align); memset(addr, 0, size); - dev_dbg(dev, "vring%d: va %p qsz %d notifyid %d\n", + dev_dbg(dev, "vring%d: va %pK qsz %d notifyid %d\n", id, addr, len, rvring->notifyid); /* -- 1.9.1
next reply other threads:[~2018-07-06 12:38 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-06 12:38 Loic Pallardy [this message] 2018-07-06 12:38 ` [PATCH 1/1] remoteproc: replace "%p" with "%pK" Loic Pallardy 2018-07-25 20:27 ` Suman Anna 2018-07-25 20:27 ` Suman Anna
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1530880707-29333-1-git-send-email-loic.pallardy@st.com \ --to=loic.pallardy@st.com \ --cc=arnaud.pouliquen@st.com \ --cc=benjamin.gaignard@linaro.org \ --cc=bjorn.andersson@linaro.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-remoteproc@vger.kernel.org \ --cc=ohad@wizery.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.