Re: [lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-07 Thread Souvik Datta
Hello, I am now able to read "/var/lib/lxcfs/sys/power/state" correctly through the FUSE file system. However, when I am trying to do a $echo "mem" > /var/lib/lxcfs/sys/power/state, I am getting "Operation not permitted" error. I have ensured that /var/lib/lxcfs/sys/power/state mode is 644

Re: [lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-06 Thread Stéphane Graber
LXCFS' goal is to show accurate resource information in containers. It's not meant as a security mechanism nor can it be used as one. If all you're trying to do is prevent access to /sys/power/state, you'll want to use an LSM for this or just use an unprivileged container which won't be able to

Re: [lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-05 Thread Souvik Datta
Thanks Stephane. Yes, I understand your point and completely agree. However, can you please let me know the issue, why I am not able to add /sys/power/state in the FUSE? Thanks and Regards, Souvik On 6/6/20, Stéphane Graber wrote: > LXCFS' goal is to show accurate resource information in

Re: [lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-05 Thread Souvik Datta
Thanks Christian. I am using in a VirtualBox inside which I am running lxcfs Distributor ID: Ubuntu Description:Ubuntu 18.04.4 LTS Release:18.04 Codename: bionic the source code version of lxcfs that I am using is:- 4.0.0 My objective is to prevent the OS, running inside LXC

Re: [lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-04 Thread Christian Brauner
On Wed, Jun 03, 2020 at 11:06:23PM +0530, Souvik Datta wrote: > Hello, > I am trying to understand the source code of LXCFS. My final objective > is to add /sys/power/state file as an entry. I understand the changes > that need to be done in sysfs_fuse.c/h to support this. > > To do this, first I

[lxc-devel] Understanding - LXCFS source code to add /sys/power/state as an entry in LXCFS

2020-06-03 Thread Souvik Datta
Hello, I am trying to understand the source code of LXCFS. My final objective is to add /sys/power/state file as an entry. I understand the changes that need to be done in sysfs_fuse.c/h to support this. To do this, first I am first trying to understand, how the sys entry -