Commit 9911c113 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: xt_owner: bail out with EINVAL in case of unsupported flags

Reject flags that are not supported with EINVAL.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 87e389b4
...@@ -11,6 +11,11 @@ enum { ...@@ -11,6 +11,11 @@ enum {
XT_OWNER_SUPPL_GROUPS = 1 << 3, XT_OWNER_SUPPL_GROUPS = 1 << 3,
}; };
#define XT_OWNER_MASK (XT_OWNER_UID | \
XT_OWNER_GID | \
XT_OWNER_SOCKET | \
XT_OWNER_SUPPL_GROUPS)
struct xt_owner_match_info { struct xt_owner_match_info {
__u32 uid_min, uid_max; __u32 uid_min, uid_max;
__u32 gid_min, gid_max; __u32 gid_min, gid_max;
......
...@@ -25,6 +25,9 @@ static int owner_check(const struct xt_mtchk_param *par) ...@@ -25,6 +25,9 @@ static int owner_check(const struct xt_mtchk_param *par)
struct xt_owner_match_info *info = par->matchinfo; struct xt_owner_match_info *info = par->matchinfo;
struct net *net = par->net; struct net *net = par->net;
if (info->match & ~XT_OWNER_MASK)
return -EINVAL;
/* Only allow the common case where the userns of the writer /* Only allow the common case where the userns of the writer
* matches the userns of the network namespace. * matches the userns of the network namespace.
*/ */
......
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