linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Schaufler, Casey" <casey.schaufler@intel.com>
To: Jann Horn <jannh@google.com>
Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"Dock, Deneen T" <deneen.t.dock@intel.com>,
	"kristen@linux.intel.com" <kristen@linux.intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: RE: [PATCH RFC v2 3/5] LSM: Security module checking for side-channel dangers
Date: Mon, 20 Aug 2018 15:31:22 +0000	[thread overview]
Message-ID: <99FC4B6EFCEFD44486C35F4C281DC6732143F7A4@ORSMSX107.amr.corp.intel.com> (raw)
In-Reply-To: <CAG48ez3aB5X9=hqepovG6L4vQYZjzHZ6fWqdd4Vtzh92u2J5fQ@mail.gmail.com>

> -----Original Message-----
> From: Jann Horn [mailto:jannh@google.com]
> Sent: Friday, August 17, 2018 4:53 PM
> To: Schaufler, Casey <casey.schaufler@intel.com>
> Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>; kernel list
> <linux-kernel@vger.kernel.org>; linux-security-module <linux-security-
> module@vger.kernel.org>; selinux@tycho.nsa.gov; Hansen, Dave
> <dave.hansen@intel.com>; Dock, Deneen T <deneen.t.dock@intel.com>;
> kristen@linux.intel.com; Arjan van de Ven <arjan@linux.intel.com>
> Subject: Re: [PATCH RFC v2 3/5] LSM: Security module checking for side-
> channel dangers
> 
> On Sat, Aug 18, 2018 at 12:17 AM Casey Schaufler
> <casey.schaufler@intel.com> wrote:
> >
> > From: Casey Schaufler <cschaufler@localhost.localdomain>
> >
> > The sidechannel LSM checks for cases where a side-channel
> > attack may be dangerous based on security attributes of tasks.
> > This includes:
> >         Effective UID of the tasks is different
> >         Capablity sets are different
> >         Tasks are in different namespaces
> > An option is also provided to assert that task are never
> > to be considered safe. This is high paranoia, and expensive
> > as well.
> >
> > Signed-off-by: Casey Schaufler <casey.schaufler@intel.com>
> [...]
> > +#ifdef CONFIG_SECURITY_SIDECHANNEL_UIDS
> > +static int safe_by_uid(struct task_struct *p)
> > +{
> > +       const struct cred *ccred = current_real_cred();
> > +       const struct cred *pcred = get_task_cred(p);
> > +
> > +       /*
> > +        * Credential checks. Considered safe if:
> > +        *      UIDs are the same
> > +        */
> > +       if (ccred != pcred && ccred->euid.val != pcred->euid.val)
> > +               return -EACCES;
> > +       return 0;
> > +}
> 
> This function looks bogus. get_task_cred() bumps the refcount on the
> returned cred struct pointer, but you don't drop it. You probably want
> to use something that doesn't fiddle with the refcount at all here to
> avoid cacheline bouncing - possibly a raw rcu_dereference_protected()
> if there are no better helpers.
> 
> Same thing for the other get_task_cred() calls further down in the patch.

Thanks. Looks like I whacked out v2 a bit hastily.


  reply	other threads:[~2018-08-20 15:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 22:16 [PATCH RFC v2 0/5] LSM: Add and use a hook for side-channel safety checks Casey Schaufler
2018-08-17 22:16 ` [PATCH RFC v2 1/5] LSM: Introduce a hook for side-channel danger Casey Schaufler
2018-08-17 22:16 ` [PATCH RFC v2 2/5] X86: Support LSM determination of side-channel vulnerability Casey Schaufler
2018-08-17 23:55   ` Jann Horn
2018-08-20 14:45     ` Schaufler, Casey
2018-08-21 10:20       ` Jann Horn
2018-08-21 16:37         ` Schaufler, Casey
2018-08-21 17:45           ` Jann Horn
2018-08-17 22:16 ` [PATCH RFC v2 3/5] LSM: Security module checking for side-channel dangers Casey Schaufler
2018-08-17 23:52   ` Jann Horn
2018-08-20 15:31     ` Schaufler, Casey [this message]
2018-08-17 22:16 ` [PATCH RFC v2 4/5] Smack: Support determination of side-channel vulnerability Casey Schaufler
2018-08-17 22:16 ` [PATCH RFC v2 5/5] SELinux: Support SELinux " Casey Schaufler
2018-08-20 16:02   ` Stephen Smalley
2018-08-20 16:59     ` Schaufler, Casey
2018-08-20 17:43       ` Stephen Smalley
2018-08-20 19:30         ` Schaufler, Casey

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=99FC4B6EFCEFD44486C35F4C281DC6732143F7A4@ORSMSX107.amr.corp.intel.com \
    --to=casey.schaufler@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=deneen.t.dock@intel.com \
    --cc=jannh@google.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=selinux@tycho.nsa.gov \
    /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;
as well as URLs for NNTP newsgroup(s).