All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven@narfation.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/5] batctl: Fix crash when parsing unknown TVLVs
Date: Sun, 16 Nov 2014 13:24:42 +0800	[thread overview]
Message-ID: <3747289.rgQC44iOAt@diderot> (raw)
In-Reply-To: <1415815109-17111-1-git-send-email-sven@narfation.org>

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

On Wednesday 12 November 2014 18:58:25 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>
> ---
>  tcpdump.c | 67
> ++++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file
> changed, 53 insertions(+), 14 deletions(-)

Applied in revision 140882b.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      parent reply	other threads:[~2014-11-16  5:24 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 ` [B.A.T.M.A.N.] [PATCH 1/5] batctl: Fix crash when parsing unknown TVLVs Antonio Quartulli
2014-11-16  5:24 ` 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=3747289.rgQC44iOAt@diderot \
    --to=mareklindner@neomailbox.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.