The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.35.5
------>
commit 4ba0afbe02d33bf2e906209521bb59e7fa0def73
Author: Stanislav Kinsburskiy <skinsbur...@virtuozzo.com>
Date:   Thu Aug 31 17:40:43 2017 +0300

    proc connector: send events to both VEs if not in VE#0
    
    This is needed to preserve current behaviour, when process in initial pid 
and
    user namespaces (i.e. in VE#0) can receive events from all the processes in
    the system.
    
    Signed-off-by: Stanislav Kinsburskiy <skinsbur...@virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
---
 drivers/connector/cn_proc.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 17e0247..81f2e56 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -96,16 +96,16 @@ static int proc_event_num_listeners(struct ve_struct *ve)
        return 0;
 }
 
-static void proc_event_connector(struct task_struct *task,
-                                int what, int cookie,
-                                bool (*fill_event)(struct proc_event *ev,
-                                                   struct ve_struct *ve,
-                                                   struct task_struct *task,
-                                                   int cookie))
+static void proc_event_connector_ve(struct task_struct *task,
+                                   struct ve_struct *ve,
+                                   int what, int cookie,
+                                   bool (*fill_event)(struct proc_event *ev,
+                                                      struct ve_struct *ve,
+                                                      struct task_struct *task,
+                                                      int cookie))
 {
        struct cn_msg *msg;
        __u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
-       struct ve_struct *ve = task->task_ve;
 
        if (proc_event_num_listeners(ve) < 1)
                return;
@@ -118,6 +118,21 @@ static void proc_event_connector(struct task_struct *task,
        cn_netlink_send_ve(ve, msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
+static void proc_event_connector(struct task_struct *task,
+                                int what, int cookie,
+                                bool (*fill_event)(struct proc_event *ev,
+                                                   struct ve_struct *ve,
+                                                   struct task_struct *task,
+                                                   int cookie))
+{
+       struct ve_struct *ve = task->task_ve;
+
+       if (!ve_is_super(ve))
+               proc_event_connector_ve(task, ve, what, cookie, fill_event);
+
+       proc_event_connector_ve(task, get_ve0(), what, cookie, fill_event);
+}
+
 static bool fill_fork_event(struct proc_event *ev, struct ve_struct *ve,
                            struct task_struct *task, int unused)
 {
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to