What role do user_cs_limit/user_cs_base in the mm_context_t?

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

What role do user_cs_limit/user_cs_base in the mm_context_t?

Postby lynliuyan » Tue Jun 02, 2015 11:33 pm

typedef struct {
......
#ifdef CONFIG_X86_32
#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
unsigned long user_cs_base;
unsigned long user_cs_limit;

#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_SMP)
cpumask_t cpu_user_cs_mask;
#endif

} mm_context_t;

user_cs_base/user_cs_limit is to limit memory usage for segmexec,but i do not understand the effection in pageexec?
lynliuyan
 
Posts: 18
Joined: Wed Mar 04, 2015 11:47 pm

Re: What role do user_cs_limit/user_cs_base in the mm_contex

Postby PaX Team » Wed Jun 03, 2015 5:37 am

lynliuyan wrote:user_cs_base/user_cs_limit is to limit memory usage for segmexec,but i do not understand the effection in pageexec?
it's used as a performance optimization for the old (TLB hacking) based PAGEEXEC method. the idea is that non-executable pages above the current CS limit can be mapped with user mode (vs. supervisor mode that would normally be required) thus eliminating the performance impact due to data accesses to non-executable pages and the subsequent page faults/DTLB reloads.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm


Return to grsecurity support