From: Antonio Quartulli <antonio@meshcoding.com>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
Sven Eckelmann <sven@narfation.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/5] batctl: Fix crash when parsing unknown TVLVs
Date: Thu, 13 Nov 2014 10:46:44 +0100 [thread overview]
Message-ID: <54647E04.1070004@meshcoding.com> (raw)
In-Reply-To: <1415815109-17111-1-git-send-email-sven@narfation.org>
[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]
Hi,
On 12/11/14 18:58, Sven Eckelmann wrote:
> batctl tcpdump has an array with all known TVLVs and versions. The correct
> parser for the TVLV is chosen by getting the pointer from the address
> calculated by version and type. Unfortunately, the version and type was never
> validated to ensure that not an unknown TVLV (like mcast) was received.
>
> This missing validation makes it possible to crash batctl by injecting packets
> with an unknown type and/or version. batctl will try to get the parser, fetch a
> NULL pointer or random data and then try to dereferenced it. This is usually
> handled by the operating system with a segfault. But this might be exploitable
> in rare situations.
>
> An approach to handle this problem is by combining the simple selection step
> with the validation step. Only valid version+type will return a parser function
> pointer and the requesting function will only call the parser function pointer
> when it got one.
>
> This regression was introduced by 4c39fb823b86036df40187f8bd342fe5398c28ef
> ("batctl: tcpdump - parse TVLV containers").
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
For the whole series:
Acked-by: Antonio Quartulli <antonio@meshcoding.com>
Thank you very much for your work Sven!
@Marek: the offending patch is in next, therefore this patchset should
be merged there as well.
Cheers,
--
Antonio Quartulli
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-11-13 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 17:58 [B.A.T.M.A.N.] [PATCH 1/5] batctl: Fix crash when parsing unknown TVLVs Sven Eckelmann
2014-11-12 17:58 ` [B.A.T.M.A.N.] [PATCH 2/5] batctl: Parse only TVLV when header is available Sven Eckelmann
2014-11-16 5:25 ` Marek Lindner
2014-11-12 17:58 ` [B.A.T.M.A.N.] [PATCH 3/5] batctl: Only parse TVLV data when length is valid Sven Eckelmann
2014-11-16 5:26 ` Marek Lindner
2014-11-12 17:58 ` [B.A.T.M.A.N.] [PATCH 4/5] batctl: Parse non-variable TVLV only with correct length Sven Eckelmann
2014-11-16 5:27 ` Marek Lindner
2014-11-12 17:58 ` [B.A.T.M.A.N.] [PATCH 5/5] batctl: Only parse big enough TVLV TTv1 Sven Eckelmann
2014-11-16 5:28 ` Marek Lindner
2014-11-13 9:46 ` Antonio Quartulli [this message]
2014-11-16 5:24 ` [B.A.T.M.A.N.] [PATCH 1/5] batctl: Fix crash when parsing unknown TVLVs Marek Lindner
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=54647E04.1070004@meshcoding.com \
--to=antonio@meshcoding.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=mareklindner@neomailbox.ch \
--cc=sven@narfation.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