Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: James Morris <jmorris@namei.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Netfilter: Fix integer overflow in net/ipv6/netfilter/ip6_tables.c (fwd)
Date: Sun, 21 Mar 2010 22:59:34 +0100	[thread overview]
Message-ID: <1269208774.3004.15.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.LRH.2.00.1003220850180.3232@tundra.namei.org>

Le lundi 22 mars 2010 à 08:50 +1100, James Morris a écrit :
> ---------- Forwarded message ----------
> Date: Sat, 20 Mar 2010 22:32:40 +0800
> From: wzt.wzt@gmail.com
> To: linux-kernel@vger.kernel.org
> Cc: netfilter-devel@vger.kernel.org, kaber@trash.net
> Subject: [PATCH] Netfilter: Fix integer overflow in
>     net/ipv6/netfilter/ip6_tables.c
> 
> The get.size field in the get_entries() interface is not bounded
> correctly. The size is used to determine the total entry size.
> The size is bounded, but can overflow and so the size checks may
> not be sufficient to catch invalid size. Fix it by catching size
> values that would cause overflows before calculating the size.
> 
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
> 


Unless I am wrong, this patch is not necessary, since we do a bit
later :


                if (get.size == private->size)
                        ret = copy_entries_to_user(private->size,
                                                   t, uptr->entrytable);
                else {
                        duprintf("get_entries: I've got %u not %u!\n",
                                 private->size, get.size);
                        ret = -EAGAIN;
                }

So if get.size doesnt match private->size (kernel certified), we exit
with an error. No calculation, no overflow involved.




      reply	other threads:[~2010-03-21 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-21 21:50 [PATCH] Netfilter: Fix integer overflow in net/ipv6/netfilter/ip6_tables.c (fwd) James Morris
2010-03-21 21:59 ` Eric Dumazet [this message]

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=1269208774.3004.15.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=netdev@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