EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: setcap and nosuid
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: "Siddons, David" <siddons at bnl.gov>
Cc: EPICS Tech-Talk <tech-talk at aps.anl.gov>
Date: Tue, 2 Feb 2021 08:40:51 -0800
On 2/2/21 8:21 AM, Siddons, David wrote:
> Hi David,
>   I believe I'm hitting the same issue. In an embedded IOC I need to access /dev/mem, which requires privilege. The system is Debian 10, on a ZynQ processor. I want to run this IOC as a regular user, not root. I tried setcap, but always get:
> 
> Failed to get capabilities of file `./regrw' (Operation not supported)
> whatever file I try it on.
> 
> I also tried putting the user in the kmem group, like /dev/mem:
> 
> ls -l /dev/mem                                      
> crw-r----- 1 root kmem 1, 1 Feb  1 21:05 /dev/mem
> 
> groups hera                                          
> hera : hera kmem sudo i2c
> 
> Although that worked for /dev/i2c, it did not for /dev/mem. Is this a symptom of what you described? How do I fix it?

This looks like a different issue.  You mention ZynQ.  Are using using a custom Linux kernel build?
If so, you probably don't have all of the configuration options needed.  eg. file capabilities are
stored as extended attributes, so you will need to compile in support for XATTRS for whatever
filesystems you are using.

> $ grep XATTR /boot/config-5.9.0-0.bpo.5-amd64 
> CONFIG_REISERFS_FS_XATTR=y
> CONFIG_F2FS_FS_XATTR=y
> CONFIG_TMPFS_XATTR=y
> CONFIG_JFFS2_FS_XATTR=y
> CONFIG_UBIFS_FS_XATTR=y
> CONFIG_SQUASHFS_XATTR=y
> CONFIG_EROFS_FS_XATTR=y
> CONFIG_CIFS_XATTR=y

I'm not certain what all options are needed.

References:
setcap and nosuid Michael Davidsaver via Tech-talk
Re: setcap and nosuid Siddons, David via Tech-talk

Navigate by Date:
Prev: Re: setcap and nosuid Siddons, David via Tech-talk
Next: Re: setcap and nosuid Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: setcap and nosuid Siddons, David via Tech-talk
Next: Re: setcap and nosuid Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 02 Feb 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·