netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Berlin <xkr47@outerspace.dyndns.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: PANIC: divide by zero in xt_connbytes
Date: Thu, 18 Jan 2007 13:38:41 +0000	[thread overview]
Message-ID: <45AF7861.5000201@outerspace.dyndns.org> (raw)
In-Reply-To: <45AF7617.8010202@netfilter.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Quoting Pablo Neira Ayuso on 01/18/2007 01:28 PM UTC:
|> ~  http://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=533
|
| Copied from your patch available on bugzilla:
|
|> diff -ur linux-2.6.19/net/netfilter/xt_connbytes.c linux-2.6.19-xt_connbytes_fix/net/netfilter/xt_connbytes.c
|> --- linux-2.6.19/net/netfilter/xt_connbytes.c	2007-01-11 20:01:51.000000000 +0200
|> +++ linux-2.6.19-xt_connbytes_fix/net/netfilter/xt_connbytes.c	2007-01-18 12:15:50.000000000 +0200
|> @@ -89,26 +89,39 @@
|>  	case XT_CONNBYTES_AVGPKT:
|>  		switch (sinfo->direction) {
|>  		case XT_CONNBYTES_DIR_ORIGINAL:
|> -			what = div64_64(counters[IP_CT_DIR_ORIGINAL].bytes,
|> -					counters[IP_CT_DIR_ORIGINAL].packets);
|
| Better check that divisor must be != 0 inside div64_64.

I initially suggested that too and would have renamed the function to div64_64_safe() or similar in the same go.. but Hidden (on irc) thought it was up to the caller to do the checking, and I felt he probably knows the kernel way of thinking better than me and succumbed. :) I think it's up to Patrick, I'm really only concerned with that it gets fixed :) If Patrick so requests, I'll redo it the other way..

|> +					/* FIXME_THEORETICAL: what to do if sum
|> +					 * overflows ? */
|                                            ^^^
| Hm, already had this discussion: This is really hard to happen with 64
| bits counters, it would take years even in a high performance network.

Well I didn't put it there and it was out of scope to do any modifications to it in this patch :)

- - xkr47

- --
~ "if I'd make up my own definitions, unrational would be the the end
~  result after someone unrationalized something i.e. actively worked
~  to cut down on rationality, whereas irrational would be more a
~  result of laziness or lack of skill"
~                - me, 23.11.2006
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFr3hexyF48ZTvn+4RAz6DAJ4kNXaOEPE3EFCKJsDvmCJVIOjD0gCfRVmV
8iX2XHtLXMcRy0+MnOnoryE=
=fNp+
-----END PGP SIGNATURE-----

  reply	other threads:[~2007-01-18 13:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 10:59 PANIC: divide by zero in xt_connbytes Jonas Berlin
2007-01-18 11:56 ` Bugzilla webserver misconfigured? (was: Re: PANIC: divide by zero in xt_connbytes) Maximilian Wilhelm
2007-01-19  2:43   ` Bugzilla webserver misconfigured? Jonas Berlin
2007-01-18 13:28 ` PANIC: divide by zero in xt_connbytes Pablo Neira Ayuso
2007-01-18 13:38   ` Jonas Berlin [this message]
2007-01-18 14:22     ` KOVACS Krisztian
2007-01-22  8:52       ` KOVACS Krisztian
2007-01-26 17:24       ` Patrick McHardy
2007-01-26 20:11         ` KOVACS Krisztian
2007-01-27 16:36           ` Patrick McHardy

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=45AF7861.5000201@outerspace.dyndns.org \
    --to=xkr47@outerspace.dyndns.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@netfilter.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).