memory map glibc pmap PROT_NONE
02:18 PM) mdarade: cld u tell me use cases of PROT_NONE except buffer overflow?
(06:02:43 PM) mdarade: & what decides size of areas protected with PROT_NONE?
(06:03:05 PM) mdarade: I mean i see upto 64K area being marked as PROT_NONE
(06:06:02 PM) siddhesh: PROT_NONE is basically just no permissions
(06:06:06 PM) siddhesh: use it as you will
(06:06:29 PM) siddhesh: typically they’re used to mark guard pages to catch buffr overflows
(06:07:02 PM) siddhesh: but it’s generally a good idea to mark pages as PTOR_NONE if they’re not intended to be used
(06:07:11 PM) siddhesh: libc uses it for its arena allocations
(06:08:34 PM) mdarade: size of areas protected with PROT_NONE is fixed?
(06:08:56 PM) siddhesh: whatever size you want, rounded to page size of course
(06:09:09 PM) mdarade: what is use in having 64k area protected with it?
(06:09:24 PM) siddhesh: depends on where it is used
(06:09:27 PM) siddhesh: where is it used?
(06:10:05 PM) mdarade: i see 132k anon allocation
(06:10:09 PM) mdarade: now to guard it
(06:10:24 PM) mdarade: why prot_none area size have to be 64?
(06:10:48 PM) siddhesh: where? which code?
(06:10:50 PM) mdarade: 64400k?
(06:11:08 PM) mdarade: pmap of java
(06:11:24 PM) siddhesh: ok, is it multithreaded?
(06:11:43 PM) mdarade: yeap
(06:12:13 PM) siddhesh: then those must be arenas allocated by libc for each thread
(06:12:21 PM) siddhesh: arenas act as heaps for each thread
(06:12:26 PM) siddhesh: to reduce locking between them
(06:12:54 PM) siddhesh: a new arena is always allocated with PROT_NONE and then parts of it given access as and when needed
(06:13:03 PM) siddhesh: for malloc requests
(06:13:07 PM) mdarade: got it
thanks