mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: fix a potential double-fetch bug in sched_copy_attr
Date: Mon, 7 Jan 2019 18:11:01 +0100	[thread overview]
Message-ID: <20190107171101.GI14122@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20181225221648.70069-1-kjlu@umn.edu>

On Tue, Dec 25, 2018 at 04:16:47PM -0600, Kangjie Lu wrote:
> "uattr->size" is copied in from user space and checked. However, it is
> copied in again after the security check. A malicious user may race to
> change it. The fix checks if uattr->size is ever changed after the
> check.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---

> +	/* Sanity check if size was changed in user space */
> +	if (attr->size != size)
> +		return -EINVAL;
> +

What perf_copy_attr() does (from whence we copied this code) is:

	attr->size = size;

Would that not also fix things?

  reply	other threads:[~2019-01-07 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-25 22:16 Kangjie Lu
2019-01-07 17:11 ` Peter Zijlstra [this message]
2019-01-09  7:45   ` [PATCH v2] " Kangjie Lu
2019-01-21 11:32     ` [tip:sched/core] sched/core: Fix a potential double-fetch bug in sched_copy_attr() tip-bot for Kangjie Lu
2019-01-27 11:04       ` Thomas Gleixner
2019-01-27 11:28         ` Ingo Molnar
2019-01-28  7:58         ` Peter Zijlstra
2019-01-28 13:15           ` Thomas Gleixner
2019-03-10 10:09             ` Thomas Gleixner

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=20190107171101.GI14122@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pakki001@umn.edu \
    /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

Powered by JetHome