public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Nicholas Miell <nmiell@comcast.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@redhat.com>,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	David Howells <dhowells@redhat.com>,
	Nick Piggin <npiggin@kernel.dk>
Subject: Re: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12)
Date: Mon, 16 Mar 2015 08:49:40 -0700	[thread overview]
Message-ID: <20150316154940.GA32325@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150316102430.186f4919@gandalf.local.home>

On Mon, Mar 16, 2015 at 10:24:30AM -0400, Steven Rostedt wrote:
> On Mon, 16 Mar 2015 15:19:39 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > 
> > I suppose this is an unprivileged syscall; so what do we do about:
> > 
> > 	for (;;)
> > 		sys_membar(EXPEDITED);
> > 
> > Which would spray the entire system with IPIs at break neck speed.
> 
> Perhaps it should be rate limited. Have parameters (controlled via
> sysctl) that will only allow so many of these per ms. If it exceeds it,
> then the call will end up being a schedule_timeout() till it is allowed
> to continue. Thus, the above will spit out a few hundred IPIs, then
> sleep for a millisecond, and then spit out another hundred IPIs and
> sleep again.
> 
> That would prevent any DoS attacks.

But this would only qualify as a DoS if MEMBARRIER_EXPEDITED_FLAG and
!MEMBARRIER_PRIVATE_FLAG.  Otherwise, the user's process is only DoSing
itself, which is that user's problem, not anyone else's.  And it looks
like the current patch refuses to implement this DoS case, unless I am
really confused about the code in membarrier_expedited().  And in fact
membarrier_validate_flags() checks for this DoS case and returns -EINVAL.

So I do not believe that this syscall permits that type of DoS.

What am I missing here?

							Thanx, Paul


  parent reply	other threads:[~2015-03-16 15:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15 19:24 [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12) Mathieu Desnoyers
2015-03-15 22:05 ` Paul E. McKenney
2015-03-16  3:25 ` Josh Triplett
2015-03-16 13:00   ` Mathieu Desnoyers
2015-03-16 14:19 ` Peter Zijlstra
2015-03-16 14:24   ` Steven Rostedt
2015-03-16 15:49     ` Mathieu Desnoyers
2015-03-16 15:49     ` Paul E. McKenney [this message]
2015-03-16 16:12       ` Steven Rostedt
2015-03-16 15:43   ` Mathieu Desnoyers
2015-03-16 15:57     ` Mathieu Desnoyers
2015-03-16 17:13     ` Peter Zijlstra
2015-03-16 17:21     ` Peter Zijlstra
2015-03-16 18:53       ` Mathieu Desnoyers
2015-03-16 20:54         ` Peter Zijlstra
2015-03-17  1:45           ` Mathieu Desnoyers
2015-03-17  2:26             ` Steven Rostedt
2015-03-17  6:40               ` Peter Zijlstra
2015-03-17 11:44                 ` Paul E. McKenney
2015-03-17 14:10                   ` Steven Rostedt
2015-03-17 16:35                     ` Paul E. McKenney
2015-03-17 12:46               ` Mathieu Desnoyers
2015-03-18  1:06                 ` Steven Rostedt
2015-03-17  6:30             ` Peter Zijlstra
2015-03-17 11:56               ` Paul E. McKenney
2015-03-17 12:01                 ` Paul E. McKenney
2015-03-17 13:13               ` Mathieu Desnoyers
2015-03-17 16:36                 ` Mathieu Desnoyers
2015-03-17 16:48                   ` Paul E. McKenney
2015-03-17 17:55                   ` josh
2015-03-17 16:37                 ` Peter Zijlstra
2015-03-17 16:49                   ` Paul E. McKenney
2015-03-17 17:00                     ` Peter Zijlstra
2015-03-16 17:24     ` Peter Zijlstra

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=20150316154940.GA32325@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=josh@joshtriplett.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=nmiell@comcast.net \
    --cc=npiggin@kernel.dk \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=stephen@networkplumber.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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