Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6ed4b2d7
Commit
6ed4b2d7
authored
Feb 15, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://ptrace.bkbits.net/for-linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
b9327242
d946b9ee
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
62 additions
and
47 deletions
+62
-47
arch/alpha/kernel/asm-offsets.c
arch/alpha/kernel/asm-offsets.c
+1
-0
arch/i386/kernel/process.c
arch/i386/kernel/process.c
+1
-0
arch/i386/kernel/traps.c
arch/i386/kernel/traps.c
+1
-0
arch/i386/kernel/vm86.c
arch/i386/kernel/vm86.c
+1
-0
arch/i386/math-emu/fpu_entry.c
arch/i386/math-emu/fpu_entry.c
+1
-0
arch/m68k/kernel/traps.c
arch/m68k/kernel/traps.c
+1
-0
arch/m68knommu/kernel/asm-offsets.c
arch/m68knommu/kernel/asm-offsets.c
+1
-0
arch/m68knommu/kernel/traps.c
arch/m68knommu/kernel/traps.c
+1
-0
arch/mips/kernel/irixsig.c
arch/mips/kernel/irixsig.c
+1
-0
arch/mips/kernel/sysmips.c
arch/mips/kernel/sysmips.c
+1
-0
arch/parisc/hpux/fs.c
arch/parisc/hpux/fs.c
+1
-0
arch/parisc/kernel/sys_parisc32.c
arch/parisc/kernel/sys_parisc32.c
+1
-0
arch/ppc64/kernel/process.c
arch/ppc64/kernel/process.c
+1
-0
arch/ppc64/kernel/sys_ppc32.c
arch/ppc64/kernel/sys_ppc32.c
+1
-0
arch/s390x/kernel/linux32.c
arch/s390x/kernel/linux32.c
+1
-0
arch/sh/kernel/process.c
arch/sh/kernel/process.c
+1
-0
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+1
-0
arch/um/kernel/exec_kern.c
arch/um/kernel/exec_kern.c
+1
-0
arch/um/kernel/signal_kern.c
arch/um/kernel/signal_kern.c
+1
-0
arch/um/kernel/skas/process_kern.c
arch/um/kernel/skas/process_kern.c
+1
-0
arch/um/kernel/tt/process_kern.c
arch/um/kernel/tt/process_kern.c
+1
-0
arch/um/kernel/tt/syscall_kern.c
arch/um/kernel/tt/syscall_kern.c
+1
-0
arch/v850/kernel/asm-consts.c
arch/v850/kernel/asm-consts.c
+1
-0
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/ia32/sys_ia32.c
+1
-0
fs/binfmt_aout.c
fs/binfmt_aout.c
+1
-0
fs/proc/base.c
fs/proc/base.c
+1
-0
include/linux/ptrace.h
include/linux/ptrace.h
+26
-5
include/linux/sched.h
include/linux/sched.h
+0
-15
kernel/exit.c
kernel/exit.c
+5
-5
kernel/ptrace.c
kernel/ptrace.c
+3
-22
kernel/signal.c
kernel/signal.c
+1
-0
security/capability.c
security/capability.c
+1
-0
No files found.
arch/alpha/kernel/asm-offsets.c
View file @
6ed4b2d7
...
...
@@ -7,6 +7,7 @@
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <asm/io.h>
#define DEFINE(sym, val) \
...
...
arch/i386/kernel/process.c
View file @
6ed4b2d7
...
...
@@ -36,6 +36,7 @@
#include <linux/mc146818rtc.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/ptrace.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
...
...
arch/i386/kernel/traps.c
View file @
6ed4b2d7
...
...
@@ -24,6 +24,7 @@
#include <linux/interrupt.h>
#include <linux/highmem.h>
#include <linux/kallsyms.h>
#include <linux/ptrace.h>
#ifdef CONFIG_EISA
#include <linux/ioport.h>
...
...
arch/i386/kernel/vm86.c
View file @
6ed4b2d7
...
...
@@ -40,6 +40,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/highmem.h>
#include <linux/ptrace.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
...
...
arch/i386/math-emu/fpu_entry.c
View file @
6ed4b2d7
...
...
@@ -25,6 +25,7 @@
+---------------------------------------------------------------------------*/
#include <linux/signal.h>
#include <linux/ptrace.h>
#include <asm/uaccess.h>
#include <asm/desc.h>
...
...
arch/m68k/kernel/traps.c
View file @
6ed4b2d7
...
...
@@ -29,6 +29,7 @@
#include <linux/string.h>
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/ptrace.h>
#include <asm/setup.h>
#include <asm/fpu.h>
...
...
arch/m68knommu/kernel/asm-offsets.c
View file @
6ed4b2d7
...
...
@@ -11,6 +11,7 @@
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/ptrace.h>
#include <asm/bootinfo.h>
#include <asm/irq.h>
#include <asm/hardirq.h>
...
...
arch/m68knommu/kernel/traps.c
View file @
6ed4b2d7
...
...
@@ -27,6 +27,7 @@
#include <linux/string.h>
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/ptrace.h>
#include <asm/setup.h>
#include <asm/fpu.h>
...
...
arch/mips/kernel/irixsig.c
View file @
6ed4b2d7
...
...
@@ -12,6 +12,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/time.h>
#include <linux/ptrace.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>
...
...
arch/mips/kernel/sysmips.c
View file @
6ed4b2d7
...
...
@@ -16,6 +16,7 @@
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/utsname.h>
#include <linux/ptrace.h>
#include <asm/cachectl.h>
#include <asm/pgalloc.h>
...
...
arch/parisc/hpux/fs.c
View file @
6ed4b2d7
...
...
@@ -9,6 +9,7 @@
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>
#include <linux/ptrace.h>
#include <asm/errno.h>
#include <asm/uaccess.h>
...
...
arch/parisc/kernel/sys_parisc32.c
View file @
6ed4b2d7
...
...
@@ -53,6 +53,7 @@
#include <linux/binfmts.h>
#include <linux/namei.h>
#include <linux/vfs.h>
#include <linux/ptrace.h>
#include <asm/types.h>
#include <asm/uaccess.h>
...
...
arch/ppc64/kernel/process.c
View file @
6ed4b2d7
...
...
@@ -31,6 +31,7 @@
#include <linux/init.h>
#include <linux/init_task.h>
#include <linux/prctl.h>
#include <linux/ptrace.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
...
...
arch/ppc64/kernel/sys_ppc32.c
View file @
6ed4b2d7
...
...
@@ -58,6 +58,7 @@
#include <linux/dnotify.h>
#include <linux/security.h>
#include <linux/compat.h>
#include <linux/ptrace.h>
#include <asm/types.h>
#include <asm/ipc.h>
...
...
arch/s390x/kernel/linux32.c
View file @
6ed4b2d7
...
...
@@ -58,6 +58,7 @@
#include <linux/binfmts.h>
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/ptrace.h>
#include <asm/types.h>
#include <asm/ipc.h>
...
...
arch/sh/kernel/process.c
View file @
6ed4b2d7
...
...
@@ -15,6 +15,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/a.out.h>
#include <linux/ptrace.h>
#include <asm/io.h>
#include <asm/uaccess.h>
...
...
arch/sparc64/kernel/sys_sparc32.c
View file @
6ed4b2d7
...
...
@@ -54,6 +54,7 @@
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/ptrace.h>
#include <asm/types.h>
#include <asm/ipc.h>
...
...
arch/um/kernel/exec_kern.c
View file @
6ed4b2d7
...
...
@@ -5,6 +5,7 @@
#include "linux/slab.h"
#include "linux/smp_lock.h"
#include "linux/ptrace.h"
#include "asm/ptrace.h"
#include "asm/pgtable.h"
#include "asm/tlbflush.h"
...
...
arch/um/kernel/signal_kern.c
View file @
6ed4b2d7
...
...
@@ -14,6 +14,7 @@
#include "linux/slab.h"
#include "linux/tty.h"
#include "linux/binfmts.h"
#include "linux/ptrace.h"
#include "asm/signal.h"
#include "asm/uaccess.h"
#include "asm/unistd.h"
...
...
arch/um/kernel/skas/process_kern.c
View file @
6ed4b2d7
...
...
@@ -5,6 +5,7 @@
#include "linux/sched.h"
#include "linux/slab.h"
#include "linux/ptrace.h"
#include "kern_util.h"
#include "time_user.h"
#include "signal_user.h"
...
...
arch/um/kernel/tt/process_kern.c
View file @
6ed4b2d7
...
...
@@ -7,6 +7,7 @@
#include "linux/signal.h"
#include "linux/kernel.h"
#include "linux/interrupt.h"
#include "linux/ptrace.h"
#include "asm/system.h"
#include "asm/pgalloc.h"
#include "asm/ptrace.h"
...
...
arch/um/kernel/tt/syscall_kern.c
View file @
6ed4b2d7
...
...
@@ -6,6 +6,7 @@
#include "linux/types.h"
#include "linux/utime.h"
#include "linux/sys.h"
#include "linux/ptrace.h"
#include "asm/unistd.h"
#include "asm/ptrace.h"
#include "asm/uaccess.h"
...
...
arch/v850/kernel/asm-consts.c
View file @
6ed4b2d7
...
...
@@ -11,6 +11,7 @@
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/ptrace.h>
#include <asm/irq.h>
#include <asm/hardirq.h>
#include <asm/errno.h>
...
...
arch/x86_64/ia32/sys_ia32.c
View file @
6ed4b2d7
...
...
@@ -59,6 +59,7 @@
#include <linux/aio_abi.h>
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/ptrace.h>
#include <asm/mman.h>
#include <asm/types.h>
#include <asm/uaccess.h>
...
...
fs/binfmt_aout.c
View file @
6ed4b2d7
...
...
@@ -24,6 +24,7 @@
#include <linux/binfmts.h>
#include <linux/personality.h>
#include <linux/init.h>
#include <linux/ptrace.h>
#include <asm/system.h>
#include <asm/uaccess.h>
...
...
fs/proc/base.c
View file @
6ed4b2d7
...
...
@@ -31,6 +31,7 @@
#include <linux/kallsyms.h>
#include <linux/mount.h>
#include <linux/security.h>
#include <linux/ptrace.h>
/*
* For hysterical raisins we keep the same inumbers as in the old procfs.
...
...
include/linux/ptrace.h
View file @
6ed4b2d7
...
...
@@ -3,8 +3,6 @@
/* ptrace.h */
/* structs and defines to help the user use the ptrace system call. */
#include <linux/compiler.h>
/* has the defines to get at the registers. */
#define PTRACE_TRACEME 0
...
...
@@ -38,6 +36,8 @@
#define PTRACE_O_TRACEVFORKDONE 0x00000020
#define PTRACE_O_TRACEEXIT 0x00000040
#define PTRACE_O_MASK 0x0000007f
/* Wait extended result codes for the above trace options. */
#define PTRACE_EVENT_FORK 1
#define PTRACE_EVENT_VFORK 2
...
...
@@ -47,7 +47,27 @@
#define PTRACE_EVENT_EXIT 6
#include <asm/ptrace.h>
#include <linux/sched.h>
#ifdef __KERNEL__
/*
* Ptrace flags
*/
#define PT_PTRACED 0x00000001
#define PT_DTRACE 0x00000002
/* delayed trace (used on m68k, i386) */
#define PT_TRACESYSGOOD 0x00000004
#define PT_PTRACE_CAP 0x00000008
/* ptracer can follow suid-exec */
#define PT_TRACE_FORK 0x00000010
#define PT_TRACE_VFORK 0x00000020
#define PT_TRACE_CLONE 0x00000040
#define PT_TRACE_EXEC 0x00000080
#define PT_TRACE_VFORK_DONE 0x00000100
#define PT_TRACE_EXIT 0x00000200
#define PT_TRACE_MASK 0x000003f4
#include <linux/compiler.h>
/* For unlikely. */
#include <linux/sched.h>
/* For struct task_struct. */
extern
int
ptrace_readdata
(
struct
task_struct
*
tsk
,
unsigned
long
src
,
char
*
dst
,
int
len
);
extern
int
ptrace_writedata
(
struct
task_struct
*
tsk
,
char
*
src
,
unsigned
long
dst
,
int
len
);
...
...
@@ -58,11 +78,11 @@ extern int ptrace_check_attach(struct task_struct *task, int kill);
extern
int
ptrace_request
(
struct
task_struct
*
child
,
long
request
,
long
addr
,
long
data
);
extern
void
ptrace_notify
(
int
exit_code
);
extern
void
__ptrace_link
(
struct
task_struct
*
child
,
struct
task_struct
*
new_parent
);
struct
task_struct
*
new_parent
);
extern
void
__ptrace_unlink
(
struct
task_struct
*
child
);
static
inline
void
ptrace_link
(
struct
task_struct
*
child
,
struct
task_struct
*
new_parent
)
struct
task_struct
*
new_parent
)
{
if
(
unlikely
(
child
->
ptrace
))
__ptrace_link
(
child
,
new_parent
);
...
...
@@ -72,5 +92,6 @@ static inline void ptrace_unlink(struct task_struct *child)
if
(
unlikely
(
child
->
ptrace
))
__ptrace_unlink
(
child
);
}
#endif
#endif
include/linux/sched.h
View file @
6ed4b2d7
...
...
@@ -446,21 +446,6 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_FSTRANS 0x00020000
/* inside a filesystem transaction */
#define PF_KSWAPD 0x00040000
/* I am kswapd */
/*
* Ptrace flags
*/
#define PT_PTRACED 0x00000001
#define PT_DTRACE 0x00000002
/* delayed trace (used on m68k, i386) */
#define PT_TRACESYSGOOD 0x00000004
#define PT_PTRACE_CAP 0x00000008
/* ptracer can follow suid-exec */
#define PT_TRACE_FORK 0x00000010
#define PT_TRACE_VFORK 0x00000020
#define PT_TRACE_CLONE 0x00000040
#define PT_TRACE_EXEC 0x00000080
#define PT_TRACE_VFORK_DONE 0x00000100
#define PT_TRACE_EXIT 0x00000200
#if CONFIG_SMP
extern
void
set_cpus_allowed
(
task_t
*
p
,
unsigned
long
new_mask
);
#else
...
...
kernel/exit.c
View file @
6ed4b2d7
...
...
@@ -694,10 +694,8 @@ static void exit_notify(struct task_struct *tsk)
* only has special meaning to our real parent.
*/
if
(
tsk
->
exit_signal
!=
-
1
)
{
if
(
tsk
->
parent
==
tsk
->
real_parent
)
do_notify_parent
(
tsk
,
tsk
->
exit_signal
);
else
do_notify_parent
(
tsk
,
SIGCHLD
);
int
signal
=
tsk
->
parent
==
tsk
->
real_parent
?
tsk
->
exit_signal
:
SIGCHLD
;
do_notify_parent
(
tsk
,
signal
);
}
tsk
->
state
=
TASK_ZOMBIE
;
...
...
@@ -731,8 +729,10 @@ NORET_TYPE void do_exit(long code)
profile_exit_task
(
tsk
);
if
(
unlikely
(
current
->
ptrace
&
PT_TRACE_EXIT
))
if
(
unlikely
(
current
->
ptrace
&
PT_TRACE_EXIT
))
{
current
->
ptrace_message
=
code
;
ptrace_notify
((
PTRACE_EVENT_EXIT
<<
8
)
|
SIGTRAP
);
}
acct_process
(
code
);
__exit_mm
(
tsk
);
...
...
kernel/ptrace.c
View file @
6ed4b2d7
...
...
@@ -252,49 +252,30 @@ int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int
static
int
ptrace_setoptions
(
struct
task_struct
*
child
,
long
data
)
{
child
->
ptrace
&=
~
PT_TRACE_MASK
;
if
(
data
&
PTRACE_O_TRACESYSGOOD
)
child
->
ptrace
|=
PT_TRACESYSGOOD
;
else
child
->
ptrace
&=
~
PT_TRACESYSGOOD
;
if
(
data
&
PTRACE_O_TRACEFORK
)
child
->
ptrace
|=
PT_TRACE_FORK
;
else
child
->
ptrace
&=
~
PT_TRACE_FORK
;
if
(
data
&
PTRACE_O_TRACEVFORK
)
child
->
ptrace
|=
PT_TRACE_VFORK
;
else
child
->
ptrace
&=
~
PT_TRACE_VFORK
;
if
(
data
&
PTRACE_O_TRACECLONE
)
child
->
ptrace
|=
PT_TRACE_CLONE
;
else
child
->
ptrace
&=
~
PT_TRACE_CLONE
;
if
(
data
&
PTRACE_O_TRACEEXEC
)
child
->
ptrace
|=
PT_TRACE_EXEC
;
else
child
->
ptrace
&=
~
PT_TRACE_EXEC
;
if
(
data
&
PTRACE_O_TRACEVFORKDONE
)
child
->
ptrace
|=
PT_TRACE_VFORK_DONE
;
else
child
->
ptrace
&=
~
PT_TRACE_VFORK_DONE
;
if
(
data
&
PTRACE_O_TRACEEXIT
)
child
->
ptrace
|=
PT_TRACE_EXIT
;
else
child
->
ptrace
&=
~
PT_TRACE_EXIT
;
if
((
data
&
(
PTRACE_O_TRACESYSGOOD
|
PTRACE_O_TRACEFORK
|
PTRACE_O_TRACEVFORK
|
PTRACE_O_TRACECLONE
|
PTRACE_O_TRACEEXEC
|
PTRACE_O_TRACEEXIT
|
PTRACE_O_TRACEVFORKDONE
))
!=
data
)
return
-
EINVAL
;
return
0
;
return
(
data
&
~
PTRACE_O_MASK
)
?
-
EINVAL
:
0
;
}
static
int
ptrace_getsiginfo
(
struct
task_struct
*
child
,
long
data
)
...
...
kernel/signal.c
View file @
6ed4b2d7
...
...
@@ -19,6 +19,7 @@
#include <linux/tty.h>
#include <linux/binfmts.h>
#include <linux/security.h>
#include <linux/ptrace.h>
#include <asm/param.h>
#include <asm/uaccess.h>
#include <asm/siginfo.h>
...
...
security/capability.c
View file @
6ed4b2d7
...
...
@@ -18,6 +18,7 @@
#include <linux/smp_lock.h>
#include <linux/skbuff.h>
#include <linux/netlink.h>
#include <linux/ptrace.h>
int
cap_capable
(
struct
task_struct
*
tsk
,
int
cap
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment