From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: Fix internal interface indices types
Date: Mon, 26 Feb 2018 17:40:49 +0100 [thread overview]
Message-ID: <1579093.AxJxHVZVZT@prime> (raw)
In-Reply-To: <20171226141401.13046-1-sven@narfation.org>
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]
On Tuesday, December 26, 2017 3:14:01 PM CET Sven Eckelmann wrote:
> batman-adv uses internal indices for each enabled and active interface.
> It is currently used by the B.A.T.M.A.N. IV algorithm to identifify the
> correct position in the ogm_cnt bitmaps.
>
> The type for the number of enabled interfaces (which defines the next
> interface index) was set to char. This type can be (depending on the
> architecture) either signed (limiting batman-adv to 127 active slave
> interfaces) or unsigned (limiting batman-adv to 255 active slave
> interfaces).
>
> This limit was not correctly checked when an interface was enabled and thus
> an overflow happened. This was only catched on systems with the signed char
> type when the B.A.T.M.A.N. IV code tried to resize its counter arrays with
> a negative size.
>
> The if_num interface index was only a s16 and therefore significantly
> smaller than the ifindex (int) used by the code net code.
>
> Both &batadv_hard_iface->if_num and &batadv_priv->num_ifaces must be
> (unsigned) int to support the same number of slave interfaces as the net
> core code. And the interface activation code must check the number of
> active slave interfaces to avoid integer overflows.
>
> Fixes: d1fbb61d0534 ("raw socket operations added: create / destroy / bind /
> send broadcast of own OGMs implemented orig interval configurable via
> /proc/net/batman-adv/orig_interval") Fixes: ea6f8d42a595 ("batman-adv: move
> /proc interface handling to /sys") Signed-off-by: Sven Eckelmann
> <sven@narfation.org>
Applied in d5db560d. As discussed, I've applied this into the master branch to
avoid merge conflicts, since we are about to release anyway.
Thank you!
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-02-26 16:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-26 14:14 [B.A.T.M.A.N.] [PATCH maint] batman-adv: Fix internal interface indices types Sven Eckelmann
2018-02-26 16:40 ` Simon Wunderlich [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=1579093.AxJxHVZVZT@prime \
--to=sw@simonwunderlich.de \
--cc=b.a.t.m.a.n@lists.open-mesh.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