Re: Use of alternate stack for signal handler



Kasper Dupont <57203463996516718595@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> limit the stack cannot grow forever before hitting

The classic heap/stack collision.

> should stop doing it, if the extra page would cause the
> stack to touch another mapping. I haven't tested that,
> but I'm going to do so.

A worthwhile experiment. Please report back.

> If you overflow a kernel stack, you are going to corrupt
> kernel data structures. This may lead to strange problems.
> A way to detect stack overflows in the kernel would be
> convenient for debuging (it probably has been done).

Ouch! I would hope that the kernel bottom-of-stack [limit]
would have a marker (0xDEADBEEF is classic) to show if
it had been trampled.

> Threads share the same address space.

Sure! But fork() and friends had better separate[CoW] their
stacks lest function calls (especially blocking syscalls)
do wierd and wonderous things :)

-- Robert


>
.



Relevant Pages

  • Re: [PATCH] Port SquashFS to 2.6
    ... >> telling whether it contains stack overflows waiting to happen, ... > It would be an interesting experiment to deliberately make the kernel ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [tip:tracing/urgent] tracing: Fix too large stack usage in do_one_initcall()
    ... trigger hard to debug stack overflows again on 32-bit. ... Plus, i looked at the oops cited above, and it's in the idle thread. ... It could certainly be done - a sufficiently enabled kernel has to be ...
    (Linux-Kernel)
  • [Full-disclosure] PHRACK 64: ATTACKING THE CORE
    ... - The Slab Allocator ... - Slab overflow exploiting: ... - Forcing a kernel path to sleep ... - Stack Frame Flow Recovery ...
    (Full-Disclosure)
  • Re: [Bug #11342] Linux 2.6.27-rc3: kernel BUG at mm/vmalloc.c - bisected
    ... stack usages for you is that they contain a 'cpumask_t' on the stack. ... We can enable MAXSMP and raise the CPU limits some time in the future. ... not accept a specially built kernel, but only a kernel that has been ... know how extensively these distributions test and certify for many known ...
    (Linux-Kernel)
  • Re: Interrupt context...
    ... > gone through most of the posts on interrupt in usenet. ... > kernel stack and ISR is executed. ... More may be saved depending on the architecture. ... Here the kernel have assembler code to save all general ...
    (comp.os.linux.development.system)