[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c94ce566-c788-7dc2-4b76-a57fd78aaec8@redhat.com>
Date: Fri, 16 Nov 2018 22:08:35 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Bart Van Assche <bvanassche@....org>,
"Theodore Y. Ts'o" <tytso@....edu>
Cc: Christoph Hellwig <hch@...radead.org>,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
Hannes Reinecke <hare@...e.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
James Bottomley <James.Bottomley@...senpartnership.com>
Subject: Re: [PATCH 0/3] SG_IO command filtering via sysfs
On 16/11/18 19:17, Bart Van Assche wrote:
> On Fri, 2018-11-16 at 12:43 -0500, Theodore Y. Ts'o wrote:
>> I'd argue that a purpose-built eBPF access control facility is
>> superior to the security_file_ioctl() LSM hook because it can make
>> available to the authorization function access to the cached results
>> of the SCSI INQUIRY command, and it avoids needing to duplicate
>> knowledge of how to parse the parameters of the SG_IO ioctl in the LSM
>> module as well as in the SCSI stack.
>
> If an eBPF program would decide which SG_IO commands will be executed
> and which ones not, does that mean that a SCSI parser would have to be
> implemented in eBPF? If so, does that mean that both the eBPF and the
> LSM approach share the disadvantage of requiring to do SCSI CDB parsing
> outside the SCSI core?
The LSM approach cannot do SCSI CDB parsing, unless you add a special
SCSI-specific hook called after parsing the SG_IO argument, due to race
conditions. I'd rather not do that, however it would have that
disadvantage indeed.
The eBPF approach pushes the policy and the parsing entirely to
userspace, so I'm not sure you can say it's a disadvantage. It's just a
different design. If you use SG_IO you're already in for writing
userspace code that handles CDBs, sense data etc.
Paolo
Powered by blists - more mailing lists