1 |
No, I am not toggling mprotect. I am sorry if I was not clear with my |
2 |
questions. It is always off in the examples I am referring to. I probably |
3 |
should've never brought mprotect up because it does not pertain to this |
4 |
discussion. I have been using similar patches to the kernel since the 2.0.x |
5 |
series, and many servers I've built and admin are full on hardened setups |
6 |
(but no X and no Quake3 allowed). Now I am tackling attempting full |
7 |
hardened, rather than partial, on the desktop/workstation. |
8 |
|
9 |
mprotect->off, SEGMEXEC->on and/or PAGEEXEC->on = crash |
10 |
mprotect->off, SEGMEXEC->off and PAGEEXEC->off = ok |
11 |
|
12 |
The issue is PaX SEGMEXEC/PAGEEXEC is duplicated by the SSP/ProPolice patches |
13 |
to GCC. PaX SEGMEXEC/PAGEEXEC can be easily disabled. SSP/ProPolice cannot |
14 |
be easily disabled that I am aware of. My question is, if you have a program |
15 |
that breaks with PaX's SEGMEXEC/PAGEEXEC, then it should break, too, under |
16 |
SSP/ProPolice, correct? So if I have a program that breaks with |
17 |
SEGMEXEC/PAGEEXEC and I'm using a full-on hardened setup with SSP/ProPolice, |
18 |
I could disable PaX's SEGMEXEC/PAGEEXEC for that program, but it would still |
19 |
break because then SSP/ProPolice would catch and kill it, correct? |
20 |
|
21 |
Thank you for your help. |
22 |
|
23 |
On Saturday, January 27, 2007 20:32, John Schember wrote: |
24 |
> Your getting two different things confused here. Mprotect restrictions |
25 |
> via PAX and SSP enabled in the tool chain preform different functions |
26 |
> and do not interfere with one another. Nor do they prevent the other |
27 |
> from working correctly. |
28 |
> |
29 |
> http://pax.grsecurity.net/docs/mprotect.txt |
30 |
> "The goal of MPROTECT is to help prevent the introduction of new |
31 |
> executable code into the task's address space." |
32 |
> |
33 |
> http://www.trl.ibm.com/projects/security/ssp/ |
34 |
> "The protection is realized by buffer overflow detection and the |
35 |
> variable reordering feature to avoid the corruption of pointers." |
36 |
> |
37 |
> Basically PAX's mprotect restrictions disallow creating executable |
38 |
> anonymous mappings, creating executable/writable mappings, making |
39 |
> executable/read-only mappings writable, and making non-executable |
40 |
> mappings executable. |
41 |
> |
42 |
> SSP introduced variable reordering and placing pointers before buffers |
43 |
> to prevent corruption of memory via a stack smashing attack. SSP's |
44 |
> changes should not effect the overall functioning of an application |
45 |
> unless it does something strange like use a stack smashing attack on |
46 |
> itself. |
47 |
> |
48 |
> Using SSP will not prevent you from utilizing paxctl to exempt specific |
49 |
> executables from mprotect restrictions. |
50 |
> |
51 |
> John Schember |
52 |
> |
53 |
> |
54 |
> On Sat, 2007-01-27 at 19:40 -0800, gentoo-hardened-ml-01@××××××.org |
55 |
> |
56 |
> wrote: |
57 |
> > If I paxctl -PS the ioquake3 binary it crashes on startup with the error: |
58 |
> > |
59 |
> > PAX: execution attempt in: /dev/zero |
60 |
> > |
61 |
> > logged to the syslog. If I paxctl -ps ioquake3 it runs fine. Of course |
62 |
> > mprotect is disabled in both cases. Quake3 is really only an example |
63 |
> > though. I guess my larger question is: |
64 |
> > |
65 |
> > If I use the SSP-enabled toolchain, I'll loose my ability to toggle this |
66 |
> > protection off and on at will right? Am I correct that the only work |
67 |
> > arounds in this case would involve some kind of recompiling with |
68 |
> > per-package flags, etc.? |
69 |
> > |
70 |
> > Thank you for your help. |
71 |
> > |
72 |
> > On Saturday, January 27, 2007 18:59, John Schember wrote: |
73 |
> > > SSP is stack smashing protection. Unless an application your using for |
74 |
> > > some strange reason likes to over run the stack and execute code just |
75 |
> > > like a buffer overrun attack you won't have a problem. As far as Quake3 |
76 |
> > > goes you won't have a problem with the hardened tool chain. |
77 |
> > > |
78 |
> > > John Schember |
79 |
> > > |
80 |
> > > |
81 |
> > > On Sat, 2007-01-27 at 18:20 -0800, gentoo-hardened-ml-01@××××××.org |
82 |
> > > |
83 |
> > > wrote: |
84 |
> > > > I've had a "partially-hardened" workstation for awhile now. I use |
85 |
> > > > hardened-sources and enable many of the PaX/grsecurity options |
86 |
> > > > including stack smashing protection. This works great as I can |
87 |
> > > > disable SEGMEXEC, PAGEEXEC and mprotect for Quake3 (ioquake3) and get |
88 |
> > > > it to run. My question is if I take my workstation to a full |
89 |
> > > > hardened system with SSP+PIE toolchain, etc. will I still be able to |
90 |
> > > > run Quake3 and other programs like it? If I went to a full Hardened |
91 |
> > > > Gentoo system, even if I disabled PaX's SEGMEXEC, PAGEXEC and |
92 |
> > > > mprotect, which is sufficient to run Quake3 now, the toolchains' own |
93 |
> > > > SSP would then kick in and stop me, right? |
94 |
> > > > |
95 |
> > > > I'm normally a test and do-it-myself kind of person, but I really |
96 |
> > > > don't want to have to recompile the system to find out and then |
97 |
> > > > recompile again if gcc's SSP/ProPolice does stop me. |
98 |
> > > > |
99 |
> > > > Side note: I masked gcc-4* and >=glibc-2.4 when they were stabled in |
100 |
> > > > x86. I still run gcc-3.4.6-r2 and glibc-2.3.6-r5 so switching to the |
101 |
> > > > hardened profile will not present any of those types of problems for |
102 |
> > > > me. |
103 |
> > > > |
104 |
> > > > Thank you for your help. |
105 |
-- |
106 |
gentoo-hardened@g.o mailing list |