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
69a7b9e7
Commit
69a7b9e7
authored
Oct 13, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Add stack being found test
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
9977390e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
binfmt-elf-for-cr-5
kernel/binfmt-elf-for-cr-5
+19
-7
No files found.
kernel/binfmt-elf-for-cr-5
View file @
69a7b9e7
...
@@ -27,16 +27,16 @@ Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
...
@@ -27,16 +27,16 @@ Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
arch/x86/include/asm/elf.h | 3
arch/x86/include/asm/elf.h | 3
arch/x86/include/asm/elf_ckpt.h | 80 +++++++++
arch/x86/include/asm/elf_ckpt.h | 80 +++++++++
arch/x86/kernel/Makefile | 2
arch/x86/kernel/Makefile | 2
arch/x86/kernel/elf_ckpt.c | 161 ++++++++++++++++++
+
arch/x86/kernel/elf_ckpt.c | 161 ++++++++++++++++++
arch/x86/vdso/vma.c | 22 ++
arch/x86/vdso/vma.c | 22 ++
fs/Kconfig.binfmt | 11 +
fs/Kconfig.binfmt | 11 +
fs/Makefile | 1
fs/Makefile | 1
fs/binfmt_elf.c | 17 +
-
fs/binfmt_elf.c | 17 +
fs/binfmt_elf_ckpt.c | 3
32
++++++++++++++++++++++++++++++++++++++++
fs/binfmt_elf_ckpt.c | 3
44
++++++++++++++++++++++++++++++++++++++++
fs/exec.c | 27 +
+
-
fs/exec.c | 27 +
-
-
include/linux/binfmts.h | 1
include/linux/binfmts.h | 1
include/linux/elf_ckpt.h | 103 +++++++++++
+
include/linux/elf_ckpt.h | 103 +++++++++++
12 files changed, 7
48
insertions(+), 12 deletions(-)
12 files changed, 7
60
insertions(+), 12 deletions(-)
Index: linux-2.6.git/arch/x86/include/asm/elf.h
Index: linux-2.6.git/arch/x86/include/asm/elf.h
===================================================================
===================================================================
...
@@ -429,7 +429,7 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
...
@@ -429,7 +429,7 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
===================================================================
===================================================================
--- /dev/null
--- /dev/null
+++ linux-2.6.git/fs/binfmt_elf_ckpt.c
+++ linux-2.6.git/fs/binfmt_elf_ckpt.c
@@ -0,0 +1,3
32
@@
@@ -0,0 +1,3
44
@@
+#include <linux/module.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/fs.h>
...
@@ -486,6 +486,8 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
...
@@ -486,6 +486,8 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
+#endif
+#endif
+
+
+ struct core_entry *core_entry = NULL;
+ struct core_entry *core_entry = NULL;
+ unsigned long start_stack = -1UL;
+
+ int i, ret = -ENOEXEC;
+ int i, ret = -ENOEXEC;
+ loff_t off;
+ loff_t off;
+
+
...
@@ -609,6 +611,11 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
...
@@ -609,6 +611,11 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
+ vdso = vma_entry_ptr->start;
+ vdso = vma_entry_ptr->start;
+#endif
+#endif
+
+
+ if (vma_entry_ptr->status & VMA_AREA_STACK) {
+ /* Note if stack is VM_GROWSUP -- it should be reversed */
+ start_stack = vma_entry_ptr->start;
+ }
+
+ /* Anything special should be ignored */
+ /* Anything special should be ignored */
+ if (!(vma_entry_ptr->status & VMA_AREA_REGULAR))
+ if (!(vma_entry_ptr->status & VMA_AREA_REGULAR))
+ continue;
+ continue;
...
@@ -656,6 +663,11 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
...
@@ -656,6 +663,11 @@ Index: linux-2.6.git/fs/binfmt_elf_ckpt.c
+ }
+ }
+#endif
+#endif
+
+
+ if (start_stack == -1UL) {
+ pr_err("elf-ckpt: Can't find stack VMA\n");
+ ret = -ENOEXEC;
+ goto out_unmap;
+ }
+
+
+ /* The name it has before */
+ /* The name it has before */
+ set_task_comm(current, core_entry->task_comm);
+ set_task_comm(current, core_entry->task_comm);
...
...
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