rpms/kernel/devel kernel.spec, 1.1184, 1.1185 linux-2.6-utrace.patch, 1.105, 1.106
Roland McGrath
roland at fedoraproject.org
Mon Dec 29 03:53:16 UTC 2008
Author: roland
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12228
Modified Files:
kernel.spec linux-2.6-utrace.patch
Log Message:
utrace rebase
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1184
retrieving revision 1.1185
diff -u -r1.1184 -r1.1185
--- kernel.spec 29 Dec 2008 02:48:00 -0000 1.1184
+++ kernel.spec 29 Dec 2008 03:52:45 -0000 1.1185
@@ -1027,7 +1027,7 @@
ApplyPatch linux-2.6-hotfixes.patch
# Roland's utrace ptrace replacement.
-#ApplyPatch linux-2.6-utrace.patch
+ApplyPatch linux-2.6-utrace.patch
# enable sysrq-c on all kernels, not only kexec
ApplyPatch linux-2.6-sysrq-c.patch
@@ -1762,6 +1762,9 @@
%kernel_variant_files -k vmlinux %{with_kdump} kdump
%changelog
+* Sun Dec 28 2008 Roland McGrath <roland at redhat.com>
+- utrace rebase
+
* Sun Dec 28 2008 Dave Jones <davej at redhat.com>
- 2.6.28-git1
Drop utrace temporarily.
@@ -1831,7 +1834,7 @@
- 2.6.28-rc8-git3
* Sat Dec 13 2008 Kyle McMartin <kyle at redhat.com>
-- 2.6.28-rc8-git2
+- 2.6.28-rc8-git2
* Sat Dec 13 2008 Tom "spot" Callaway <tcallawa at redhat.com>
- Add "scsi_esp_register" to the search terms for modules.block so we pick up sun_esp.ko
@@ -1912,7 +1915,7 @@
- 2.6.28-rc6-git1
* Mon Nov 24 2008 Jeremy Katz <katzj at redhat.com>
-- Add modules.drm file so that we can determine the DRM modules to pull into
+- Add modules.drm file so that we can determine the DRM modules to pull into
initrds
* Wed Nov 19 2008 Neil Horman <nhorman at redhat.com>
linux-2.6-utrace.patch:
Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace.patch,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- linux-2.6-utrace.patch 25 Dec 2008 01:49:18 -0000 1.105
+++ linux-2.6-utrace.patch 29 Dec 2008 03:52:45 -0000 1.106
@@ -1,4 +1,4 @@
- Documentation/DocBook/Makefile | 4 +-
+ Documentation/DocBook/Makefile | 2 +-
Documentation/DocBook/utrace.tmpl | 566 ++++++++
fs/proc/array.c | 3 +
include/linux/ptrace.h | 21 +
@@ -7,21 +7,17 @@
include/linux/utrace.h | 707 ++++++++++
init/Kconfig | 26 +
kernel/Makefile | 1 +
- kernel/ptrace.c | 793 +++++++++++-
+ kernel/ptrace.c | 791 +++++++++++-
kernel/signal.c | 14 +-
kernel/utrace.c | 2587 +++++++++++++++++++++++++++++++++++++
- 12 files changed, 4783 insertions(+), 13 deletions(-)
+ 12 files changed, 4781 insertions(+), 11 deletions(-)
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
-index 9b1f6ca..e39334b 100644
+index 0a08126..7570189 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
-@@ -6,10 +6,10 @@
- # To add a new book the only step required is to add the book to the
- # list of DOCBOOKS.
-
--DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml \
-+DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml \
+@@ -9,7 +9,7 @@
+ DOCBOOKS := z8530book.xml mcabook.xml \
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
procfs-guide.xml writing_usb_driver.xml networking.xml \
- kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
@@ -602,7 +598,7 @@
+
+</book>
diff --git a/fs/proc/array.c b/fs/proc/array.c
-index 6af7fba..9b6902a 100644
+index 7e4877d..0c683ed 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -81,6 +81,7 @@
@@ -613,9 +609,9 @@
#include <asm/pgtable.h>
#include <asm/processor.h>
-@@ -185,6 +186,8 @@ static inline void task_state(struct seq
- p->uid, p->euid, p->suid, p->fsuid,
- p->gid, p->egid, p->sgid, p->fsgid);
+@@ -187,6 +188,8 @@ static inline void task_state(struct seq
+ cred->uid, cred->euid, cred->suid, cred->fsuid,
+ cred->gid, cred->egid, cred->sgid, cred->fsgid);
+ task_utrace_proc_status(m, p);
+
@@ -623,10 +619,10 @@
if (p->files)
fdt = files_fdtable(p->files);
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
-index 22641d5..91b3412 100644
+index 98b93ca..9b0d5be 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
-@@ -120,6 +120,7 @@ static inline void ptrace_unlink(struct
+@@ -121,6 +121,7 @@ static inline void ptrace_unlink(struct
int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data);
int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data);
@@ -634,7 +630,7 @@
/**
* task_ptrace - return %PT_* flags that apply to a task
* @task: pointer to &task_struct in question
-@@ -153,6 +154,26 @@ static inline int ptrace_event(int mask,
+@@ -154,6 +155,26 @@ static inline int ptrace_event(int mask,
return 1;
}
@@ -662,10 +658,10 @@
* ptrace_init_task - initialize ptrace state for a new child
* @child: new child task
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 55e30d1..b82b5f4 100644
+index 8395e71..edf9b54 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1243,6 +1243,11 @@ struct task_struct {
+@@ -1211,6 +1211,11 @@ struct task_struct {
#endif
seccomp_t seccomp;
@@ -677,7 +673,7 @@
/* Thread group tracking */
u32 parent_exec_id;
u32 self_exec_id;
-@@ -1829,6 +1834,7 @@ extern int kill_pgrp(struct pid *pid, in
+@@ -1810,6 +1815,7 @@ extern int kill_pgrp(struct pid *pid, in
extern int kill_pid(struct pid *pid, int sig, int priv);
extern int kill_proc_info(int, struct siginfo *, pid_t);
extern int do_notify_parent(struct task_struct *, int);
@@ -1632,10 +1628,10 @@
+
+#endif /* linux/utrace.h */
diff --git a/init/Kconfig b/init/Kconfig
-index f763762..df75f9c 100644
+index 8a63c40..8fbc607 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -923,6 +923,32 @@ config STOP_MACHINE
+@@ -931,6 +931,32 @@ config STOP_MACHINE
help
Need stop_machine() primitive.
@@ -1669,10 +1665,10 @@
config PREEMPT_NOTIFIERS
diff --git a/kernel/Makefile b/kernel/Makefile
-index 19fad00..16a30b0 100644
+index 027edda..15fd878 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
-@@ -64,6 +64,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
+@@ -63,6 +63,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
@@ -1681,7 +1677,7 @@
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index 4c8bcd7..8d19d04 100644
+index 29dc700..70e94e2 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -16,6 +16,7 @@
@@ -1692,7 +1688,7 @@
#include <linux/security.h>
#include <linux/signal.h>
#include <linux/audit.h>
-@@ -38,6 +39,7 @@ void __ptrace_link(struct task_struct *c
+@@ -49,6 +50,7 @@ void __ptrace_link(struct task_struct *c
child->parent = new_parent;
}
@@ -1700,7 +1696,7 @@
/*
* Turn a tracing stop into a normal stop now, since with no tracer there
* would be no way to wake it up with SIGCONT or SIGKILL. If there was a
-@@ -58,6 +60,72 @@ static void ptrace_untrace(struct task_s
+@@ -69,6 +71,72 @@ static void ptrace_untrace(struct task_s
spin_unlock(&child->sighand->siglock);
}
@@ -1773,10 +1769,10 @@
/*
* unptrace a task: move it back to its original parent and
* remove it from the ptrace list.
-@@ -72,10 +140,11 @@ void __ptrace_unlink(struct task_struct
- child->parent = child->real_parent;
+@@ -84,10 +152,11 @@ void __ptrace_unlink(struct task_struct
list_del_init(&child->ptrace_entry);
+ arch_ptrace_untrace(child);
- if (task_is_traced(child))
- ptrace_untrace(child);
+ ptrace_finish(child);
@@ -1787,7 +1783,7 @@
/*
* Check that we have indeed attached to the thing..
*/
-@@ -113,6 +182,536 @@ int ptrace_check_attach(struct task_stru
+@@ -125,6 +194,536 @@ int ptrace_check_attach(struct task_stru
return ret;
}
@@ -2142,7 +2138,7 @@
+ info->si_errno = 0;
+ info->si_code = SI_USER;
+ info->si_pid = task_pid_vnr(task->parent);
-+ info->si_uid = task->parent->uid;
++ info->si_uid = __task_cred(task->parent)->uid;
+ }
+
+ task->exit_code = 0;
@@ -2178,7 +2174,7 @@
+ info->si_signo = SIGTRAP;
+ info->si_code = SIGTRAP;
+ info->si_pid = task_pid_vnr(task);
-+ info->si_uid = task->uid;
++ info->si_uid = __task_cred(task->parent)->uid;
+ break;
+ }
+ /* Fall through. */
@@ -2323,8 +2319,8 @@
+
int __ptrace_may_access(struct task_struct *task, unsigned int mode)
{
- /* May we inspect the given task?
-@@ -156,12 +755,17 @@ int ptrace_attach(struct task_struct *ta
+ const struct cred *cred = current_cred(), *tcred;
+@@ -176,12 +775,17 @@ int ptrace_attach(struct task_struct *ta
{
int retval;
unsigned long flags;
@@ -2341,20 +2337,18 @@
+ if (unlikely(IS_ERR(engine)))
+ return PTR_ERR(engine);
- repeat:
- /*
-@@ -202,8 +806,8 @@ repeat:
- bad:
- write_unlock_irqrestore(&tasklist_lock, flags);
+ /* Protect exec's credential calculations against our interference;
+ * SUID, SGID and LSM creds get determined differently under ptrace.
+@@ -232,7 +836,7 @@ bad:
task_unlock(task);
--out:
+ mutex_unlock(¤t->cred_exec_mutex);
+ out:
- return retval;
-+
+ return finish_ptrace_attach(task, engine, retval);
}
static inline void __ptrace_detach(struct task_struct *child, unsigned int data)
-@@ -221,9 +825,7 @@ int ptrace_detach(struct task_struct *ch
+@@ -250,9 +854,7 @@ int ptrace_detach(struct task_struct *ch
if (!valid_signal(data))
return -EIO;
@@ -2365,7 +2359,7 @@
write_lock_irq(&tasklist_lock);
/* protect against de_thread()->release_task() */
-@@ -309,6 +911,8 @@ static int ptrace_setoptions(struct task
+@@ -338,6 +940,8 @@ static int ptrace_setoptions(struct task
if (data & PTRACE_O_TRACEEXIT)
child->ptrace |= PT_TRACE_EXIT;
@@ -2374,7 +2368,7 @@
return (data & ~PTRACE_O_MASK) ? -EINVAL : 0;
}
-@@ -367,6 +971,7 @@ static int ptrace_setsiginfo(struct task
+@@ -396,6 +1000,7 @@ static int ptrace_setsiginfo(struct task
#define is_sysemu_singlestep(request) 0
#endif
@@ -2382,7 +2376,7 @@
static int ptrace_resume(struct task_struct *child, long request, long data)
{
if (!valid_signal(data))
-@@ -401,6 +1006,170 @@ static int ptrace_resume(struct task_str
+@@ -430,6 +1035,170 @@ static int ptrace_resume(struct task_str
return 0;
}
@@ -2553,7 +2547,7 @@
int ptrace_request(struct task_struct *child, long request,
long addr, long data)
-@@ -480,6 +1249,11 @@ int ptrace_request(struct task_struct *c
+@@ -509,6 +1278,11 @@ int ptrace_request(struct task_struct *c
int ptrace_traceme(void)
{
int ret = -EPERM;
@@ -2565,7 +2559,7 @@
/*
* Are we already being traced?
-@@ -513,7 +1287,8 @@ repeat:
+@@ -542,7 +1316,8 @@ repeat:
write_unlock_irqrestore(&tasklist_lock, flags);
}
task_unlock(current);
@@ -2576,10 +2570,10 @@
/**
diff --git a/kernel/signal.c b/kernel/signal.c
-index 4530fc6..0e85826 100644
+index 8e95855..f966b6a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
-@@ -1419,7 +1419,7 @@ int do_notify_parent(struct task_struct
+@@ -1440,7 +1440,7 @@ int do_notify_parent(struct task_struct
return ret;
}
@@ -2588,7 +2582,7 @@
{
struct siginfo info;
unsigned long flags;
-@@ -1474,6 +1474,8 @@ static void do_notify_parent_cldstop(str
+@@ -1494,6 +1494,8 @@ static void do_notify_parent_cldstop(str
spin_unlock_irqrestore(&sighand->siglock, flags);
}
@@ -2597,7 +2591,7 @@
static inline int may_ptrace_stop(void)
{
if (!likely(current->ptrace & PT_PTRACED))
-@@ -1606,6 +1608,8 @@ void ptrace_notify(int exit_code)
+@@ -1626,6 +1628,8 @@ void ptrace_notify(int exit_code)
spin_unlock_irq(¤t->sighand->siglock);
}
@@ -2606,7 +2600,7 @@
static void
finish_stop(int stop_count)
{
-@@ -1683,6 +1687,7 @@ static int do_signal_stop(int signr)
+@@ -1703,6 +1707,7 @@ static int do_signal_stop(int signr)
return 1;
}
@@ -2614,7 +2608,7 @@
static int ptrace_signal(int signr, siginfo_t *info,
struct pt_regs *regs, void *cookie)
{
-@@ -1721,6 +1726,13 @@ static int ptrace_signal(int signr, sigi
+@@ -1741,6 +1746,13 @@ static int ptrace_signal(int signr, sigi
return signr;
}
More information about the fedora-extras-commits
mailing list