netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laura Garcia Liebana <nevola@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH 4/5] netfilter: nf_tables: Check u32 load in u8 nft_immediate attribute
Date: Wed, 10 Aug 2016 17:31:52 +0200	[thread overview]
Message-ID: <13f03298fe8c42993a4a56c3a2fe70cc67bd6bd5.1470842571.git.nevola@gmail.com> (raw)
In-Reply-To: <cover.1470842571.git.nevola@gmail.com>

Fix the direct assignment from u32 data input into the dlen attribute
with a size of u8.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
 net/netfilter/nft_immediate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/netfilter/nft_immediate.c b/net/netfilter/nft_immediate.c
index db3b746..6de590c 100644
--- a/net/netfilter/nft_immediate.c
+++ b/net/netfilter/nft_immediate.c
@@ -53,6 +53,9 @@ static int nft_immediate_init(const struct nft_ctx *ctx,
 			    tb[NFTA_IMMEDIATE_DATA]);
 	if (err < 0)
 		return err;
+
+	if (desc.len > U8_MAX)
+		return -EINVAL;
 	priv->dlen = desc.len;
 
 	priv->dreg = nft_parse_register(tb[NFTA_IMMEDIATE_DREG]);
-- 
2.8.1


  parent reply	other threads:[~2016-08-10 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 15:29 [PATCH 0/5] Check u32 load in u8 attributes Laura Garcia Liebana
2016-08-10 15:30 ` [PATCH 1/5] netfilter: nf_tables: Check u32 load in u8 nft_bitwise attribute Laura Garcia Liebana
2016-08-10 15:31 ` [PATCH 2/5] netfilter: nf_tables: Check u32 load in u8 nft_byteorder attribute Laura Garcia Liebana
2016-08-10 15:31 ` [PATCH 3/5] netfilter: nf_tables: Check u32 load in u8 nft_cmp attribute Laura Garcia Liebana
2016-08-10 15:31 ` Laura Garcia Liebana [this message]
2016-08-10 15:32 ` [PATCH 5/5] netfilter: nf_tables: Check u32 load in u8 nft_nat attribute Laura Garcia Liebana
2016-08-11 23:36 ` [PATCH 0/5] Check u32 load in u8 attributes Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13f03298fe8c42993a4a56c3a2fe70cc67bd6bd5.1470842571.git.nevola@gmail.com \
    --to=nevola@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).