netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
@ 2015-01-29 10:05 Daniel Borkmann
  2015-01-29 13:27 ` Vlad Yasevich
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Borkmann @ 2015-01-29 10:05 UTC (permalink / raw)
  To: davem; +Cc: vyasevich, netdev, linux-sctp, Saran Maruti Ramanara

From: Saran Maruti Ramanara <saran.neti@telus.com>

When making use of RFC5061, section 4.2.4. for setting the primary IP
address, we're passing a wrong parameter header to param_type2af(),
resulting always in NULL being returned.

At this point, param.p points to a sctp_addip_param struct, containing
a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation
id. Followed by that, as also presented in RFC5061 section 4.2.4., comes
the actual sctp_addr_param, which also contains a sctp_paramhdr, but
this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that
param_type2af() can make use of. Since we already hold a pointer to
addr_param from previous line, just reuse it for param_type2af().

Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
 net/sctp/sm_make_chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
 		if (af == NULL)
 			break;
 
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
  2015-01-29 10:05 [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Daniel Borkmann
@ 2015-01-29 13:27 ` Vlad Yasevich
  2015-01-29 14:43 ` Neil Horman
  2015-01-31  1:45 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vlad Yasevich @ 2015-01-29 13:27 UTC (permalink / raw)
  To: Daniel Borkmann, davem; +Cc: netdev, linux-sctp, Saran Maruti Ramanara

On 01/29/2015 05:05 AM, Daniel Borkmann wrote:
> From: Saran Maruti Ramanara <saran.neti@telus.com>
> 
> When making use of RFC5061, section 4.2.4. for setting the primary IP
> address, we're passing a wrong parameter header to param_type2af(),
> resulting always in NULL being returned.
> 
> At this point, param.p points to a sctp_addip_param struct, containing
> a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation
> id. Followed by that, as also presented in RFC5061 section 4.2.4., comes
> the actual sctp_addr_param, which also contains a sctp_paramhdr, but
> this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that
> param_type2af() can make use of. Since we already hold a pointer to
> addr_param from previous line, just reuse it for param_type2af().
> 
> Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
> Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Acked-by: Vlad Yasevich <vyasevich@gmail.com>

Thanks
-vlad

> ---
>  net/sctp/sm_make_chunk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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));
>  		if (af == NULL)
>  			break;
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
  2015-01-29 10:05 [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Daniel Borkmann
  2015-01-29 13:27 ` Vlad Yasevich
@ 2015-01-29 14:43 ` Neil Horman
  2015-01-31  1:45 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Neil Horman @ 2015-01-29 14:43 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: davem, vyasevich, netdev, linux-sctp, Saran Maruti Ramanara

On Thu, Jan 29, 2015 at 11:05:58AM +0100, Daniel Borkmann wrote:
> From: Saran Maruti Ramanara <saran.neti@telus.com>
> 
> When making use of RFC5061, section 4.2.4. for setting the primary IP
> address, we're passing a wrong parameter header to param_type2af(),
> resulting always in NULL being returned.
> 
> At this point, param.p points to a sctp_addip_param struct, containing
> a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation
> id. Followed by that, as also presented in RFC5061 section 4.2.4., comes
> the actual sctp_addr_param, which also contains a sctp_paramhdr, but
> this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that
> param_type2af() can make use of. Since we already hold a pointer to
> addr_param from previous line, just reuse it for param_type2af().
> 
> Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
> Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> ---
>  net/sctp/sm_make_chunk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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));
>  		if (af == NULL)
>  			break;
>  
> -- 
> 1.7.11.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
  2015-01-29 10:05 [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Daniel Borkmann
  2015-01-29 13:27 ` Vlad Yasevich
  2015-01-29 14:43 ` Neil Horman
@ 2015-01-31  1:45 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-01-31  1:45 UTC (permalink / raw)
  To: dborkman; +Cc: vyasevich, netdev, linux-sctp, saran.neti

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 29 Jan 2015 11:05:58 +0100

> From: Saran Maruti Ramanara <saran.neti@telus.com>
> 
> When making use of RFC5061, section 4.2.4. for setting the primary IP
> address, we're passing a wrong parameter header to param_type2af(),
> resulting always in NULL being returned.
> 
> At this point, param.p points to a sctp_addip_param struct, containing
> a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation
> id. Followed by that, as also presented in RFC5061 section 4.2.4., comes
> the actual sctp_addr_param, which also contains a sctp_paramhdr, but
> this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that
> param_type2af() can make use of. Since we already hold a pointer to
> addr_param from previous line, just reuse it for param_type2af().
> 
> Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
> Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-31  1:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29 10:05 [PATCH net] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Daniel Borkmann
2015-01-29 13:27 ` Vlad Yasevich
2015-01-29 14:43 ` Neil Horman
2015-01-31  1:45 ` David Miller

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).