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

[CVE-2009-0029] Remove __attribute__((weak)) from sys_pipe/sys_pipe2

Remove __attribute__((weak)) from common code sys_pipe implemantation.
IA64, ALPHA, SUPERH (32bit) and SPARC (32bit) have own implemantations
with the same name. Just rename them.
For sys_pipe2 there is no architecture specific implementation.

Cc: Richard Henderson <rth@twiddle.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

+22 -23
+4 -4
arch/alpha/kernel/entry.S
··· 896 896 .end sys_getxpid 897 897 898 898 .align 4 899 - .globl sys_pipe 900 - .ent sys_pipe 901 - sys_pipe: 899 + .globl sys_alpha_pipe 900 + .ent sys_alpha_pipe 901 + sys_alpha_pipe: 902 902 lda $sp, -16($sp) 903 903 stq $26, 0($sp) 904 904 .prologue 0 ··· 916 916 stq $1, 80+16($sp) 917 917 1: lda $sp, 16($sp) 918 918 ret 919 - .end sys_pipe 919 + .end sys_alpha_pipe 920 920 921 921 .align 4 922 922 .globl sys_execve
+1 -1
arch/alpha/kernel/systbls.S
··· 52 52 .quad sys_setpgid 53 53 .quad alpha_ni_syscall /* 40 */ 54 54 .quad sys_dup 55 - .quad sys_pipe 55 + .quad sys_alpha_pipe 56 56 .quad osf_set_program_attributes 57 57 .quad alpha_ni_syscall 58 58 .quad sys_open /* 45 */
+1 -1
arch/ia64/ia32/ia32_entry.S
··· 220 220 data8 sys_mkdir 221 221 data8 sys_rmdir /* 40 */ 222 222 data8 sys_dup 223 - data8 sys_pipe 223 + data8 sys_ia64_pipe 224 224 data8 compat_sys_times 225 225 data8 sys_ni_syscall /* old prof syscall holder */ 226 226 data8 sys32_brk /* 45 */
+1 -1
arch/ia64/include/asm/unistd.h
··· 364 364 struct sigaction; 365 365 long sys_execve(char __user *filename, char __user * __user *argv, 366 366 char __user * __user *envp, struct pt_regs *regs); 367 - asmlinkage long sys_pipe(void); 367 + asmlinkage long sys_ia64_pipe(void); 368 368 asmlinkage long sys_rt_sigaction(int sig, 369 369 const struct sigaction __user *act, 370 370 struct sigaction __user *oact,
+1 -1
arch/ia64/kernel/entry.S
··· 1442 1442 data8 sys_mkdir // 1055 1443 1443 data8 sys_rmdir 1444 1444 data8 sys_dup 1445 - data8 sys_pipe 1445 + data8 sys_ia64_pipe 1446 1446 data8 sys_times 1447 1447 data8 ia64_brk // 1060 1448 1448 data8 sys_setgid
+1 -1
arch/ia64/kernel/sys_ia64.c
··· 154 154 * and r9) as this is faster than doing a copy_to_user(). 155 155 */ 156 156 asmlinkage long 157 - sys_pipe (void) 157 + sys_ia64_pipe (void) 158 158 { 159 159 struct pt_regs *regs = task_pt_regs(current); 160 160 int fd[2];
-1
arch/s390/kernel/entry.h
··· 30 30 struct old_sigaction; 31 31 struct sel_arg_struct; 32 32 33 - long sys_pipe(unsigned long __user *fildes); 34 33 long sys_mmap2(struct mmap_arg_struct __user *arg); 35 34 long old_mmap(struct mmap_arg_struct __user *arg); 36 35 long sys_ipc(uint call, int first, unsigned long second,
+3 -3
arch/sh/include/asm/syscalls_32.h
··· 36 36 asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, 37 37 unsigned long r6, unsigned long r7, 38 38 struct pt_regs __regs); 39 - asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 40 - unsigned long r6, unsigned long r7, 41 - struct pt_regs __regs); 39 + asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, 40 + unsigned long r6, unsigned long r7, 41 + struct pt_regs __regs); 42 42 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 43 43 size_t count, long dummy, loff_t pos); 44 44 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
+1 -1
arch/sh/kernel/sys_sh32.c
··· 22 22 * sys_pipe() is the normal C calling standard for creating 23 23 * a pipe. It's not the way Unix traditionally does this, though. 24 24 */ 25 - asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 25 + asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, 26 26 unsigned long r6, unsigned long r7, 27 27 struct pt_regs __regs) 28 28 {
+1 -1
arch/sh/kernel/syscalls_32.S
··· 58 58 .long sys_mkdir 59 59 .long sys_rmdir /* 40 */ 60 60 .long sys_dup 61 - .long sys_pipe 61 + .long sys_sh_pipe 62 62 .long sys_times 63 63 .long sys_ni_syscall /* old prof syscall holder */ 64 64 .long sys_brk /* 45 */
+2 -2
arch/sparc/kernel/entry.S
··· 1088 1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0 1089 1089 1090 1090 .align 4 1091 - .globl sys_pipe 1092 - sys_pipe: 1091 + .globl sys_sparc_pipe 1092 + sys_sparc_pipe: 1093 1093 mov %o7, %l5 1094 1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg 1095 1095 call sparc_pipe
+1 -1
arch/sparc/kernel/syscalls.S
··· 20 20 add %sp, PTREGS_OFF, %o0 21 21 22 22 .align 32 23 - sys_pipe: 23 + sys_sparc_pipe: 24 24 ba,pt %xcc, sparc_pipe 25 25 add %sp, PTREGS_OFF, %o0 26 26 sys_nis_syscall:
+1 -1
arch/sparc/kernel/systbls_32.S
··· 24 24 /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause 25 25 /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice 26 26 /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile 27 - /*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid 27 + /*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid 28 28 /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 29 29 /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl 30 30 /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve
+2 -2
arch/sparc/kernel/systbls_64.S
··· 26 26 /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause 27 27 /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice 28 28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile 29 - /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid 29 + /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid 30 30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 31 31 /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl 32 32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve ··· 100 100 /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall 101 101 /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice 102 102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 103 - /*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall 103 + /*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall 104 104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid 105 105 /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl 106 106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
+2 -2
fs/pipe.c
··· 1043 1043 * sys_pipe() is the normal C calling standard for creating 1044 1044 * a pipe. It's not the way Unix traditionally does this, though. 1045 1045 */ 1046 - asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) 1046 + asmlinkage long sys_pipe2(int __user *fildes, int flags) 1047 1047 { 1048 1048 int fd[2]; 1049 1049 int error; ··· 1059 1059 return error; 1060 1060 } 1061 1061 1062 - asmlinkage long __weak sys_pipe(int __user *fildes) 1062 + asmlinkage long sys_pipe(int __user *fildes) 1063 1063 { 1064 1064 return sys_pipe2(fildes, 0); 1065 1065 }