lkml.org 
[lkml]   [2011]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Smack: SMACK_IOCLOADACCESS
From
Date
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. 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,
not an abuse of write(), and recommended by the vfs maintainer to us. I
think we're safe on that one.

--
Stephen Smalley
National Security Agency



\
 
 \ /
  Last update: 2011-08-26 19:43    [W:0.082 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site