All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: linux-sctp@vger.kernel.org
Subject: Re: SCTP ASCONF Set Primary Address Parameter Type bug
Date: Wed, 28 Jan 2015 18:02:19 +0000	[thread overview]
Message-ID: <54C9242B.2090404@redhat.com> (raw)
In-Reply-To: <4BC5337E23A5EE4A96D91D9DABA8FAE561E6B67FBD@WP40068.corp.ads>

Hi Saran,

On 01/28/2015 05:45 PM, Saran Maruti Ramanara wrote:
...
> While investigating CVE-2014-7841 patched by e40607cbe270, I noticed that in sctp_process_param() in the switch-case where param.p->type = SCTP_PARAM_SET_PRIMARY (0xC004), the argument to param_type2af() is param.p->type, which is always 0xC004 in this case, and not addr_param's type. This causes af to always be NULL, i.e. even when IPv4 or IPv6 Address sub-parameters are received.
>
> The following patch--untested for functionality, compiles against c59c961ca511--gets the right Address Parameter type through to param_type2af().
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index e49e231..06320c8 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2608,7 +2608,7 @@ do_addr_param:
>
>          addr_param = param.v + sizeof(sctp_addip_param_t);
>
> -       af = sctp_get_af_specific(param_type2af(param.p->type));
> +       af = sctp_get_af_specific(param_type2af(addr_param->p.type));

Good catch, can you send an official patch to netdev?

Thanks,
Daniel

>          if (af = NULL)
>              break;
>
> --
> Regards,
> Saran Neti, TELUS Security Labs
>

      reply	other threads:[~2015-01-28 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 16:45 SCTP ASCONF Set Primary Address Parameter Type bug Saran Maruti Ramanara
2015-01-28 18:02 ` Daniel Borkmann [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=54C9242B.2090404@redhat.com \
    --to=dborkman@redhat.com \
    --cc=linux-sctp@vger.kernel.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.