Project

General

Profile

Actions

Feature #16656

closed

mount.ceph: enable consumption of ceph keyring files

Added by John Spray almost 8 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
nautilus
Reviewed:
Affected Versions:
Component(FS):
kceph
Labels (FS):
Pull request ID:

Description

Jeff pointed this out in doc review:

we really ought to fix up the mount helper to use the same sort of keyring file as the fuse client. While it's not hard to strip out the secret from the keyring file, it's not obvious and is somewhat "fiddly".


Related issues 2 (0 open2 closed)

Related to CephFS - Bug #41892: qa: convert kcephfs qa tests to use mount.ceph auto-discovery featuresResolvedJeff Layton

Actions
Copied to CephFS - Backport #41890: nautilus: mount.ceph: enable consumption of ceph keyring filesResolvedNathan CutlerActions
Actions #1

Updated by Jeff Layton almost 8 years ago

  • Assignee set to Jeff Layton

I'll go ahead and grab this one. Not a high priority but definitely a nice-to-have from a usability perspective.

Actions #2

Updated by Greg Farnum almost 8 years ago

  • Category set to Administration/Usability
Actions #3

Updated by Patrick Donnelly about 5 years ago

  • Assignee deleted (Jeff Layton)
Actions #4

Updated by Jeff Layton over 4 years ago

  • Assignee set to Jeff Layton
Actions #5

Updated by Patrick Donnelly over 4 years ago

  • Subject changed from Enable mount.ceph to consume ceph keyring files to mount.ceph: enable consumption of ceph keyring files
  • Status changed from New to In Progress
  • Priority changed from Normal to High
  • Target version set to v15.0.0
  • Start date deleted (07/12/2016)
  • Source changed from other to Development
  • Backport set to nautilus
  • Component(FS) kceph added
Actions #6

Updated by Jeff Layton over 4 years ago

My current thinking is to link in libceph-common, create a context and fetch the keys using the same C++ routines that we use in librados/libcephfs, etc. We'll need to copy the key into an allocated buffer, but that should be no big deal.

My main worry is doing all of that in a privileged task. /bin/mount is a setuid program, and this could potentially open a new attack vector if there are buffer overruns or something in these libraries.

One potential way to deal with that would be to have the client fork, drop privileges in the child and do all of the keyring parsing work there. The child would get the secret and pass it back to the parent using MAP_SHARED|MAP_ANONYMOUS memory.

Actions #7

Updated by Patrick Donnelly over 4 years ago

Jeff Layton wrote:

My current thinking is to link in libceph-common, create a context and fetch the keys using the same C++ routines that we use in librados/libcephfs, etc. We'll need to copy the key into an allocated buffer, but that should be no big deal.

My main worry is doing all of that in a privileged task. /bin/mount is a setuid program, and this could potentially open a new attack vector if there are buffer overruns or something in these libraries.

One potential way to deal with that would be to have the client fork, drop privileges in the child and do all of the keyring parsing work there. The child would get the secret and pass it back to the parent using MAP_SHARED|MAP_ANONYMOUS memory.

If you're going to the trouble of forking a child, perhaps we can just fork/execve /usr/bin/ceph and fetch the key that way?

Actions #8

Updated by Jeff Layton over 4 years ago

That's certainly another possibility. I'm not sure it's any easier though.

We'd have to scrape and parse the output of the command (which is always complex), and deal with potential changes to the error messages or output format.

I'm going to stick with plan A for now, but I'll keep that scheme in mind if it becomes untenable.

Actions #9

Updated by Patrick Donnelly over 4 years ago

Jeff Layton wrote:

That's certainly another possibility. I'm not sure it's any easier though.

We'd have to scrape and parse the output of the command (which is always complex), and deal with potential changes to the error messages or output format.

We can always make the output simple (possibly with a new sub-command) for the purposes of mount.ceph. With tests, we can catch any regressions.

I'm going to stick with plan A for now, but I'll keep that scheme in mind if it becomes untenable.

ACK, fine with me.

Actions #10

Updated by Patrick Donnelly over 4 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 29642
Actions #11

Updated by Jeff Layton over 4 years ago

PR here: https://github.com/ceph/ceph/pull/29642

It occurs to me though that now that we have a way to get to the ceph config, we could expand the usage here too. It might be nice to also implement auto-discovery of mon addrs, for instance:

# mount -t ceph foo /mnt/cephfs

...when the mount helper doesn't understand the "device" part, it could search the config for mon addrs, which could then be handed off to the kernel. Potentially we could fetch other settings out of the conf as well.

That said, w could implement this later, after the initial patchset is merged.

Actions #12

Updated by Jeff Layton over 4 years ago

Updated PR here:

https://github.com/ceph/ceph/pull/29817

This not only allows the helper to find cephx secrets from keyrings, but also monitor addresses when they aren't specified.

Actions #13

Updated by Patrick Donnelly over 4 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #14

Updated by Nathan Cutler over 4 years ago

  • Copied to Backport #41890: nautilus: mount.ceph: enable consumption of ceph keyring files added
Actions #15

Updated by Patrick Donnelly over 4 years ago

  • Related to Bug #41892: qa: convert kcephfs qa tests to use mount.ceph auto-discovery features added
Actions #16

Updated by Nathan Cutler over 4 years ago

  • Pull request ID changed from 29642 to 29817
Actions #17

Updated by Patrick Donnelly over 4 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF