Repository navigation
Commit fcaaade
selinux: generalize disabling of execmem for plt-in-heap archs
On Tue, 2010-04-27 at 11:47 -0700, David Miller wrote:
> From: "Tom \"spot\" Callaway" <tcallawa@redhat.com>
> Date: Tue, 27 Apr 2010 14:20:21 -0400
>
> > [root@apollo ~]$ cat /proc/2174/maps
> > 00010000-00014000 r-xp 00000000 fd:00 15466577
> > /sbin/mingetty
> > 00022000-00024000 rwxp 00002000 fd:00 15466577
> > /sbin/mingetty
> > 00024000-00046000 rwxp 00000000 00:00 0
> > [heap]
>
> SELINUX probably barfs on the executable heap, the PLT is in the HEAP
> just like powerpc32 and that's why VM_DATA_DEFAULT_FLAGS has to set
> both executable and writable.
>
> You also can't remove the CONFIG_PPC32 ifdefs in selinux, since
> because of the VM_DATA_DEFAULT_FLAGS setting used still in that arch,
> the heap will always have executable permission, just like sparc does.
> You have to support those binaries forever, whether you like it or not.
>
> Let's just replace the CONFIG_PPC32 ifdef in SELINUX with CONFIG_PPC32
> || CONFIG_SPARC as in Tom's original patch and let's be done with
> this.
>
> In fact I would go through all the arch/ header files and check the
> VM_DATA_DEFAULT_FLAGS settings and add the necessary new ifdefs to the
> SELINUX code so that other platforms don't have the pain of having to
> go through this process too.
To avoid maintaining per-arch ifdefs, it seems that we could just
directly use (VM_DATA_DEFAULT_FLAGS & VM_EXEC) as the basis for deciding
whether to enable or disable these checks. VM_DATA_DEFAULT_FLAGS isn't
constant on some architectures but instead depends on
current->personality, but we want this applied uniformly. So we'll just
use the initial task state to determine whether or not to enable these
checks.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: James Morris <jmorris@namei.org>1 parent cb84aa9 commit fcaaade
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2999 | 2999 | | |
3000 | 3000 | | |
3001 | 3001 | | |
| 3002 | + | |
| 3003 | + | |
3002 | 3004 | | |
3003 | 3005 | | |
3004 | 3006 | | |
3005 | 3007 | | |
3006 | 3008 | | |
3007 | | - | |
3008 | | - | |
| 3009 | + | |
| 3010 | + | |
3009 | 3011 | | |
3010 | 3012 | | |
3011 | 3013 | | |
| |||
3015 | 3017 | | |
3016 | 3018 | | |
3017 | 3019 | | |
3018 | | - | |
3019 | 3020 | | |
3020 | 3021 | | |
3021 | 3022 | | |
| |||
3076 | 3077 | | |
3077 | 3078 | | |
3078 | 3079 | | |
3079 | | - | |
3080 | | - | |
| 3080 | + | |
| 3081 | + | |
3081 | 3082 | | |
3082 | 3083 | | |
3083 | 3084 | | |
| |||
3099 | 3100 | | |
3100 | 3101 | | |
3101 | 3102 | | |
3102 | | - | |
3103 | 3103 | | |
3104 | 3104 | | |
3105 | 3105 | | |
| |||
5662 | 5662 | | |
5663 | 5663 | | |
5664 | 5664 | | |
| 5665 | + | |
| 5666 | + | |
5665 | 5667 | | |
5666 | 5668 | | |
5667 | 5669 | | |
| |||
0 commit comments