Re: kernel programming questions

Michael Weller (eowmob@exp-math.uni-essen.de)
Tue, 1 Jul 1997 17:17:12 +0200 (MESZ)


On Tue, 1 Jul 1997, David S. Miller wrote:

> From: tim@franck.Princeton.EDU (Tim Hollebeek)
> Date: Tue, 1 Jul 1997 08:49:47 -0400 (EDT)
>
> Richard B. Johnson writes ...
>
> It's a more natural way of expressing alloca()....

Now, after this issue is settled, you allocate a dynamical array on the
stack, whose size might become unpredictable big (if it were just 1 or 2
entries you could just allocate it statical).

I don't think the linux KERNEL stack can shrink and grow easily and
efficiently. Instead I'd assume you open Pandorra's box here by allowing
stack overflows at certain weird (and not necessarily related to your
code) occasions all over the kernel. Probably allocating your array with
kmalloc is more robust and stable although more pain to code (esp. as you
have to check for allocation failure!)?

Michael.

(eowmob@exp-math.uni-essen.de or eowmob@pollux.exp-math.uni-essen.de
Please do not use my vm or de0hrz1a accounts anymore. In case of real
problems reaching me try mat42b@spi.power.uni-essen.de instead.)