Skip to content

Commit 8b0582f

Browse files
committed
Merge tag 'execve-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull execve fix from Kees Cook: "This is an alpha-specific fix, but since it touched ELF I was asked to carry it. - alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support (Eric W. Biederman)" * tag 'execve-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support
2 parents 493f3f3 + b029628 commit 8b0582f

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

arch/alpha/include/asm/elf.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
7474
/*
7575
* This is used to ensure we don't load something for the wrong architecture.
7676
*/
77-
#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
77+
#define elf_check_arch(x) (((x)->e_machine == EM_ALPHA) && !((x)->e_flags & EF_ALPHA_32BIT))
7878

7979
/*
8080
* These are used to set parameters in the core dumps.
@@ -137,10 +137,6 @@ extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);
137137
: amask (AMASK_CIX) ? "ev6" : "ev67"); \
138138
})
139139

140-
#define SET_PERSONALITY(EX) \
141-
set_personality(((EX).e_flags & EF_ALPHA_32BIT) \
142-
? PER_LINUX_32BIT : PER_LINUX)
143-
144140
extern int alpha_l1i_cacheshape;
145141
extern int alpha_l1d_cacheshape;
146142
extern int alpha_l2_cacheshape;

arch/alpha/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
360360

361361
extern void paging_init(void);
362362

363-
/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT. */
363+
/* We have our own get_unmapped_area */
364364
#define HAVE_ARCH_UNMAPPED_AREA
365365

366366
#endif /* _ALPHA_PGTABLE_H */

arch/alpha/include/asm/processor.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,19 @@
88
#ifndef __ASM_ALPHA_PROCESSOR_H
99
#define __ASM_ALPHA_PROCESSOR_H
1010

11-
#include <linux/personality.h> /* for ADDR_LIMIT_32BIT */
12-
1311
/*
1412
* We have a 42-bit user address space: 4TB user VM...
1513
*/
1614
#define TASK_SIZE (0x40000000000UL)
1715

18-
#define STACK_TOP \
19-
(current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
16+
#define STACK_TOP (0x00120000000UL)
2017

2118
#define STACK_TOP_MAX 0x00120000000UL
2219

2320
/* This decides where the kernel will search for a free chunk of vm
2421
* space during mmap's.
2522
*/
26-
#define TASK_UNMAPPED_BASE \
27-
((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
23+
#define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
2824

2925
/* This is dead. Everything has been moved to thread_info. */
3026
struct thread_struct { };

arch/alpha/kernel/osf_sys.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,7 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
12101210
return ret;
12111211
}
12121212

1213-
/* Get an address range which is currently unmapped. Similar to the
1214-
generic version except that we know how to honor ADDR_LIMIT_32BIT. */
1213+
/* Get an address range which is currently unmapped. */
12151214

12161215
static unsigned long
12171216
arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
@@ -1230,13 +1229,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
12301229
unsigned long len, unsigned long pgoff,
12311230
unsigned long flags, vm_flags_t vm_flags)
12321231
{
1233-
unsigned long limit;
1234-
1235-
/* "32 bit" actually means 31 bit, since pointers sign extend. */
1236-
if (current->personality & ADDR_LIMIT_32BIT)
1237-
limit = 0x80000000;
1238-
else
1239-
limit = TASK_SIZE;
1232+
unsigned long limit = TASK_SIZE;
12401233

12411234
if (len > limit)
12421235
return -ENOMEM;

0 commit comments

Comments
 (0)