Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM: pass "UserPerm" struct throughout Client for security checks #11218

Merged
merged 101 commits into from Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
084e7ae
client: create new UserPerm struct to use instead of uid/gid pairs
gregsfortytwo Jul 7, 2016
990dd5e
client: add pick_my_perms() function for implementers
gregsfortytwo Jun 29, 2016
183544d
client: add UserPerm-based may_*() and (inode|xattr) _permission chec…
gregsfortytwo Jul 7, 2016
81665ba
client: add UserPerm-based path_walk()
gregsfortytwo Jul 7, 2016
f40218c
client: pass UserPerm to getdir()
gregsfortytwo Jun 28, 2016
dbdf402
client: always pass UserPerms to opendir() and variants
gregsfortytwo Jun 28, 2016
bc9cac1
client: always pass UserPerm to [_]link()
gregsfortytwo Jun 29, 2016
db40270
client: add UserPerm-based _lookup() and make_request() functions
gregsfortytwo Jul 11, 2016
f904c1a
client: always pass UserPerm to unlink functions
gregsfortytwo Jul 11, 2016
7f03b86
client: always pass a UserPerm to rename functions
gregsfortytwo Jul 12, 2016
affddbc
client: always pass a UserPerm to mkdir and mksnap functions
gregsfortytwo Jul 12, 2016
aaf6915
client: always pass a UserPerm to ll_lookup
gregsfortytwo Jul 27, 2016
c0061cf
Client: add UserPerm translation functions for handling [x]attr stuff
gregsfortytwo Jul 27, 2016
9a06306
client: always pass a UserPerm to the ll_* functions
gregsfortytwo Jul 27, 2016
78f7b41
client: always pass UserPerm to rmsnap()
gregsfortytwo Jul 27, 2016
16cc0e6
client: always pass a UserPerm to getxattr variants
gregsfortytwo Jul 27, 2016
2312d9a
client: always pass a UserPerm to listxattr variants
gregsfortytwo Jul 27, 2016
201c560
client: always pass a UserPerm to setxattr variants
gregsfortytwo Jul 27, 2016
d1a77ee
client: always pass a UserPerm to removexattr variants
gregsfortytwo Jul 27, 2016
d9a7f15
client: always pass a UserPerm to public setattr variants
gregsfortytwo Jul 27, 2016
e5da1d0
client: use get_gid()/get_uid() instead of pick_my_perms() directly
gregsfortytwo Jul 27, 2016
ad1bd57
client: always pass a UserPerm to chmod variants
gregsfortytwo Jul 27, 2016
f648baf
client: always pass a UserPerm to chown variants
gregsfortytwo Jul 27, 2016
acec3d3
client: always pass a UserPerm to utime variants
gregsfortytwo Jul 27, 2016
9aae93a
client: always pass a UserPerm to truncate variants
gregsfortytwo Jul 27, 2016
7130657
client: remove non-UserPerm _setattr implementation
gregsfortytwo Jul 28, 2016
882468a
client: always pass a UserPerm to stat variants
gregsfortytwo Jul 28, 2016
be9e43e
client: always pass a UserPerm to seek variants
gregsfortytwo Jul 28, 2016
94bac72
client: generate UserPerm _open and _create variants
gregsfortytwo Jul 28, 2016
7a5cdaa
client: switch ll_open and ll_create to be UserPerm-based
gregsfortytwo Jul 28, 2016
73ad8b4
client: remove unused ll_listxattr_chunks declaration
gregsfortytwo Jul 28, 2016
5c06275
client: add a UserPerm param to mount
gregsfortytwo Jul 29, 2016
6a7a743
client: switch _do_lookup() to UserPerm
gregsfortytwo Jul 29, 2016
16b3fce
client: switch make_request implementation and verify_reply_trace to …
gregsfortytwo Jul 28, 2016
4b2771b
client: switch may_*() function implementations to UserPerm
gregsfortytwo Jul 29, 2016
18f4b16
client: switch _lookup() implementation to UserPerm
gregsfortytwo Jul 29, 2016
f7c5706
client: switch path_walk() implementation to UserPerm
gregsfortytwo Jul 29, 2016
71878e3
client: switch _getattr() implementation to UserPerm
gregsfortytwo Jul 29, 2016
78e2028
client: switch _open() implementation to UserPerm
gregsfortytwo Jul 29, 2016
e482a50
client: switch _create() implementation to UserPerm
gregsfortytwo Jul 29, 2016
e2b766b
client: switch xattr_permission() implementation to UserPerm
gregsfortytwo Jul 29, 2016
7767a4e
client: remove spurious RequestUserGroups from xattr_permission
gregsfortytwo Jul 29, 2016
885f848
client: remove client reference from RequestUserGroups
gregsfortytwo Jul 29, 2016
0a2c887
client: remove uid/gid-based make_request, push up logic
gregsfortytwo Jul 30, 2016
ba67819
client: pass UserPerm to chdir() and getcwd()
gregsfortytwo Jul 30, 2016
dfbac03
client: pass UserPerm to statfs() variants
gregsfortytwo Jul 30, 2016
56bd07b
client: store UserPerms in dir_result_t and use on MDS requests
gregsfortytwo Jul 30, 2016
95df48b
client: pass UserPerm to lookup_hash()
gregsfortytwo Jul 30, 2016
193fb0a
client: pass UserPerm to lookup_ino()
gregsfortytwo Jul 30, 2016
4d37088
client: pass UserPerm to lookup_parent()
gregsfortytwo Aug 1, 2016
898154f
client: pass UserPerm to lookup_name()
gregsfortytwo Aug 2, 2016
17d1f7e
client: track which request uid/gid granted a cap
gregsfortytwo Aug 2, 2016
b05e06e
client: fill in cap renewals with the "best" uid/gid perms
gregsfortytwo Aug 2, 2016
4cc7c40
client: store "actor" UserPerm in Fh, use for requesting file locks a…
gregsfortytwo Aug 2, 2016
8e1cbfc
client: fill in _interrupt_filelock() with MetaRequest's uid/gid
gregsfortytwo Aug 2, 2016
3aeca21
client: use Fh::actor_perm for _write()
gregsfortytwo Aug 2, 2016
3caa4d2
client: pass UserPerm to get_quota_root() and quota helpers
gregsfortytwo Aug 2, 2016
db3ec73
client: use UserPerm for _posix_acl_chmod
gregsfortytwo Aug 2, 2016
a440947
client: pass UserPerm to readlink()
gregsfortytwo Aug 3, 2016
5c6748d
client: pass UserPerm to all open() variants
gregsfortytwo Aug 3, 2016
e9156ad
client: pass UserPerm to ll_walk()
gregsfortytwo Aug 3, 2016
9819587
client: pass UserPerm to describe_layout()
gregsfortytwo Aug 3, 2016
540c9a8
client: pass UserPerm to get_caps_issued()
gregsfortytwo Aug 3, 2016
78d83d8
client: remove uid-based path_walk()
gregsfortytwo Aug 3, 2016
d3cad9b
client: use Fh::actor_perms for _read() and _write()
gregsfortytwo Aug 3, 2016
c8cd75f
client: switch _posix_acl_create() to UserPerm
gregsfortytwo Aug 3, 2016
d7740fc
client: call _getattr() with UserPerm in posix checkers
gregsfortytwo Aug 3, 2016
4183205
client: remove uid-based _geattr() functions
gregsfortytwo Aug 3, 2016
2c8403a
client: remove uid-based _create()
gregsfortytwo Aug 3, 2016
a1d52fa
client: add a UserPerm to MetaRequest
gregsfortytwo Aug 3, 2016
0529a1d
client: move UserPerm into its own header file
gregsfortytwo Aug 3, 2016
a13b5b6
client: include UserPerm.h in MetaRequest.h
gregsfortytwo Aug 3, 2016
fa76047
client: replace Inode's "best" logic with a UserPerm over gid/uid pair
gregsfortytwo Aug 3, 2016
d519f82
client: remove now-unused owner_(uid|gid) from dir_result_t
gregsfortytwo Aug 3, 2016
06d177b
client: pass UserPerm to mkdirs, rmdir, symlink, mknod
gregsfortytwo Aug 3, 2016
a81d962
client: remove now-unused uid-based may_* functions
gregsfortytwo Aug 3, 2016
876c58e
client: remove get_(uid|gid) functions
gregsfortytwo Aug 3, 2016
d24966f
UserPerm: add trivial implementation of UserGroup interface equivalents
gregsfortytwo Aug 3, 2016
30c6787
client: switch inode_permission() to UserPerm-based (over UserGroups)
gregsfortytwo Aug 3, 2016
8295afa
client: switch Inode::check_mode() to UserPerm
gregsfortytwo Aug 3, 2016
c04c520
client: push UserGroups into _posix_acl_permission(), instead of pass…
gregsfortytwo Aug 3, 2016
ead687b
client: stop using UserGroups for posix ACL checks
gregsfortytwo Aug 3, 2016
07ed90e
client: Actually handle gid lists in UserPerm
gregsfortytwo Aug 3, 2016
94c35ab
client: stop using UserGroups for may_setattr() now that UserPerm doe…
gregsfortytwo Aug 3, 2016
07d6fc0
client: remove the now-unused UserGroups entirely
gregsfortytwo Aug 3, 2016
d291e66
MClientRequest: include the full gid list of the caller
gregsfortytwo Aug 6, 2016
36a1816
client: give UserPerm a move constructor
gregsfortytwo Aug 6, 2016
47fc83f
fuse: optionally (off by default) set the group lists on calls
gregsfortytwo Aug 6, 2016
5a1b9f8
client: add a static pick_my_perms taking a CephContext
gregsfortytwo Sep 1, 2016
a8f214f
Client: always pass a Fh to _do_filelock
gregsfortytwo Sep 1, 2016
550a59d
client: include UserPerm contents in may_* debug output
gregsfortytwo Sep 8, 2016
24279ef
client: do a shallow copy for MetaRequest::perms
gregsfortytwo Sep 12, 2016
e35d027
libcephfs: repeatedly use new default_perms instead of pick_my_perms()
gregsfortytwo Sep 12, 2016
fbda12b
mds: pass full gid list to MDSAuthCap checks, when present
gregsfortytwo Sep 14, 2016
99bea1e
mds: do not make use of GIDs which aren't included by the Client in i…
gregsfortytwo Sep 21, 2016
0eb8e4c
test: basic checks on gid list is_capable
gregsfortytwo Sep 14, 2016
28981f4
client: use uid_t/gid_t in _getgrouplist
gregsfortytwo Sep 21, 2016
7d2a8b7
Merge remote-tracking branch 'origin/master' into wip-getuid
gregsfortytwo Sep 24, 2016
6da13e9
test: temporarily disable tests which relied on MDS' incorrect GID-ad…
gregsfortytwo Sep 26, 2016
a67f61f
mds: sort GID lists in MDSAuthCaps
gregsfortytwo Sep 26, 2016
42b1572
client: in UserPerm, correctly use delete[] and don't leak gids on copy
gregsfortytwo Sep 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ceph_fuse.cc
Expand Up @@ -189,6 +189,7 @@ int main(int argc, const char **argv, const char *envp[]) {
Messenger *messenger = NULL;
Client *client;
CephFuse *cfuse;
UserPerm perms;

MonClient *mc = new MonClient(g_ceph_context);
int r = mc->build_initial_monmap();
Expand Down Expand Up @@ -234,10 +235,11 @@ int main(int argc, const char **argv, const char *envp[]) {
}

client->update_metadata("mount_point", cfuse->get_mount_point());

perms = client->pick_my_perms();
// start up fuse
// use my argc, argv (make sure you pass a mount point!)
r = client->mount(g_conf->client_mountpoint.c_str(), g_ceph_context->_conf->fuse_require_active_mds);
r = client->mount(g_conf->client_mountpoint.c_str(), perms,
g_ceph_context->_conf->fuse_require_active_mds);
if (r < 0) {
if (r == CEPH_FUSE_NO_MDS_UP)
cerr << "ceph-fuse[" << getpid() << "]: probably no MDS server is up?" << std::endl;
Expand Down