-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Hi,
We're working on implementing access control using Assise leases. We have a proposed methodology, but have a few questions about the code.
Before presenting the questions, here's our current proposed methodology:
- Each LibFS registers with a SharedFS upon initialization. We would add an extra step where the LibFS shares its owner and the owner's primary group with the local SharedFS.
- The local SharedFS would track these values in a map (PID to owner and group).
- The map could be backed up to a private file for crash consistency.
- Any LibFS requests must first go through the local SharedFS, so if we need to forward this information to another SharedFS, any forwarded requests would also include this owner + group information.
- The SharedFS holding the requested file/directory will make the lease decision. Three new fields in the inode,
uid,gid, andperms, will be added.uidandgidmatch the process's class (user, group, other).- The type of lease (read/write) will determine which set of permissions in
permsto check against.
- If the lease is granted, it will behave identically to current Assise, regardless of whether the permissions of the file/directory change.
- If a process maliciously writes to its log when it's denied permissions (or has no lease in general), digesting those log entries should fail because the process didn't have the lease at that time.
Here's our questions:
- Do we also need to implement execute permissions?
- Read leases don't seem to be implemented in KernFS's
modify_lease_statefunction.- Do we need to implement these?
- Could we instead just do a naive check and return something like
-EACCESif the permissions check doesn't work out?
acquire_leaseis commented out innamex, which is presumably where Assise goes to acquire leases.- Is this supposed to be left commented out?
- If so, where does LibFS guide POSIX calls to acquire read/write leases?
- We propose to have SharedFSes track the owner / the owner's primary group of each local LibFS.
- We can't find any existing data structure in libfs/src/mkfs/mfks.c or kernfs/fs.c that explicitly sets up relationships between LibFSes and KernFSes.
- Can we assume that these relationships are registered statically?
- If so, how can we send process owner + group information to SharedFSes when a LibFS starts up? Is this a secure procedure, or should we assume processes can lie about their owner?
- Should there be any changes to the digestion of logs?
- If our permission checks are correct, and digestion rejects writes from processes that lack(ed) the write leases at the time of their writes, then the answer should be no.
- Are there any edge cases where lease history is unused for checking the validity of log writes?
- How can we run libfs as a non-privileged user?
- For example, running
./run.sh iotest sw 2G 4K 1(nosudo) yields the following error. It looks like something in the shim requires extra privileges. - Would it be okay to spoof LibFS owners / groups in our tests, if this is something we can't avoid?
- For example, running
dev-dax engine is initialized: dev_path /dev/dax0.0 size 4096 MB
fetching node's IP address..
Process pid is 19681
ip address on interface 'lo' is 127.0.0.1
cluster settings:
--- node 0 - ip:127.0.0.1
Connecting to KernFS instance 0 [ip: 127.0.0.1]
[Local-Client] Creating connection (pid:19681, app_type:0, status:pending) to 127.0.0.1:12345 on sockfd 0
[Local-Client] Creating connection (pid:19681, app_type:1, status:pending) to 127.0.0.1:12345 on sockfd 1
[Local-Client] Creating connection (pid:19681, app_type:2, status:pending) to 127.0.0.1:12345 on sockfd 2
In thread
In thread
In thread
SEND --> MSG_INIT [pid 0|19681]
RECV <-- MSG_SHM [paths: /shm_recv_0|/shm_send_0]
shm_open failed.
: Permission denied
- When running the lease test, e.g.
sudo ./run.sh lease_test c 1 1, we cannot run the test as we get an error, for example:incorrect fd -2: file /mlfs/fileset/f0_7618.- Other tests, like many_files_test, work fine.
- We see similar errors when running
sudo ./run_lease_test_example.shin the output logs. What can we do to solve this?
Thanks for your help!
Metadata
Metadata
Assignees
Labels
No labels