Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
a997fcf6
Commit
a997fcf6
authored
Oct 11, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Use set_fs helper to operate with ptrace
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
572e8a15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
binfmt-elf-for-cr-5
kernel/binfmt-elf-for-cr-5
+8
-11
No files found.
kernel/binfmt-elf-for-cr-5
View file @
a997fcf6
...
...
@@ -27,7 +27,7 @@ Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
arch/x86/include/asm/elf.h | 3
arch/x86/include/asm/elf_ckpt.h | 80 ++++++++
arch/x86/kernel/Makefile | 2
arch/x86/kernel/elf_ckpt.c | 12
3
++++++++++++
arch/x86/kernel/elf_ckpt.c | 12
0
++++++++++++
arch/x86/vdso/vma.c | 22 ++
fs/Kconfig.binfmt | 11 +
fs/Makefile | 1
...
...
@@ -36,7 +36,7 @@ Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
fs/exec.c | 27 +-
include/linux/binfmts.h | 1
include/linux/elf_ckpt.h | 90 +++++++++
12 files changed, 74
4
insertions(+), 12 deletions(-)
12 files changed, 74
1
insertions(+), 12 deletions(-)
Index: linux-2.6.git/arch/x86/include/asm/elf.h
===================================================================
...
...
@@ -154,7 +154,7 @@ Index: linux-2.6.git/arch/x86/kernel/elf_ckpt.c
===================================================================
--- /dev/null
+++ linux-2.6.git/arch/x86/kernel/elf_ckpt.c
@@ -0,0 +1,12
3
@@
@@ -0,0 +1,12
0
@@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
...
...
@@ -199,19 +199,15 @@ Index: linux-2.6.git/arch/x86/kernel/elf_ckpt.c
+{
+ struct thread_struct *thread = ¤t->thread;
+ struct ckpt_arch_entry *arch = (struct ckpt_arch_entry *)core_entry->arch;
+ int i, cpu, ret;
+ mm_segment_t old_fs;
+ int i, ret;
+
+ BUILD_BUG_ON(CKPT_GDT_ENTRY_TLS_ENTRIES != GDT_ENTRY_TLS_ENTRIES);
+ BUILD_BUG_ON(sizeof(struct ckpt_arch_entry) > CKPT_ARCH_SIZE);
+
+ /*
+ * Registers setup.
+ *
+ * Since we might be modifying MSRs we're
+ * to be sure the task wont be preempted
+ * until modification is complete.
+ */
+ cpu = get_cpu();
+
+ regs->ip = arch->gpregs.ip;
+ regs->sp = arch->gpregs.sp;
...
...
@@ -260,11 +256,12 @@ Index: linux-2.6.git/arch/x86/kernel/elf_ckpt.c
+ goto out_put;
+ }
+
+ put_cpu();
+
+ /* Restoring FPU */
+ if (core_entry->task_flags & PF_USED_MATH) {
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ ret = arch_ptrace(current, PTRACE_SETFPREGS, 0, (unsigned long)&arch->fpregs);
+ set_fs(old_fs);
+ if (ret)
+ goto out;
+ }
...
...
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