1. 20 6月, 2017 1 次提交
  2. 30 9月, 2016 1 次提交
    • X
      sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock · 1cceda78
      Xin Long 提交于
      When sctp dumps all the ep->assocs, it needs to lock_sock first,
      but now it locks sock in rcu_read_lock, and lock_sock may sleep,
      which would break rcu_read_lock.
      
      This patch is to get and hold one sock when traversing the list.
      After that and get out of rcu_read_lock, lock and dump it. Then
      it will traverse the list again to get the next one until all
      sctp socks are dumped.
      
      For sctp_diag_dump_one, it fixes this issue by holding asoc and
      moving cb() out of rcu_read_lock in sctp_transport_lookup_process.
      
      Fixes: 8f840e47 ("sctp: add the sctp_diag.c file")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cceda78
  3. 09 9月, 2016 1 次提交
  4. 24 8月, 2016 1 次提交
  5. 09 8月, 2016 2 次提交
  6. 11 6月, 2016 1 次提交
    • B
      net: diag: add missing declarations · c3ec5e5c
      Ben Dooks 提交于
      The functions inet_diag_msg_common_fill and inet_diag_msg_attrs_fill
      seem to have been missed from the include/linux/inet_diag.h header
      file. Add them to fix the following warnings:
      
      net/ipv4/inet_diag.c:69:6: warning: symbol 'inet_diag_msg_common_fill' was not declared. Should it be static?
      net/ipv4/inet_diag.c:108:5: warning: symbol 'inet_diag_msg_attrs_fill' was not declared. Should it be static?
      Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c3ec5e5c
  7. 26 5月, 2016 1 次提交
    • X
      sctp: fix double EPs display in sctp_diag · bed187b5
      Xin Long 提交于
      We have this situation: that EP hash table, contains only the EPs
      that are listening, while the transports one, has the opposite.
      We have to traverse both to dump all.
      
      But when we traverse the transports one we will also get EPs that are
      in the EP hash if they are listening. In this case, the EP is dumped
      twice.
      
      We will fix it by checking if the endpoint that is in the endpoint
      hash table contains any ep->asoc in there, as it means we will also
      find it via transport hash, and thus we can/should skip it, depending
      on the filters used, like 'ss -l'.
      
      Still, we should NOT skip it if the user is listing only listening
      endpoints, because then we are not traversing the transport hash.
      so we have to check idiag_states there also.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bed187b5
  8. 27 4月, 2016 2 次提交
  9. 22 4月, 2016 1 次提交
  10. 16 4月, 2016 1 次提交
    • X
      sctp: add the sctp_diag.c file · 8f840e47
      Xin Long 提交于
      This one will implement all the interface of inet_diag, inet_diag_handler.
      which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info.
      
      It will work as a module, and register inet_diag_handler when loading.
      
      v2->v3:
      - fix the mistake in inet_assoc_attr_size().
      
      - change inet_diag_msg_laddrs_fill() name to inet_diag_msg_sctpladdrs_fill.
      
      - change inet_diag_msg_paddrs_fill() name to inet_diag_msg_sctpaddrs_fill.
      
      - add inet_diag_msg_sctpinfo_fill() to make asoc/ep fill code clearer.
      
      - add inet_diag_msg_sctpasoc_fill() to make asoc fill code clearer.
      
      - merge inet_asoc_diag_fill() and inet_ep_diag_fill() to
        inet_sctp_diag_fill().
      
      - call sctp_diag_get_info() directly, instead by handler, cause the caller
        is in the same file with it.
      
      - call lock_sock in sctp_tsp_dump_one() to make sure we call get sctp info
        safely.
      
      - after lock_sock(sk), we should check sk != assoc->base.sk.
      
      - change mem[SK_MEMINFO_WMEM_ALLOC] to asoc->sndbuf_used for asoc dump when
        asoc->ep->sndbuf_policy is set. don't use INET_DIAG_MEMINFO attr any more.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f840e47