From mboxrd@z Thu Jan 1 00:00:00 1970 From: kkonaka@mac.com Subject: stack -> PROT_EXEC/why? Date: Sun, 04 Aug 2002 21:22:33 -0400 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-c-programming@vger.kernel.org hi, casually looking at files like this: glibc-2.2.3/linuxthreads/manager.c | res_addr = mmap(map_addr, stacksize + guardsize, | PROT_READ | PROT_WRITE | PROT_EXEC, | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); it appears PROT_EXEC is also given to the per thread stack(?) pages -- why is it the case? that is - if we consider things like buffer overflow (security) problems, isn't it better not give PROT_EXEC unless abslutely necessary? [so -- maybe there *is* some absolute necessity I'm not aware of,... :(] (stepping back) is PROT_EXEC also given to ordinally stack segment of single threaded programs? was there any API to retrieve page protection bits given only arbitrary VM addresses? regards, kenji