Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37844
b: refs/heads/master
c: 3db03b4
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and Linus Torvalds committed Oct 2, 2006
1 parent 17aff91 commit 2ec45b3
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 424 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6760856791c6e527da678021ee6a67896549d4da
refs/heads/master: 3db03b4afb3ecd66a0399b8ba57742ca953b0ecd
3 changes: 1 addition & 2 deletions trunk/arch/alpha/kernel/alpha_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <asm/cacheflush.h>
#include <asm/vga.h>

#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>

extern struct hwrpb_struct *hwrpb;
Expand Down Expand Up @@ -116,7 +115,7 @@ EXPORT_SYMBOL(sys_dup);
EXPORT_SYMBOL(sys_exit);
EXPORT_SYMBOL(sys_write);
EXPORT_SYMBOL(sys_lseek);
EXPORT_SYMBOL(execve);
EXPORT_SYMBOL(kernel_execve);
EXPORT_SYMBOL(sys_setsid);
EXPORT_SYMBOL(sys_wait4);

Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/alpha/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,12 @@ kernel_thread:
.end kernel_thread

/*
* execve(path, argv, envp)
* kernel_execve(path, argv, envp)
*/
.align 4
.globl execve
.ent execve
execve:
.globl kernel_execve
.ent kernel_execve
kernel_execve:
/* We can be called from a module. */
ldgp $gp, 0($27)
lda $sp, -(32+SIZEOF_PT_REGS+8)($sp)
Expand Down Expand Up @@ -704,7 +704,7 @@ execve:

1: lda $sp, 32+SIZEOF_PT_REGS+8($sp)
ret
.end execve
.end kernel_execve


/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/kernel/sys_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ asmlinkage int sys_execve(char __user *filenamei, char __user * __user *argv,
return error;
}

long execve(const char *filename, char **argv, char **envp)
int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
struct pt_regs regs;
int ret;
Expand Down Expand Up @@ -317,7 +317,7 @@ long execve(const char *filename, char **argv, char **envp)
out:
return ret;
}
EXPORT_SYMBOL(execve);
EXPORT_SYMBOL(kernel_execve);

/*
* Since loff_t is a 64 bit type we avoid a lot of ABI hastle
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm26/kernel/sys_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, struct pt_r
}

/* FIXME - see if this is correct for arm26 */
long execve(const char *filename, char **argv, char **envp)
int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
struct pt_regs regs;
int ret;
Expand Down Expand Up @@ -320,4 +320,4 @@ long execve(const char *filename, char **argv, char **envp)
return ret;
}

EXPORT_SYMBOL(execve);
EXPORT_SYMBOL(kernel_execve);
4 changes: 2 additions & 2 deletions trunk/arch/ia64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,11 @@ GLOBAL_ENTRY(prefetch_stack)
br.ret.sptk.many rp
END(prefetch_stack)

GLOBAL_ENTRY(execve)
GLOBAL_ENTRY(kernel_execve)
mov r15=__NR_execve // put syscall number in place
break __BREAK_SYSCALL
br.ret.sptk.many rp
END(execve)
END(kernel_execve)

GLOBAL_ENTRY(clone)
mov r15=__NR_clone // put syscall number in place
Expand Down
9 changes: 8 additions & 1 deletion trunk/arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,14 @@ asmlinkage int sys_execve(struct pt_regs *regs)
return error;
}

unsigned long
extern int __execve(const char *filename, char *const argv[],
char *const envp[], struct task_struct *task);
int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
return __execve(filename, argv, envp, current);
}

unsigned long
get_wchan(struct task_struct *p)
{
struct unwind_frame_info info;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/misc_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ _GLOBAL(kernel_thread)
addi r1,r1,16
blr

_GLOBAL(execve)
_GLOBAL(kernel_execve)
li r0,__NR_execve
sc
bnslr
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/misc_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ _GLOBAL(giveup_altivec)

#endif /* CONFIG_ALTIVEC */

_GLOBAL(execve)
_GLOBAL(kernel_execve)
li r0,__NR_execve
sc
bnslr
Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/um/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,16 @@ int next_syscall_index(int limit)
spin_unlock(&syscall_lock);
return(ret);
}

int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
mm_segment_t fs;
int ret;

fs = get_fs();
set_fs(KERNEL_DS);
ret = um_execve(filename, argv, envp);
set_fs(fs);

return ret;
}
4 changes: 2 additions & 2 deletions trunk/arch/x86_64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ ENDPROC(child_rip)
* do_sys_execve asm fallback arguments:
* rdi: name, rsi: argv, rdx: envp, fake frame on the stack
*/
ENTRY(execve)
ENTRY(kernel_execve)
CFI_STARTPROC
FAKE_STACK_FRAME $0
SAVE_ALL
Expand All @@ -1036,7 +1036,7 @@ ENTRY(execve)
UNFAKE_STACK_FRAME
ret
CFI_ENDPROC
ENDPROC(execve)
ENDPROC(kernel_execve)

