----- Original Message -----
> From: "Steven Rostedt" <rost...@goodmis.org>
> To: "Peter Zijlstra" <pet...@infradead.org>
> Cc: "Mathieu Desnoyers" <mathieu.desnoy...@efficios.com>, 
> linux-kernel@vger.kernel.org, "KOSAKI Motohiro"
> <kosaki.motoh...@jp.fujitsu.com>, "Paul E. McKenney" 
> <paul...@linux.vnet.ibm.com>, "Nicholas Miell"
> <nmi...@comcast.net>, "Linus Torvalds" <torva...@linux-foundation.org>, "Ingo 
> Molnar" <mi...@redhat.com>, "Alan Cox"
> <gno...@lxorguk.ukuu.org.uk>, "Lai Jiangshan" <la...@cn.fujitsu.com>, 
> "Stephen Hemminger"
> <step...@networkplumber.org>, "Andrew Morton" <a...@linux-foundation.org>, 
> "Josh Triplett" <j...@joshtriplett.org>,
> "Thomas Gleixner" <t...@linutronix.de>, "David Howells" 
> <dhowe...@redhat.com>, "Nick Piggin" <npig...@kernel.dk>
> Sent: Monday, March 16, 2015 10:24:30 AM
> Subject: Re: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier 
> (x86) (v12)
> 
> On Mon, 16 Mar 2015 15:19:39 +0100
> Peter Zijlstra <pet...@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.

As I pointed out in my other email, EXPEDITED | ~PRIVATE currently
returns -EINVAL. The only way to do a system-wide barrier with
this membarrier implementation is to use synchronize_sched() (~EXPEDITED),
which I strongly doubt would perform a DoS.

If we eventually care about a EXPEDITED | ~PRIVATE implementation,
then I agree that rate limiting might be a good way to do it. I would
be a bit uncomfortable sending IPIs to _all_ CPUs though, even with
rate limiting. But perhaps it's a non-issue ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to