From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq
Date: Sun, 28 Feb 2016 12:38:13 +0800 [thread overview]
Message-ID: <2465891.8WB3Uyx6em@voltaire> (raw)
In-Reply-To: <1455616027-22089-1-git-send-email-sven@open-mesh.com>
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
On Tuesday, February 16, 2016 10:47:07 Sven Eckelmann wrote:
> From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
>
> The undefined behavior sanatizer detected an signed integer overflow in a
> setup with near perfect link quality
>
> UBSAN: Undefined behaviour in net/batman-adv/bat_iv_ogm.c:1246:25
> signed integer overflow:
> 8713350 * 255 cannot be represented in type 'int'
>
> The problems happens because the calculation of mixed unsigned and signed
> integers resulted in an integer multiplication.
>
> batadv_ogm_packet::tq (u8 255)
> * tq_own (u8 255)
> * tq_asym_penalty (int 134; max 255)
> * tq_iface_penalty (int 255; max 255)
>
> The tq_iface_penalty, tq_asym_penalty and inv_asym_penalty can just be
> changed to unsigned int because they are not expected to become negative.
>
> Fixes: 46e44fdb96ef ("batman-adv: add WiFi penalty")
> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
> ---
> net/batman-adv/bat_iv_ogm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Applied in revision 789b846.
Thanks,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-02-28 4:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 9:47 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq Sven Eckelmann
2016-02-28 4:38 ` Marek Lindner [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=2465891.8WB3Uyx6em@voltaire \
--to=mareklindner@neomailbox.ch \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--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