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