From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbdA3WWM (ORCPT ); Mon, 30 Jan 2017 17:22:12 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34413 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753059AbdA3WWK (ORCPT ); Mon, 30 Jan 2017 17:22:10 -0500 Date: Mon, 30 Jan 2017 23:11:43 +0100 From: Pavel Machek To: David Herrmann Cc: Linus Torvalds , Linux Kernel Mailing List , Andy Lutomirski , Jiri Kosina , Greg KH , Hannes Reinecke , Steven Rostedt , Arnd Bergmann , Tom Gundersen , Josh Triplett , Andrew Morton Subject: Re: [RFC v1 00/14] Bus1 Kernel Message Bus Message-ID: <20170130221142.GA16743@amd> References: <20161026191810.12275-1-dh.herrmann@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I'm a bit late to the party... > Example: > Imagine a receiver with a limit of 1024 handles. A sender transmits a > message to that receiver. It gets access to half the limit not used by > anyone else, hence 512 handles. It does not matter how many senders > there are, nor how many messages are sent, it will reach its quota at > 512. As long as they all belong to the same user, they will share the > quota and can queue at most 512 handles. If a second sending user > comes into play, it gets half the remaining not used by anyone else, > which ends up being 256. And so on... If the peer dequeues messages in > between, the numbers get higher again. But if you do the math, the > most you can get is 50% of the targets resources, if you're the only > sender. In all other cases you get less (like intertwined transfers, > etc). >=20 > We did look into sender-based inflight accounting, but the same set of > issues arises. Sure, a Request+Reply model would make this easier to > handle, but we want to explicitly support a Subscribe+Event{n} model. > In this case there is more than one Reply to a message. >=20 > Long story short: We have uid<->uid quotas so far, which prevent DoS > attacks, unless you get access to a ridiculous amount of local UIDs. > Details on which resources are accounted can be found in the wiki > [1]. So if there's limit of 1024 handles, all I need is 10 UIDs, right? That might be a problem on multiuser unix machine, but on Android phones, each application gets its own UID. So all you need is 10 applications to bring the system down... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAliPuh4ACgkQMOfwapXb+vKtYgCglj3gEn3oFszX3ltAYi8TIS7e 3poAnRDEhtQMnpNFPMmN+z4pn/kZ1uyT =OdUT -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--