Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237541

Re: [PATCH 1/5] fs: Verify access of user towards block device file when mounting

From ebiederm@xmission.com (Eric W. Biederman)
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] fs: Verify access of user towards block device file when mounting
Date 2015-10-01 18:10 +0200
Message-ID <qeOAH-15a-33@gated-at.bofh.it> (permalink)
References <qew13-758-3@gated-at.bofh.it> <qew14-758-13@gated-at.bofh.it> <qezih-3gr-9@gated-at.bofh.it> <qeLCO-4xp-21@gated-at.bofh.it> <qeMpc-66l-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Mike Snitzer <snitzer@redhat.com> writes:

> What layer establishes access rights to historically root-only
> priviledged block devices?  Is it user namespaces?

Block devices are weird.

Mounts historically have not checked the permissions on the block
devices because a mounter has CAP_SYS_ADMIN.

Unprivileged users are allowes to read/write block devices if
someone has given them permissions on the device node in the
filesystem.

The thinking with this patchset is to start performing the normal
block device access permission checks when mounting filesystems
when the mounter does not have the global CAP_SYS_ADMIN permission.

The truth is we are not much past the point of realizing that there were
no permission checks to use the actual block device passed in to mount,
so we could still be missing something. There is a lot going on with dm,
md, and lvm.  I don't know if the model of just look at the block device
inode and perform the permission checks is good enough.

> I haven't kept up with user namespaces as it relates to stacking block
> drivers like DM.  But I'm happy to come up to speed and at the same time
> help you verify all works as expected with DM blocks devices...

We are just getting there.  But if you can help that would be great.
The primary concern with dm is what happens when unprivileged users get
ahold of the code, and what happens when evil users corrupt the on-disk
format.

In principle dm like loop should be safe to use if there are not bugs
that make it unsafe for unprivileged users to access the code.

The goal if possible is to run things like docker without needed to be
root or even more fun to run docker in a container, and in general
enable nested containers.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] fs: Verify access of user towards block device file when mounting Seth Forshee <seth.forshee@canonical.com> - 2015-09-30 22:20 +0200
  Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Mike Snitzer <snitzer@redhat.com> - 2015-10-01 01:50 +0200
    Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Seth Forshee <seth.forshee@canonical.com> - 2015-10-01 15:00 +0200
      Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Mike Snitzer <snitzer@redhat.com> - 2015-10-01 15:50 +0200
        Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Seth Forshee <seth.forshee@canonical.com> - 2015-10-01 16:50 +0200
        Re: [PATCH 1/5] fs: Verify access of user towards block device file when mounting ebiederm@xmission.com (Eric W. Biederman) - 2015-10-01 18:10 +0200
          Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Jan Kara <jack@suse.cz> - 2015-10-02 01:10 +0200
            Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Seth Forshee <seth.forshee@canonical.com> - 2015-10-05 16:30 +0200
  Re: [PATCH 1/5] fs: Verify access of user towards block device file when mounting ebiederm@xmission.com (Eric W. Biederman) - 2015-10-01 17:50 +0200
    Re: [PATCH 1/5] fs: Verify access of user towards block device file  when mounting Seth Forshee <seth.forshee@canonical.com> - 2015-10-01 18:00 +0200

csiph-web