HSM _not only_ small fixes and to do list goes here
(LU-3647)
|
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.5.0 |
| Fix Version/s: | Lustre 2.5.0 |
| Type: | Technical task | Priority: | Blocker |
| Reporter: | John Hammond | Assignee: | John Hammond |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | HSM | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 10032 | ||||||||
| Description |
|
We have two kinds of missing permission checks in HSM. I'll call them "bad" and "less-bad." Here are the bad ones: By guessing its FID an unprivileged user can archive and restore an arbitrary file, even one which is otherwise inaccessible. An unprivileged user can also cancel running HSM actions on an arbitrary file, and send a remove command. If write permission for other is set on the file then an unprivileged user can get about 1/2 through HSM release, failing at the call to mo_xattr_set() on the orphan, just before layout_swap. The less-bad ones involve the rights to perform various HSM operations on a file owned by the user. In this case there is some disagreement about what should be allowed (some discussion on Some questions: Which less-bad operations should be permitted by default? How should additional permissions be granted? (/proc tunable, setuid() binary, policy tool?) Should explicit restore be treated differently from implicit restore? I propose that by default all explicit HSM actions require root or CAP_SYS_ADMIN. The next level can be enabled via /proc and allows explicit archive, release, and restore to the file owner. |
| Comments |
| Comment by Peter Jones [ 30/Aug/13 ] |
|
Bruno Could you please look into this one? Thanks Peter |
| Comment by John Hammond [ 30/Aug/13 ] |
|
Also the CT ioctls LL_IOC_HSM_CT_START, LL_IOC_HSM_PROGRESS, LL_IOC_HSM_COPY_START, LL_IOC_HSM_COPY_END are completely unrestricted. A non-root user with access to a lustre mount point can register as a copytool. And the same user running on the same node as a CT, with access to any lustre mount point on that node can unregister the CT by crafting a KUC with the CT's PID and group KUC_GRP_HSM. |
| Comment by Malcolm Cowe (Inactive) [ 04/Sep/13 ] |
|
I would suggest a restrictive set of permissions for all operations except restore. I make an exception for restore, as anyone with read privileges on a file should reasonably expect to be able to access the file, even if it has been released. It’s implied in the nature of the restore operation (whether invoked explicitly or implicitly). Other commands could be left as super-user commands, with sudo or equivalent providing the necessary privilege escalation, at least as a stop-gap. If we documented this adequately, it would provide a reasonable implementation. I agree with you that the copytools must only be managed by the super-user. I’ve included some other notes: Archive Files
Release files
Restore Files
Remove files
Cancel
Questions
|
| Comment by jacques-charles lafoucriere [ 04/Sep/13 ] |
|
I think we must have a simple tunnable (through CDT policy flags => managed by CDT?) like control on/off. Many sites will not care of who is doing what.
|
| Comment by Bruno Faccini (Inactive) [ 04/Sep/13 ] |
|
Malcolm, thanks for the list that we can use as a start point for the "high-level" control for this task. I already see that we need to also add notes about the eXecution right/bit, do we allow for explicit/implicit restore when execution bit is set ? John, J-C, what do you think if, we start with implementation of 3 modes, no-control/root-only/enhanced ? Also and as very 1st step, for root-only mode, what do you think would be the best/simplest way to implement it, in ll_xx_ioctl() with just a tunable/proc to set the mode ? |
| Comment by John Hammond [ 04/Sep/13 ] |
|
I started a patch on for this that would do the following.
This patch will not distinguish between implicit restore and explicit restore. Begin the flames. |
| Comment by Thomas LEIBOVICI - CEA (Inactive) [ 05/Sep/13 ] |
|
Thank you Malcolm for this work of listing all actions and the related permissions. However, some of these permissions doesn't look appropriate for a production system,
This should be a tunable, basically if we want to prevent users from archiving their files after each modification
This should be a tunable, this can be a way for the user to give an hint to the system
This sounds dangerous. I don't want users to be able to invalidate copies in the backend an uncontrolled way. Add the following case:
Thomas |
| Comment by Malcolm Cowe (Inactive) [ 05/Sep/13 ] |
|
Hi Thomas, I agree with your comments: archive and release should be tuneable and remove should be a privileged operation (users can make mistakes after all). My original thought was just to make sure that these operations should be protected such that the owner of a file does not get any unwelcome surprises. I support your amendments. |
| Comment by John Hammond [ 05/Sep/13 ] |
|
Please see http://review.whamcloud.com/7565. |
| Comment by Bruno Faccini (Inactive) [ 06/Sep/13 ] |
|
All, |
| Comment by Aurelien Degremont (Inactive) [ 09/Sep/13 ] |
|
I'm OK with John's proposal. I think Gerrit #7565 will be fine for a first round. |
| Comment by Peter Jones [ 08/Oct/13 ] |
|
Landed for 2.5 |