qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Petr Matousek <pmatouse@redhat.com>, qemu-devel@nongnu.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-stable@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH v2] slirp: udp: fix NULL pointer dereference because of uninitialized socket
Date: Tue, 23 Sep 2014 10:25:23 -0500	[thread overview]
Message-ID: <20140923152523.16792.42459@loki> (raw)
In-Reply-To: <20140918063537.GX9321@dhcp-25-225.brq.redhat.com>

Quoting Petr Matousek (2014-09-18 01:35:37)
> When guest sends udp packet with source port and source addr 0,
> uninitialized socket is picked up when looking for matching and already
> created udp sockets, and later passed to sosendto() where NULL pointer
> dereference is hit during so->slirp->vnetwork_mask.s_addr access.
> 
> Fix this by checking that the socket is not just a socket stub.
> 
> This is CVE-2014-3640.
> 
> Signed-off-by: Petr Matousek <pmatouse@redhat.com>
> Reported-by: Xavier Mehrenberger <xavier.mehrenberger@airbus.com>
> Reported-by: Stephane Duverger <stephane.duverger@eads.net>

Ping. Looking to pull this in for 2.1.2. Release is "asap"

> ---
> v1 -> v2
>   * change the check so that it's consistent with the rest of the code
> 
>  slirp/udp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/slirp/udp.c b/slirp/udp.c
> index 8cc6cb6..f77e00f 100644
> --- a/slirp/udp.c
> +++ b/slirp/udp.c
> @@ -152,7 +152,7 @@ udp_input(register struct mbuf *m, int iphlen)
>          * Locate pcb for datagram.
>          */
>         so = slirp->udp_last_so;
> -       if (so->so_lport != uh->uh_sport ||
> +       if (so == &slirp->udb || so->so_lport != uh->uh_sport ||
>             so->so_laddr.s_addr != ip->ip_src.s_addr) {
>                 struct socket *tmp;
> 
> -- 
> 1.9.3

  parent reply	other threads:[~2014-09-23 15:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  6:35 [Qemu-devel] [PATCH v2] slirp: udp: fix NULL pointer dereference because of uninitialized socket Petr Matousek
2014-09-18  6:43 ` Jan Kiszka
2014-09-18  7:06 ` Michael S. Tsirkin
2014-09-23 15:25 ` Michael Roth [this message]
2014-09-23 16:50 ` Michael Tokarev
2014-09-24 10:40   ` Peter Maydell

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=20140923152523.16792.42459@loki \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=pmatouse@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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;
as well as URLs for NNTP newsgroup(s).