From: David Sterba <dsterba@suse.cz>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>,
Niklas Cassel <Niklas.Cassel@wdc.com>,
Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN
Date: Thu, 3 Jun 2021 12:04:37 +0200 [thread overview]
Message-ID: <20210603100436.GV31483@twin.jikos.cz> (raw)
In-Reply-To: <DM6PR04MB7081B69E31BB7ADDF02E2D9BE73C9@DM6PR04MB7081.namprd04.prod.outlook.com>
On Thu, Jun 03, 2021 at 10:00:08AM +0000, Damien Le Moal wrote:
> On 2021/06/03 18:54, David Sterba wrote:
> > On Mon, May 31, 2021 at 01:54:53PM +0000, Niklas Cassel wrote:
> >> From: Niklas Cassel <niklas.cassel@wdc.com>
> >>
> >> Performing a BLKREPORTZONE operation should be allowed under the same
> >> permissions as read(). (read() does not require CAP_SYS_ADMIN).
> >>
> >> Remove the CAP_SYS_ADMIN requirement, and instead check that the fd was
> >> successfully opened with FMODE_READ. This way BLKREPORTZONE will match
> >> the access control requirement of read().
> >
> > Does this mean that a process that does not have read nor write access
> > to the device itself (blocks) is capable of reading the zone
> > information? Eg. some monitoring tool.
>
> With this change, to do a report zones, the process will only need to have read
> access to the device. And if it has read access, it also means that it can read
> the zones content.
Ok, so this is a bit restricting. The zone information is like block
device metadata, comparing it to a file that has permissionx 0600 I can
see the all the stat info (name, tiemstamps) but can't read the data.
But as the ioctl work, it needs a file descriptor and there's probably
no way to separate the permissions to read blocks and just the metadata.
For a monitoring/reporting tool this would be useful. Eg. for btrfs it
could be part of filesystem status overview regarding full or near-full
zones and emitting an early warning or poking some service to start the
reclaim.
next prev parent reply other threads:[~2021-06-03 10:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 13:54 [PATCH 0/2] allow blk-zoned ioctls " Niklas Cassel
2021-05-31 13:54 ` [PATCH 1/2] blk-zoned: allow zone management send operations " Niklas Cassel
2021-05-31 13:54 ` [PATCH 2/2] blk-zoned: allow BLKREPORTZONE " Niklas Cassel
2021-06-03 9:51 ` David Sterba
2021-06-03 10:00 ` Damien Le Moal
2021-06-03 10:04 ` David Sterba [this message]
2021-06-03 11:20 ` Damien Le Moal
2021-06-03 11:59 ` Niklas Cassel
2021-06-03 14:44 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210603100436.GV31483@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=Damien.LeMoal@wdc.com \
--cc=Niklas.Cassel@wdc.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®