[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E581469.9000401@schaufler-ca.com>
Date: Fri, 26 Aug 2011 14:47:21 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Stephen Smalley <sds@...ho.nsa.gov>
CC: Eric Paris <eparis@...isplace.org>,
Jarkko Sakkinen <jarkko.sakkinen@...el.com>,
linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] Smack: SMACK_IOCLOADACCESS
On 8/26/2011 10:28 AM, Stephen Smalley wrote:
> On Fri, 2011-08-26 at 09:26 -0700, Casey Schaufler wrote:
>> Is that really how it works? The code reads as if the buffer
>> passed by write gets modified in place and the writer is expected
>> to use that. There is nothing in the code that looks like the
>> response is getting set aside for a subsequent read. If it works
>> the way you say it does it will be subject to races up the wazoo.
>> If it works the way I think the code says it does it is abusive
>> of the write interface.
> It is a transaction-based IO, modeled after nfsctl, recommended to us by
> viro when we first implemented selinuxfs.
OK, I get that. Looking at the code it sure as shooting ain't obvious
to someone unfamiliar with the transaction system what is going on,
and I'm taking it on faith that it's working correctly.
> Userspace writes the input
> arguments to the file, the kernel computes the result and stores it in a
> file-private buffer (hence unique for each open instance, not shared by
> multiple openers), and userspace then reads that result back. Not racy,
Well, in the absence of forks or multithreading.
> not an abuse of write(),
I personally think it is, but given that the transaction model
is used elsewhere I don't have a viable argument against your
using it.
> and recommended by the vfs maintainer to us. I
> think we're safe on that one.
Yes, I concur that you have followed the rules and advice given you.
That does not mean I agree that this is a good approach.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists