public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Casey Schaufler <casey@schaufler-ca.com>
Cc: Eric Paris <eparis@parisplace.org>,
	Jarkko Sakkinen <jarkko.sakkinen@intel.com>,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH] Smack: SMACK_IOCLOADACCESS
Date: Fri, 26 Aug 2011 13:28:43 -0400	[thread overview]
Message-ID: <1314379723.25778.26.camel@moss-pluto> (raw)
In-Reply-To: <4E57C93C.3050602@schaufler-ca.com>

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


  reply	other threads:[~2011-08-26 17:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  5:52 [PATCH] Smack: SMACK_IOCLOADACCESS Jarkko Sakkinen
2011-08-26 12:50 ` Eric Paris
2011-08-26 13:14   ` Alan Cox
2011-08-26 17:36     ` Stephen Smalley
2011-08-26 16:05   ` Sakkinen, Jarkko
2011-08-26 17:01     ` Eric Paris
2011-08-26 21:59       ` Casey Schaufler
2011-08-27  0:16         ` Eric Paris
2011-08-27  5:57       ` Sakkinen, Jarkko
2011-08-26 16:26   ` Casey Schaufler
2011-08-26 17:28     ` Stephen Smalley [this message]
2011-08-26 21:47       ` Casey Schaufler
2011-08-26 17:26 ` Randy Dunlap

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=1314379723.25778.26.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=casey@schaufler-ca.com \
    --cc=eparis@parisplace.org \
    --cc=jarkko.sakkinen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@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