summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorKrishna Kumar <krkumar2@in.ibm.com>2012-06-27 00:59:56 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2012-07-04 19:51:50 +0200
commit46ba5a25f521e3c50d7bb81b1abb977769047456 (patch)
tree06a79cc715a40876905b0cf486243c549ba193c0 /net/netfilter
parent59560a38a379b6c9048620ee10711d3c0c5974b3 (diff)
downloadlinux-stable-46ba5a25f521e3c50d7bb81b1abb977769047456.tar.gz
linux-stable-46ba5a25f521e3c50d7bb81b1abb977769047456.tar.bz2
linux-stable-46ba5a25f521e3c50d7bb81b1abb977769047456.zip
netfilter: nfnetlink_queue: do not allow to set unsupported flag bits
Allow setting of only supported flag bits in queue->flags. Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nfnetlink_queue_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index a0b64920039d..c0496a55ad0c 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -910,6 +910,11 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
flags = ntohl(nla_get_be32(nfqa[NFQA_CFG_FLAGS]));
mask = ntohl(nla_get_be32(nfqa[NFQA_CFG_MASK]));
+ if (flags >= NFQA_CFG_F_MAX) {
+ ret = -EOPNOTSUPP;
+ goto err_out_unlock;
+ }
+
spin_lock_bh(&queue->lock);
queue->flags &= ~mask;
queue->flags |= flags & mask;