[Devel,RHEL7,COMMIT] ve/netfilter: allow adding matches from the container initial user namespace

Submitted by Konstantin Khorenko on June 20, 2017, 5:14 p.m.

Details

Message ID 201706201714.v5KHEgZK003998@finist_cl7.x64_64.work.ct
State New
Series "netfilter: allow adding matches from the container initial user namespace"
Headers show

Commit Message

Konstantin Khorenko June 20, 2017, 5:14 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.16.1.vz7.32.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.16.1.vz7.32.10
------>
commit d31486fd251b73aba7cf8922d6683727d5cf1217
Author: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Date:   Tue Jun 20 21:14:42 2017 +0400

    ve/netfilter: allow adding matches from the container initial user namespace
    
    https://jira.sw.ru/browse/PSBM-43609
    
    Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/xt_owner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/net/netfilter/xt_owner.c b/net/netfilter/xt_owner.c
index 79558fe..942cce1 100644
--- a/net/netfilter/xt_owner.c
+++ b/net/netfilter/xt_owner.c
@@ -83,7 +83,7 @@  static int owner_check(const struct xt_mtchk_param *par)
 
 	/* For now only allow adding matches from the initial user namespace */
 	if ((info->match & (XT_OWNER_UID|XT_OWNER_GID)) &&
-	    (current_user_ns() != &init_user_ns))
+	    !current_user_ns_initial())
 		return -EINVAL;
 	return 0;
 }