Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jun 2003 10:48:40 +0100
From:      David Malone <dwmalone@maths.tcd.ie>
To:        Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Locking, locking...
Message-ID:  <20030602094839.GA65261@walton.maths.tcd.ie>
In-Reply-To: <20030602075328.GV45118@garage.freebsd.pl>
References:  <20030602075328.GV45118@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 02, 2003 at 09:53:28AM +0200, Pawel Jakub Dawidek wrote:
> As we all knew size of list could be changed when we were in malloc().
> Of course we could check list size again after malloc() and mtx_lock(),
> but what to do when it was changed? Recall memory allocation?

By recall, do you mean free the memory you have allocated and begin
the procedure again? Of course, you only have to do this when the
list has got longer.

> If size of this list depends on every process there is a chance to DoS
> such piece of code. Return an error? Not always it is possible.

I'm not sure the DoS potential is so bad. To force restarts the
attacker needs to either keep increasing the length of the list or
increase and decrease it repeatedle. If they can keep increasing
it, then there is a DoS in terms of memory allocation anyway. If
they increase and decrease it, there should be 50-50 chance of the
allocation working each time.

Maybe I've missed something though.

	David.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030602094839.GA65261>