public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Suman Anna <s-anna@ti•com>
To: "Andrew F. Davis" <afd@ti•com>,
	Bjorn Andersson <bjorn.andersson@linaro•org>
Cc: linux-arm-kernel@lists•infradead.org,
	linux-remoteproc@vger•kernel.org, linux-kernel@vger•kernel.org,
	Loic Pallardy <loic.pallardy@st•com>
Subject: Re: [PATCH] rpmsg: virtio_rpmsg_bus: replace "%p" with "%pK"
Date: Mon, 12 Aug 2019 11:39:27 -0500	[thread overview]
Message-ID: <ea1efb4e-43be-4efc-10f8-9d182313bf12@ti.com> (raw)
In-Reply-To: <92dc4403-8782-8dbf-b912-cc832ac748a7@ti.com>

On 8/12/19 11:36 AM, Andrew F. Davis wrote:
> On 8/12/19 12:28 PM, Suman Anna wrote:
>> On 8/12/19 10:47 AM, Andrew F. Davis wrote:
>>> On 10/23/18 9:19 PM, Suman Anna wrote:
>>>> The virtio_rpmsg_bus driver uses the "%p" format-specifier for
>>>> printing the vring buffer address. This prints only a hashed
>>>> pointer even for previliged users. Use "%pK" instead so that
>>>> the address can be printed during debug using kptr_restrict
>>>> sysctl.
>>>>
>>>
>>>
>>> s/previliged/privileged
>>
>> Bjorn,
>> Can you fix this up when applying.
>>
>>>
>>> You describe what the code does, but not why you need this. %pK is used
>>> for only about 1% of pointer printing, why do you want to leak this
>>> address to userspace at all?
>>
>> Andrew,
>> Default behavior of %pK is same as %p, but it does allow you to control
>> the print. The reason is clearly mentioned in the last sentence in the
>> patch description.
>>
> 
> 
> Let me rephrase then, why would you ever set 'kptr_restrict' to anything
> other than 0, or why do you want to be able to leak this address to
> userspace at all? If the answer is just because you can, then all 12,000
> instances of %p in kernel could be converted for the same reason.

It is a dev_dbg statement, so it is already under dynamic debug control.
We would only ever use it during debug.

regards
Suman

> 
> Andrew
> 
> 
>> regards
>> Suman
>>
>>>
>>> Andrew
>>>
>>>
>>>> Signed-off-by: Suman Anna <s-anna@ti•com>
>>>> ---
>>>>  drivers/rpmsg/virtio_rpmsg_bus.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
>>>> index f29dee731026..1345f373a1a0 100644
>>>> --- a/drivers/rpmsg/virtio_rpmsg_bus.c
>>>> +++ b/drivers/rpmsg/virtio_rpmsg_bus.c
>>>> @@ -950,7 +950,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
>>>>  		goto vqs_del;
>>>>  	}
>>>>  
>>>> -	dev_dbg(&vdev->dev, "buffers: va %p, dma %pad\n",
>>>> +	dev_dbg(&vdev->dev, "buffers: va %pK, dma %pad\n",
>>>>  		bufs_va, &vrp->bufs_dma);
>>>>  
>>>>  	/* half of the buffers is dedicated for RX */
>>>>
>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-12 16:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  1:19 [PATCH] rpmsg: virtio_rpmsg_bus: replace "%p" with "%pK" Suman Anna
2019-08-09 20:25 ` Suman Anna
2019-08-27  5:10   ` Bjorn Andersson
2019-08-27 20:25     ` Suman Anna
2019-08-27 22:07       ` Bjorn Andersson
2019-08-27 22:15         ` Suman Anna
2019-08-27 22:17           ` Suman Anna
2019-08-27 22:23             ` Bjorn Andersson
2019-08-12 15:47 ` Andrew F. Davis
2019-08-12 16:28   ` Suman Anna
2019-08-12 16:36     ` Andrew F. Davis
2019-08-12 16:39       ` Suman Anna [this message]
2019-08-12 16:48         ` Andrew F. Davis

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=ea1efb4e-43be-4efc-10f8-9d182313bf12@ti.com \
    --to=s-anna@ti$(echo .)com \
    --cc=afd@ti$(echo .)com \
    --cc=bjorn.andersson@linaro$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-remoteproc@vger$(echo .)kernel.org \
    --cc=loic.pallardy@st$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox