DragonFly BSD
DragonFly kernel List (threaded) for 2005-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: setjmp/lonjmp (was: vinum warning)

From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 01:18:16 +0100
Mail-followup-to: kernel@crater.dragonflybsd.org

On Fri, Feb 04, 2005 at 10:30:47AM +1030, Greg 'groggy' Lehey wrote:
> > Well, I would call vinum_scandisk calling setjmp and afterwards
> > calling parse_config, which can itself call vinum_scandisk, at least
> > dangerous.
> On the contrary, that's the advantage.  Under these circumstances
> you're building a large number of stack frames, and none of the
> intervening ones interest you.

Actually, quite the reverse happens. You still build all the
stack frames and you still have to pass all the way up. It seems
to be save because this code path doesn't longjmp itself. If it
would or the any caller could do so after calling vinum_scandisk,
the system goes havoc. To check this, you have to actually verify
all the functions and that's a lot of work. Beside, shouldn't the
code return directly after the status = EINVAL? After freeing the
buffer of course, but it should not continue like it currently 
might do.


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