Re: PCI BAR sysfs node permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 09, 2014 at 04:22:35PM -0500, Dennis McLeod wrote:
> need help figuring out how to make this happen. If my pci driver is
> instructed to open a pci device, I want to change the mode of bar0's
> sysfs node to o+rw so a user app can mmap it.
> 
> In other words, from the driver, perform this:
> chmod 766 /sys/bus/pci/[slot path]/resource0
> preferably without a lecture on why I shouldn't .. ;-)

Sorry, you will get a lecture if you try to do something as foolish as
this from within the kernel.

If you "really" need this, do it from userspace, with a script you grant
root permissions to change the mode on the files.

> If I chmod that sysfs node for bar0 as root, i can run a user process
> (as regular user) that does an mmap of that and can do reads/writes to
> the bar resource. I would like for my pci driver to do this
> automatically when it is told to open a device.

Nope, that's a bad idea, and you know that as well.

sorry.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux