[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interrupt disabled rules



On Wed, 30 May 2001, Cedric Berger wrote:

> It is a bad idea because malloc call splimp() internally, and you are not
> allowed to lower the priority level. i.e. you cannot call malloc if you're
> running higher than splimp. (splimp and splhigh may be the same on some
> arch, though)
> On the other end, if your malloc call cannot succeeed immediately because
> of low memory condition, malloc() will call tsleep, which will release the
> implicit lock before sleeping, meaning any other thread can run at that point,

thanks.  so there shouldn't be any calls to malloc with interrupts
disabled (at least as much as splimp)?

> and I don't see how it could cause a denial-of-service?

on linux, if interrupts are disabled, and the user pointer is swapped out,
it causes trouble.  so a bad user can pass in a swapped out pointer to a
code segment that has interrupts disabled.  i'm not a linux user, so i
don't really know details.  but i'm trying to adapt some linux rules to
openbsd.



--
Ted -- grendel@heorot.stanford.edu -- http://heorot.stanford.edu/grendel/
Keep your vogue code that all have.   /   Tomorrow's world we've all seen.
Keep your modern ways and keep your bugs. / The metal man is here to stay.
                           - Theatre of Tragedy, "Machine"