diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/elf.h | 8 | ||||
| -rw-r--r-- | include/asm-i386/page.h | 6 | ||||
| -rw-r--r-- | include/linux/personality.h | 7 |
3 files changed, 18 insertions, 3 deletions
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index cda7f174b694..57ecbcf525ac 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h @@ -117,7 +117,13 @@ typedef struct user_fxsr_struct elf_fpxregset_t; #define AT_SYSINFO_EHDR 33 #ifdef __KERNEL__ -#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) +#define SET_PERSONALITY(ex, ibcs2) do { } while (0) + +/* + * A legacy binary, when loaded by the ELF loader, will have the + * READ_IMPLIES_EXEC personality flag set automatically: + */ +#define LEGACY_BINARIES extern int dump_task_regs (struct task_struct *, elf_gregset_t *); extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index f544cc131b28..eb0e11f10683 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -140,8 +140,10 @@ static __inline__ int get_order(unsigned long size) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) +#define VM_DATA_DEFAULT_FLAGS \ + (VM_READ | VM_WRITE | \ + ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif /* __KERNEL__ */ diff --git a/include/linux/personality.h b/include/linux/personality.h index 14b91221d3e8..9b009b6754f6 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -30,6 +30,7 @@ extern int abi_fake_utsname; */ enum { MMAP_PAGE_ZERO = 0x0100000, + READ_IMPLIES_EXEC = 0x0400000, ADDR_LIMIT_32BIT = 0x0800000, SHORT_INODE = 0x1000000, WHOLE_SECONDS = 0x2000000, @@ -38,6 +39,12 @@ enum { }; /* + * Security-relevant compatibility flags that must be + * cleared upon setuid or setgid exec: + */ +#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC) + +/* * Personality types. * * These go in the low byte. Avoid using the top bit, it will |
