diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 20:03:01 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:27 -0500 |
commit | 0906e20fa03afdb14faf7fd166bfe4ed67c8db55 (patch) | |
tree | fba766aba261737ad8968552a3049bd50387531b /net | |
parent | d5c747f6efc03495635f129c8eb1dad0200ab183 (diff) |
[SCTP] bug: sctp_assoc_control_transport() breakage
a) struct sockaddr_storage * passed to sctp_ulpevent_make_peer_addr_change()
actually points at union sctp_addr field in a structure. Then that sucker
gets copied to userland, with whatever junk we might have there.
b) it's actually having host-endian sin_port.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/associola.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 7639044b0074..746b0b0f5ace 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -709,6 +709,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, | |||
709 | struct sctp_transport *first; | 709 | struct sctp_transport *first; |
710 | struct sctp_transport *second; | 710 | struct sctp_transport *second; |
711 | struct sctp_ulpevent *event; | 711 | struct sctp_ulpevent *event; |
712 | struct sockaddr_storage addr; | ||
712 | struct list_head *pos; | 713 | struct list_head *pos; |
713 | int spc_state = 0; | 714 | int spc_state = 0; |
714 | 715 | ||
@@ -731,8 +732,9 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, | |||
731 | /* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the | 732 | /* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the |
732 | * user. | 733 | * user. |
733 | */ | 734 | */ |
734 | event = sctp_ulpevent_make_peer_addr_change(asoc, | 735 | memset(&addr, 0, sizeof(struct sockaddr_storage)); |
735 | (struct sockaddr_storage *) &transport->ipaddr, | 736 | flip_to_n((union sctp_addr *)&addr, &transport->ipaddr); |
737 | event = sctp_ulpevent_make_peer_addr_change(asoc, &addr, | ||
736 | 0, spc_state, error, GFP_ATOMIC); | 738 | 0, spc_state, error, GFP_ATOMIC); |
737 | if (event) | 739 | if (event) |
738 | sctp_ulpq_tail_event(&asoc->ulpq, event); | 740 | sctp_ulpq_tail_event(&asoc->ulpq, event); |