mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Prasad Sodagudi <quic_psodagud@quicinc.com>
Cc: linux-spi@vger.kernel.org, linux-i2c@vger.kernel.org,
	wsa@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Query] Looking for comments on CONFIG_SPI_SPIDEV and CONFIG_I2C_CHARDEV interfaces security
Date: Tue, 31 May 2022 17:41:06 +0200	[thread overview]
Message-ID: <YpY3Er7F6hdzTfH1@sirena.org.uk> (raw)
In-Reply-To: <78873437-3b35-0711-a1dc-219b9f316fac@quicinc.com>

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

On Tue, May 31, 2022 at 08:25:26AM -0700, Prasad Sodagudi wrote:

> I am working on an IoT solution and would like to understand security impact
> of these two CONFIG_SPI_SPIDEV and CONFIG_I2C_CHARDEV interfaces of Linux.
> If a driver is developed from userspace for  /dev/spiX.Y or /dev/i2c
> interfaces,  are there any security concerns ?

Well, you have to ensure that only userspace processes that you
want to have access to the spidev and I2C interfaces actually
have access to them which is something that could go wrong.  For
I2C you IIRC don't have a mechanism to partition devices between
different users since it all goes through /dev/i2c rather than
per device userspace devices.

> Userspace driver is to control external SPI slave on board. I heard that
> these interfaces allows access to any of these type of devices on board.
> How to avoid accessing any of these type of unwanted device access from
> userspace ?  Can Selinux or any mechanism control access to other these type
> of devices from user-space ?

You can use all the usual permission mechanisms to control access
to devices (probably using udev to set up permissions when things
are instantiated).  I'd expect this to include SELinux.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2022-05-31 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 15:25 Prasad Sodagudi
2022-05-31 15:41 ` Mark Brown [this message]

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=YpY3Er7F6hdzTfH1@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=quic_psodagud@quicinc.com \
    --cc=wsa@kernel.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

all inboxes | Powered by JetHome®