Messages in this thread | | | From | David Mosberger <> | Date | Wed, 24 Mar 2004 11:18:04 -0800 | Subject | Re: Non-Exec stack patches |
| |
>>>>> On Wed, 24 Mar 2004 11:02:45 -0800, John Reiser <jreiser@BitWagon.com> said:
>> Only one mprotect() call is needed to make the entire stack >> executable.
John> mprotect() only works on the portion that is currently allocated. John> If the stack grows, then another call is needed.
No, mprotect() on the entire stack will mark the vm_area with the desired protection and VM_GROWSDOWN/VM_GROWSUP will expand automatically with the new protection. And if you want to expand the stack in user-level, e.g., by intercepting SIGSEGV, you'll either do an mmap() or mprotect() at any rate so there is zero extra cost there.
--david - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |