mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gaurav Kohli <gkohli@codeaurora.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-kernel@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2] nvmem: core: Set no-read-write provider to avoid userspace read/write
Date: Wed, 20 Mar 2019 23:20:59 +0530	[thread overview]
Message-ID: <68755fdb-b2c6-ac25-a786-7593a692a173@codeaurora.org> (raw)
In-Reply-To: <865519b5-62c9-3eb3-3855-eebf98bded85@linaro.org>


On 3/20/2019 9:56 PM, Srinivas Kandagatla wrote:
>
>
> On 20/03/2019 15:50, Gaurav Kohli wrote:
>>
>> On 3/20/2019 8:04 PM, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 17/03/2019 14:12, Gaurav Kohli wrote:
>>>> Current nvmem framework allows user space to read all register space
>>>> populated by nvmem binary file, In case we don't want to expose value
>>>> of registers to userspace and only want kernel space to read cell
>>>> value from nvmem_cell_read_u32.
>>>>
>>>> To protect the same, Add no-read-write property to prevent read
>>>> from userspace.
>>>>
>>>
>>> Can you explain the real need of this?
>>> Is there any issue you are noticing while reading nvmem content from 
>>> userspace?
>>>
>> Hi Srinivas,
>>
>>
>> No, We are not observing any issue, nvmem is dumping the data properly.
>>
>> But there are certain register, which we don't want to expose to user 
>> space and want kernel space can only read via nvmem_cell_read.
> Am guessing these are some kind of keys or something that you do not 
> want user to see.
>
Hi Srinivas,

Thanks.

Yes exactly, there are certain keys or even certain bit that we don't 
want to expose to user.


> Is root only option not helping you in this case?
Yes we want to protect at root level as well, i mean it is better if we 
can avoid exposing to userspace at all.
>
> We could go down the route of adding new config option something like 
> CONFIG_NVMEM_NO_SYSFS_ENTRY to prevent adding nvmem entry in userspace.
>
> Let me know if you are happy to create a patch for this change?

I am happy with either way config option or dt binding(seems easy), 
please let me know we will post new patch for the same.

In config option, do i have to remove all binary creation code of nvmem 
, correct? or simply put a check like dt binding option

so user cannot read it.

Thanks

Gaurav

>
> Thanks,
> srini
>
>>
>> In existing design, even if we read cell from kernel space, nvmem 
>> binary files is still populated to user space unconditionally.
>>
>> Regards
>>
>> Gaurav

-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.


  reply	other threads:[~2019-03-20 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17 14:12 Gaurav Kohli
2019-03-20 14:34 ` Srinivas Kandagatla
2019-03-20 15:50   ` Gaurav Kohli
2019-03-20 16:26     ` Srinivas Kandagatla
2019-03-20 17:50       ` Gaurav Kohli [this message]
2019-03-21 13:14         ` Marc Gonzalez
2019-03-22 15:02         ` Srinivas Kandagatla
2019-03-22 18:12           ` Gaurav Kohli
2019-03-25  6:15             ` Gaurav Kohli
2019-04-01  4:52               ` Gaurav Kohli
2019-04-02  7:35           ` Niklas Cassel

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=68755fdb-b2c6-ac25-a786-7593a692a173@codeaurora.org \
    --to=gkohli@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /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: link
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

Powered by JetHome