Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

Previous thread: JBD-DEBUG /proc/sys entry (again) by Rusev on Thursday, October 4, 2007 - 5:28 am. (2 messages)

Next thread: Is it possible to have a robust futex outside of a mutex? by Gilles Carry on Thursday, October 4, 2007 - 7:14 am. (1 message)
From: Mikael Pettersson
Date: Thursday, October 4, 2007 - 6:08 am

Exactly right. You mprotect or munmap the end of the altstack,
not the area beyond it.

/Mikael
-

From: Shi Weihua
Date: Thursday, October 4, 2007 - 5:55 pm

So we tell users "Even if you protectted half of mmap's space, but you must to register all space to 
kernel. " ?

The image about my test code's result:
               No patch        Patched
┌───────────┐
│           │← 1 ┌ ← 3          ← 1
│    A      │    │(wraparound)
│           │    │
│           │← 2 │              ← 2
│           │    │
├───────────┤    │
│▒▒▒▒▒▒▒▒▒▒▒│← 3 ┘              ← 3
│▒▒▒▒B▒▒▒▒▒▒│                  (caught)
│▒protected▒│
│▒▒▒▒▒▒▒▒▒▒▒│
│▒▒▒▒▒▒▒▒▒▒▒│
└───────────┘
A+B  mmap's space
A    sigaltstack
B    protectted

I agree that if register A+B to kernel, the wraparound will stop.
But if register A to kernel, why not kernel do something?

Thanks

-

Previous thread: JBD-DEBUG /proc/sys entry (again) by Rusev on Thursday, October 4, 2007 - 5:28 am. (2 messages)

Next thread: Is it possible to have a robust futex outside of a mutex? by Gilles Carry on Thursday, October 4, 2007 - 7:14 am. (1 message)