aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_owner.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/netfilter/xt_owner.c b/net/netfilter/xt_owner.c
index d382f9cc38b0..9059c16144c3 100644
--- a/net/netfilter/xt_owner.c
+++ b/net/netfilter/xt_owner.c
@@ -4,8 +4,8 @@
4 * 4 *
5 * (C) 2000 Marc Boucher <marc@mbsi.ca> 5 * (C) 2000 Marc Boucher <marc@mbsi.ca>
6 * 6 *
7 * Copyright © CC Computer Consultants GmbH, 2007 7 * Copyright © CC Computer Consultants GmbH, 2007 - 2008
8 * Contact: <jengelh@computergmbh.de> 8 * <jengelh@computergmbh.de>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -102,13 +102,15 @@ owner_mt(const struct sk_buff *skb, const struct net_device *in,
102 (XT_OWNER_UID | XT_OWNER_GID)) == 0; 102 (XT_OWNER_UID | XT_OWNER_GID)) == 0;
103 103
104 if (info->match & XT_OWNER_UID) 104 if (info->match & XT_OWNER_UID)
105 if ((filp->f_uid != info->uid) ^ 105 if ((filp->f_uid >= info->uid_min &&
106 !!(info->invert & XT_OWNER_UID)) 106 filp->f_uid <= info->uid_max) ^
107 !(info->invert & XT_OWNER_UID))
107 return false; 108 return false;
108 109
109 if (info->match & XT_OWNER_GID) 110 if (info->match & XT_OWNER_GID)
110 if ((filp->f_gid != info->gid) ^ 111 if ((filp->f_gid >= info->gid_min &&
111 !!(info->invert & XT_OWNER_GID)) 112 filp->f_gid <= info->gid_max) ^
113 !(info->invert & XT_OWNER_GID))
112 return false; 114 return false;
113 115
114 return true; 116 return true;