KPROBE_ENTRY(page_fault)
errorentry do_page_fault
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/sbus/char/bbc_envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* Copyright (C) 2001 David S. Miller (davem@redhat.com)
*/

#define __KERNEL_SYSCALLS__
static int errno;

#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -200,7 +197,7 @@ static void do_envctrl_shutdown(struct bbc_cpu_temperature *tp)
printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n");

shutting_down = 1;
if (execve("/sbin/shutdown", argv, envp) < 0)
if (kernel_execve("/sbin/shutdown", argv, envp) < 0)
printk(KERN_CRIT "envctrl: shutdown execution failed\n");
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/sbus/char/envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
* Daniele Bellucci <bellucda@tiscali.it>
*/

#define __KERNEL_SYSCALLS__
static int errno;

#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kthread.h>
Expand Down Expand Up @@ -976,13 +973,15 @@ static void envctrl_do_shutdown(void)
"HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
char *argv[] = {
"/sbin/shutdown", "-h", "now", NULL };
int ret;

if (inprog != 0)
return;

inprog = 1;
printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n");
if (0 > execve("/sbin/shutdown", argv, envp)) {
ret = kernel_execve("/sbin/shutdown", argv, envp);
if (ret < 0) {
printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n");
inprog = 0; /* unlikely to succeed, but we could try again */
}
Expand Down
69 changes: 0 additions & 69 deletions trunk/include/asm-alpha/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,75 +580,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
#define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_SIGPENDING

#ifdef __KERNEL_SYSCALLS__

#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/signal.h>
#include <linux/syscalls.h>
#include <asm/ptrace.h>

static inline long open(const char * name, int mode, int flags)
{
return sys_open(name, mode, flags);
}

static inline long dup(int fd)
{
return sys_dup(fd);
}

static inline long close(int fd)
{
return sys_close(fd);
}

static inline off_t lseek(int fd, off_t off, int whence)
{
return sys_lseek(fd, off, whence);
}

static inline void _exit(int value)
{
sys_exit(value);
}

#define exit(x) _exit(x)

static inline long write(int fd, const char * buf, size_t nr)
{
return sys_write(fd, buf, nr);
}

static inline long read(int fd, char * buf, size_t nr)
{
return sys_read(fd, buf, nr);
}

extern int execve(char *, char **, char **);

static inline long setsid(void)
{
return sys_setsid();
}

static inline pid_t waitpid(int pid, int * wait_stat, int flags)
{
return sys_wait4(pid, wait_stat, flags, NULL);
}

asmlinkage int sys_execve(char *ufilename, char **argv, char **envp,
unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs);
asmlinkage long sys_rt_sigaction(int sig,
const struct sigaction __user *act,
struct sigaction __user *oact,
size_t sigsetsize,
void *restorer);

#endif /* __KERNEL_SYSCALLS__ */

/* "Conditional" syscalls. What we want is
__attribute__((weak,alias("sys_ni_syscall")))
Expand Down
24 changes: 0 additions & 24 deletions trunk/include/asm-arm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,30 +549,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
#define __ARCH_WANT_SYS_SOCKETCALL
#endif

#ifdef __KERNEL_SYSCALLS__

#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/syscalls.h>

extern long execve(const char *file, char **argv, char **envp);

struct pt_regs;
asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
struct pt_regs *regs);
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
struct pt_regs *regs);
asmlinkage int sys_fork(struct pt_regs *regs);
asmlinkage int sys_vfork(struct pt_regs *regs);
asmlinkage int sys_pipe(unsigned long *fildes);
struct sigaction;
asmlinkage long sys_rt_sigaction(int sig,
const struct sigaction __user *act,
struct sigaction __user *oact,
size_t sigsetsize);

#endif /* __KERNEL_SYSCALLS__ */

/*
* "Conditional" syscalls
*
Expand Down
24 changes: 0 additions & 24 deletions trunk/include/asm-arm26/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,30 +464,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION

#ifdef __KERNEL_SYSCALLS__

#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/syscalls.h>

extern long execve(const char *file, char **argv, char **envp);

struct pt_regs;
asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
struct pt_regs *regs);
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
struct pt_regs *regs);
asmlinkage int sys_fork(struct pt_regs *regs);
asmlinkage int sys_vfork(struct pt_regs *regs);
asmlinkage int sys_pipe(unsigned long *fildes);
struct sigaction;
asmlinkage long sys_rt_sigaction(int sig,
const struct sigaction __user *act,
struct sigaction __user *oact,
size_t sigsetsize);

#endif /* __KERNEL_SYSCALLS__ */

/*
* "Conditional" syscalls
*
Expand Down
Loading

0 comments on commit 2ec45b3

Please sign in to comment.