Commit 003e1532 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

kernel: Update patch series

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent bd2a541c
...@@ -26,7 +26,7 @@ The later doesn't call for de_thread() allowing to keep threads ...@@ -26,7 +26,7 @@ The later doesn't call for de_thread() allowing to keep threads
relationship. Also arch_setup_additional_pages_at() helper added relationship. Also arch_setup_additional_pages_at() helper added
to setup vdso at predefined address. to setup vdso at predefined address.
At moment only x86-64 architecture is supported. At moment only pure x86-64 architecture is supported.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Andrew Vagin <avagin@parallels.com> CC: Andrew Vagin <avagin@parallels.com>
...@@ -35,8 +35,11 @@ CC: James Bottomley <jbottomley@parallels.com> ...@@ -35,8 +35,11 @@ CC: James Bottomley <jbottomley@parallels.com>
CC: Glauber Costa <glommer@parallels.com> CC: Glauber Costa <glommer@parallels.com>
CC: H. Peter Anvin <hpa@zytor.com> CC: H. Peter Anvin <hpa@zytor.com>
CC: Ingo Molnar <mingo@elte.hu> CC: Ingo Molnar <mingo@elte.hu>
CC: Al Viro <viro@ZenIV.linux.org.uk>
CC: Tejun Heo <tj@kernel.org> CC: Tejun Heo <tj@kernel.org>
CC: Dave Hansen <dave@linux.vnet.ibm.com>
CC: Eric W. Biederman ebiederm@xmission.com
CC: Daniel Lezcano <dlezcano@fr.ibm.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
--- ---
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 ++++++++
......
clone: Introduce the CLONE_CHILD_USEPID functionality
From: Pavel Emelyanov <xemul@openvz.org> From: Pavel Emelyanov <xemul@openvz.org>
Subject: [PATCH] clone: Introduce the CLONE_CHILD_USEPID functionality
When restoring a task (or a set of tasks) we need to recreate them with When restoring a task (or a set of tasks) we need to recreate them with
exactly the same pid as they had before. Thus we need the ability to create exactly the same pid as they had before. Thus we need the ability to create
...@@ -50,7 +51,7 @@ Index: linux-2.6.git/kernel/fork.c ...@@ -50,7 +51,7 @@ Index: linux-2.6.git/kernel/fork.c
=================================================================== ===================================================================
--- linux-2.6.git.orig/kernel/fork.c --- linux-2.6.git.orig/kernel/fork.c
+++ linux-2.6.git/kernel/fork.c +++ linux-2.6.git/kernel/fork.c
@@ -1239,8 +1239,16 @@ static struct task_struct *copy_process( @@ -1253,8 +1253,16 @@ static struct task_struct *copy_process(
goto bad_fork_cleanup_io; goto bad_fork_cleanup_io;
if (pid != &init_struct_pid) { if (pid != &init_struct_pid) {
......
...@@ -75,7 +75,7 @@ Index: linux-2.6.git/include/linux/fs.h ...@@ -75,7 +75,7 @@ Index: linux-2.6.git/include/linux/fs.h
=================================================================== ===================================================================
--- linux-2.6.git.orig/include/linux/fs.h --- linux-2.6.git.orig/include/linux/fs.h
+++ linux-2.6.git/include/linux/fs.h +++ linux-2.6.git/include/linux/fs.h
@@ -2027,6 +2027,7 @@ extern struct file *file_open_root(struc @@ -2025,6 +2025,7 @@ extern struct file *file_open_root(struc
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
const struct cred *); const struct cred *);
extern int filp_close(struct file *, fl_owner_t id); extern int filp_close(struct file *, fl_owner_t id);
......
...@@ -6,17 +6,18 @@ information by /proc/$pid/tls entry. ...@@ -6,17 +6,18 @@ information by /proc/$pid/tls entry.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
--- ---
fs/proc/base.c | 16 ++++++++++++++++ fs/proc/base.c | 20 ++++++++++++++++++++
1 file changed, 16 insertions(+) 1 file changed, 20 insertions(+)
Index: linux-2.6.git/fs/proc/base.c Index: linux-2.6.git/fs/proc/base.c
=================================================================== ===================================================================
--- linux-2.6.git.orig/fs/proc/base.c --- linux-2.6.git.orig/fs/proc/base.c
+++ linux-2.6.git/fs/proc/base.c +++ linux-2.6.git/fs/proc/base.c
@@ -3150,6 +3150,21 @@ static int proc_pid_personality(struct s @@ -3150,6 +3150,23 @@ static int proc_pid_personality(struct s
return err; return err;
} }
+#ifdef CONFIG_X86
+static int proc_pid_tls(struct seq_file *m, struct pid_namespace *ns, +static int proc_pid_tls(struct seq_file *m, struct pid_namespace *ns,
+ struct pid *pid, struct task_struct *task) + struct pid *pid, struct task_struct *task)
+{ +{
...@@ -31,15 +32,18 @@ Index: linux-2.6.git/fs/proc/base.c ...@@ -31,15 +32,18 @@ Index: linux-2.6.git/fs/proc/base.c
+ } + }
+ return err; + return err;
+} +}
+#endif
+ +
/* /*
* Thread groups * Thread groups
*/ */
@@ -3169,6 +3184,7 @@ static const struct pid_entry tgid_base_ @@ -3169,6 +3186,9 @@ static const struct pid_entry tgid_base_
INF("auxv", S_IRUSR, proc_pid_auxv), INF("auxv", S_IRUSR, proc_pid_auxv),
ONE("status", S_IRUGO, proc_pid_status), ONE("status", S_IRUGO, proc_pid_status),
ONE("personality", S_IRUGO, proc_pid_personality), ONE("personality", S_IRUGO, proc_pid_personality),
+#ifdef CONFIG_X86
+ ONE("tls", S_IRUGO, proc_pid_tls), + ONE("tls", S_IRUGO, proc_pid_tls),
+#endif
INF("limits", S_IRUGO, proc_pid_limits), INF("limits", S_IRUGO, proc_pid_limits),
#ifdef CONFIG_SCHED_DEBUG #ifdef CONFIG_SCHED_DEBUG
REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations),
...@@ -26,13 +26,14 @@ Cc: <stable@kernel.org> ...@@ -26,13 +26,14 @@ Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
--- ---
fs/proc/base.c | 146 +++++++++++++++++++++++++++++++++-------------- fs/proc/base.c | 146 ++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 103 insertions(+), 43 deletions(-) 1 file changed, 103 insertions(+), 43 deletions(-)
diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/base.c Index: linux-2.6.git/fs/proc/base.c
--- a/fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd ===================================================================
+++ a/fs/proc/base.c --- linux-2.6.git.orig/fs/proc/base.c
@@ -1652,12 +1652,46 @@ out: +++ linux-2.6.git/fs/proc/base.c
@@ -1665,12 +1665,46 @@ out:
return error; return error;
} }
...@@ -79,7 +80,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -79,7 +80,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
/* building an inode */ /* building an inode */
@@ -1889,49 +1923,61 @@ out: @@ -1902,49 +1936,61 @@ out:
static int proc_fd_info(struct inode *inode, struct path *path, char *info) static int proc_fd_info(struct inode *inode, struct path *path, char *info)
{ {
...@@ -180,7 +181,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -180,7 +181,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
} }
static int proc_fd_link(struct inode *inode, struct path *path) static int proc_fd_link(struct inode *inode, struct path *path)
@@ -2026,7 +2072,7 @@ static struct dentry *proc_fd_instantiat @@ -2039,7 +2085,7 @@ static struct dentry *proc_fd_instantiat
spin_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
...@@ -189,7 +190,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -189,7 +190,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
inode->i_size = 64; inode->i_size = 64;
ei->op.proc_get_link = proc_fd_link; ei->op.proc_get_link = proc_fd_link;
d_set_d_op(dentry, &tid_fd_dentry_operations); d_set_d_op(dentry, &tid_fd_dentry_operations);
@@ -2058,7 +2104,12 @@ static struct dentry *proc_lookupfd_comm @@ -2071,7 +2117,12 @@ static struct dentry *proc_lookupfd_comm
if (fd == ~0U) if (fd == ~0U)
goto out; goto out;
...@@ -202,7 +203,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -202,7 +203,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
out: out:
put_task_struct(task); put_task_struct(task);
out_no_task: out_no_task:
@@ -2078,23 +2129,28 @@ static int proc_readfd_common(struct fil @@ -2091,23 +2142,28 @@ static int proc_readfd_common(struct fil
retval = -ENOENT; retval = -ENOENT;
if (!p) if (!p)
goto out_no_task; goto out_no_task;
...@@ -234,7 +235,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -234,7 +235,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
rcu_read_lock(); rcu_read_lock();
for (fd = filp->f_pos-2; for (fd = filp->f_pos-2;
fd < files_fdtable(files)->max_fds; fd < files_fdtable(files)->max_fds;
@@ -2118,6 +2174,9 @@ static int proc_readfd_common(struct fil @@ -2131,6 +2187,9 @@ static int proc_readfd_common(struct fil
rcu_read_unlock(); rcu_read_unlock();
put_files_struct(files); put_files_struct(files);
} }
...@@ -244,7 +245,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -244,7 +245,7 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
out: out:
put_task_struct(p); put_task_struct(p);
out_no_task: out_no_task:
@@ -2195,6 +2254,7 @@ static struct dentry *proc_fdinfo_instan @@ -2208,6 +2267,7 @@ static struct dentry *proc_fdinfo_instan
ei->fd = fd; ei->fd = fd;
inode->i_mode = S_IFREG | S_IRUSR; inode->i_mode = S_IFREG | S_IRUSR;
inode->i_fop = &proc_fdinfo_file_operations; inode->i_fop = &proc_fdinfo_file_operations;
...@@ -252,4 +253,3 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba ...@@ -252,4 +253,3 @@ diff -puN fs/proc/base.c~proc-fix-races-against-execve-of-proc-pid-fd fs/proc/ba
d_set_d_op(dentry, &tid_fd_dentry_operations); d_set_d_op(dentry, &tid_fd_dentry_operations);
d_add(dentry, inode); d_add(dentry, inode);
/* Close the race of the process dying before we return the dentry */ /* Close the race of the process dying before we return the dentry */
_
...@@ -12,10 +12,11 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> ...@@ -12,10 +12,11 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/proc_sysctl.c | 1 + fs/proc/proc_sysctl.c | 1 +
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff -puN fs/proc/proc_sysctl.c~procfs-report-eisdir-when-reading-sysctl-dirs-in-proc fs/proc/proc_sysctl.c Index: linux-2.6.git/fs/proc/proc_sysctl.c
--- a/fs/proc/proc_sysctl.c~procfs-report-eisdir-when-reading-sysctl-dirs-in-proc ===================================================================
+++ a/fs/proc/proc_sysctl.c --- linux-2.6.git.orig/fs/proc/proc_sysctl.c
@@ -360,6 +360,7 @@ static const struct file_operations proc +++ linux-2.6.git/fs/proc/proc_sysctl.c
@@ -370,6 +370,7 @@ static const struct file_operations proc
}; };
static const struct file_operations proc_sys_dir_file_operations = { static const struct file_operations proc_sys_dir_file_operations = {
...@@ -23,4 +24,3 @@ diff -puN fs/proc/proc_sysctl.c~procfs-report-eisdir-when-reading-sysctl-dirs-in ...@@ -23,4 +24,3 @@ diff -puN fs/proc/proc_sysctl.c~procfs-report-eisdir-when-reading-sysctl-dirs-in
.readdir = proc_sys_readdir, .readdir = proc_sys_readdir,
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
}; };
_
cr-proc-add-children
procfs-report-eisdir-when-reading-sysctl-dirs-in-proc.patch procfs-report-eisdir-when-reading-sysctl-dirs-in-proc.patch
proc-fix-races-against-execve-of-proc-pid-fd.patch proc-fix-races-against-execve-of-proc-pid-fd.patch
proc-fix-races-against-execve-of-proc-pid-fd-fix.patch proc-fix-races-against-execve-of-proc-pid-fd-fix.patch
proc-force-dcache-drop-on-unauthorized-access.patch proc-force-dcache-drop-on-unauthorized-access.patch
cr-statfs-callback-for-pipefs cr-statfs-callback-for-pipefs
cr-clone-with-pid-support cr-clone-with-pid-support
cr-proc-add-children
fs-add-do-close
fs-proc-switch-to-dentry fs-proc-switch-to-dentry
cr-proc-map-files-21 cr-proc-map-files-21
fs-proc-add-tls fs-proc-add-tls
fs-add-do-close
fs-proc-add-mm-task-stat fs-proc-add-mm-task-stat
binfmt-elf-for-cr-5 binfmt-elf-for-cr-5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment