Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

binfmt_flat: remove flat_reloc_valid

This helper is the same for all architectures, open code it in the only
caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

authored by

Christoph Hellwig and committed by
Greg Ungerer
9ee24b2a 4b972a01

+1 -8
-1
arch/arm/include/asm/flat.h
··· 10 10 11 11 #define flat_argvp_envp_on_stack() 1 12 12 #define flat_old_ram_flag(flags) (flags) 13 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 14 13 15 14 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 16 15 u32 *addr, u32 *persistent)
-1
arch/c6x/include/asm/flat.h
··· 6 6 7 7 #define flat_argvp_envp_on_stack() 0 8 8 #define flat_old_ram_flag(flags) (flags) 9 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10 9 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 11 10 u32 *addr, u32 *persistent) 12 11 {
-1
arch/h8300/include/asm/flat.h
··· 10 10 11 11 #define flat_argvp_envp_on_stack() 1 12 12 #define flat_old_ram_flag(flags) 1 13 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 14 13 #define flat_set_persistent(relval, p) 0 15 14 16 15 /*
-1
arch/m68k/include/asm/flat.h
··· 10 10 11 11 #define flat_argvp_envp_on_stack() 1 12 12 #define flat_old_ram_flag(flags) (flags) 13 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 14 13 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 15 14 u32 *addr, u32 *persistent) 16 15 {
-1
arch/microblaze/include/asm/flat.h
··· 15 15 16 16 #define flat_argvp_envp_on_stack() 0 17 17 #define flat_old_ram_flag(flags) (flags) 18 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 19 18 #define flat_set_persistent(relval, p) 0 20 19 21 20 /*
-1
arch/sh/include/asm/flat.h
··· 13 13 14 14 #define flat_argvp_envp_on_stack() 0 15 15 #define flat_old_ram_flag(flags) (flags) 16 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 17 16 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 18 17 u32 *addr, u32 *persistent) 19 18 {
-1
arch/xtensa/include/asm/flat.h
··· 6 6 7 7 #define flat_argvp_envp_on_stack() 0 8 8 #define flat_old_ram_flag(flags) (flags) 9 - #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10 9 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 11 10 u32 *addr, u32 *persistent) 12 11 {
+1 -1
fs/binfmt_flat.c
··· 345 345 start_code = p->lib_list[id].start_code; 346 346 text_len = p->lib_list[id].text_len; 347 347 348 - if (!flat_reloc_valid(r, start_brk - start_data + text_len)) { 348 + if (r > start_brk - start_data + text_len) { 349 349 pr_err("reloc outside program 0x%lx (0 - 0x%lx/0x%lx)", 350 350 r, start_brk-start_data+text_len, text_len); 351 351 goto failed;