Skip to content
Snippets Groups Projects
Select Git revision
  • ecf938fe7d0088077ee1280419a2b3c5429b47c8
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

protocol.c

  • Xin Long's avatar
    ecf938fe
    sctp: set flow sport from saddr only when it's 0 · ecf938fe
    Xin Long authored
    
    Now sctp_transport_pmtu() passes transport->saddr into .get_dst() to set
    flow sport from 'saddr'. However, transport->saddr is set only when
    transport->dst exists in sctp_transport_route().
    
    If sctp_transport_pmtu() is called without transport->saddr set, like
    when transport->dst doesn't exists, the flow sport will be set to 0
    from transport->saddr, which will cause a wrong route to be got.
    
    Commit 6e91b578 ("sctp: re-use sctp_transport_pmtu in
    sctp_transport_route") made the issue be triggered more easily
    since sctp_transport_pmtu() would be called in sctp_transport_route()
    after that.
    
    In gerneral, fl4->fl4_sport should always be set to
    htons(asoc->base.bind_addr.port), unless transport->asoc doesn't exist
    in sctp_v4/6_get_dst(), which is the case:
    
      sctp_ootb_pkt_new() ->
        sctp_transport_route()
    
    For that, we can simply handle it by setting flow sport from saddr only
    when it's 0 in sctp_v4/6_get_dst().
    
    Fixes: 6e91b578 ("sctp: re-use sctp_transport_pmtu in sctp_transport_route")
    Reported-by: default avatarYing Xu <yinxu@redhat.com>
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ecf938fe
    History
    sctp: set flow sport from saddr only when it's 0
    Xin Long authored
    
    Now sctp_transport_pmtu() passes transport->saddr into .get_dst() to set
    flow sport from 'saddr'. However, transport->saddr is set only when
    transport->dst exists in sctp_transport_route().
    
    If sctp_transport_pmtu() is called without transport->saddr set, like
    when transport->dst doesn't exists, the flow sport will be set to 0
    from transport->saddr, which will cause a wrong route to be got.
    
    Commit 6e91b578 ("sctp: re-use sctp_transport_pmtu in
    sctp_transport_route") made the issue be triggered more easily
    since sctp_transport_pmtu() would be called in sctp_transport_route()
    after that.
    
    In gerneral, fl4->fl4_sport should always be set to
    htons(asoc->base.bind_addr.port), unless transport->asoc doesn't exist
    in sctp_v4/6_get_dst(), which is the case:
    
      sctp_ootb_pkt_new() ->
        sctp_transport_route()
    
    For that, we can simply handle it by setting flow sport from saddr only
    when it's 0 in sctp_v4/6_get_dst().
    
    Fixes: 6e91b578 ("sctp: re-use sctp_transport_pmtu in sctp_transport_route")
    Reported-by: default avatarYing Xu <yinxu@redhat.com>
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>