public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@unstable.cc>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Sven Eckelmann <sven.eckelmann@open-mesh.com>,
	Marek Lindner <mareklindner@neomailbox.ch>
Subject: Re: [B.A.T.M.A.N.] Unsigned integer overflow in batadv_iv_ogm_calc_tq
Date: Sat, 20 Feb 2016 13:10:12 +0800	[thread overview]
Message-ID: <20160220051012.GD5584@prodigo.lan> (raw)
In-Reply-To: <1792155.rcBUdH4UUQ@bentobox>

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

On Mon, Feb 15, 2016 at 01:35:31PM +0100, Sven Eckelmann wrote:
> It is easy to see that
> 
>     batadv_ogm_packet::tq (u8 255) *
>     tq_own (u8 255) *
>     tq_asym_penalty (int 134) *
>     tq_iface_penalty (int 255)
> 
> is outside the range of an signed integer (32 bit). The maximum seen
> here is 255 for each entry. So should tq_iface_penalty +
> tq_iface_penalty, inv_asym_penalty be changed to unsigned int?

Given that all these values are in the TQ domain I'd say that they should all be
positive all the time, therefore there is no gain in using a signed variable
here.

Marek, what do you think ?

Cheers,

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-02-20  5:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 12:35 [B.A.T.M.A.N.] Unsigned integer overflow in batadv_iv_ogm_calc_tq Sven Eckelmann
2016-02-20  5:10 ` Antonio Quartulli [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=20160220051012.GD5584@prodigo.lan \
    --to=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=sven.eckelmann@open-mesh.com \
    /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