1. 25 9月, 2020 13 次提交
  2. 18 9月, 2020 2 次提交
  3. 15 9月, 2020 12 次提交
  4. 11 9月, 2020 3 次提交
    • G
      mptcp: fix kmalloc flag in mptcp_pm_nl_get_local_id · f612eb76
      Geliang Tang 提交于
      mptcp_pm_nl_get_local_id may be called in interrupt context, so we need to
      use GFP_ATOMIC flag to allocate memory to avoid sleeping in atomic context.
      
      [  280.209809] BUG: sleeping function called from invalid context at mm/slab.h:498
      [  280.209812] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1680, name: kworker/1:3
      [  280.209814] INFO: lockdep is turned off.
      [  280.209816] CPU: 1 PID: 1680 Comm: kworker/1:3 Tainted: G        W         5.9.0-rc3-mptcp+ #146
      [  280.209818] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      [  280.209820] Workqueue: events mptcp_worker
      [  280.209822] Call Trace:
      [  280.209824]  <IRQ>
      [  280.209826]  dump_stack+0x77/0xa0
      [  280.209829]  ___might_sleep.cold+0xa6/0xb6
      [  280.209832]  kmem_cache_alloc_trace+0x1d1/0x290
      [  280.209835]  mptcp_pm_nl_get_local_id+0x23c/0x410
      [  280.209840]  subflow_init_req+0x1e9/0x2ea
      [  280.209843]  ? inet_reqsk_alloc+0x1c/0x120
      [  280.209845]  ? kmem_cache_alloc+0x264/0x290
      [  280.209849]  tcp_conn_request+0x303/0xae0
      [  280.209854]  ? printk+0x53/0x6a
      [  280.209857]  ? tcp_rcv_state_process+0x28f/0x1374
      [  280.209859]  tcp_rcv_state_process+0x28f/0x1374
      [  280.209864]  ? tcp_v4_do_rcv+0xb3/0x1f0
      [  280.209866]  tcp_v4_do_rcv+0xb3/0x1f0
      [  280.209869]  tcp_v4_rcv+0xed6/0xfa0
      [  280.209873]  ip_protocol_deliver_rcu+0x28/0x270
      [  280.209875]  ip_local_deliver_finish+0x89/0x120
      [  280.209877]  ip_local_deliver+0x180/0x220
      [  280.209881]  ip_rcv+0x166/0x210
      [  280.209885]  __netif_receive_skb_one_core+0x82/0x90
      [  280.209888]  process_backlog+0xd6/0x230
      [  280.209891]  net_rx_action+0x13a/0x410
      [  280.209895]  __do_softirq+0xcf/0x468
      [  280.209899]  asm_call_on_stack+0x12/0x20
      [  280.209901]  </IRQ>
      [  280.209903]  ? ip_finish_output2+0x240/0x9a0
      [  280.209906]  do_softirq_own_stack+0x4d/0x60
      [  280.209908]  do_softirq.part.0+0x2b/0x60
      [  280.209911]  __local_bh_enable_ip+0x9a/0xa0
      [  280.209913]  ip_finish_output2+0x264/0x9a0
      [  280.209916]  ? rcu_read_lock_held+0x4d/0x60
      [  280.209920]  ? ip_output+0x7a/0x250
      [  280.209922]  ip_output+0x7a/0x250
      [  280.209925]  ? __ip_finish_output+0x330/0x330
      [  280.209928]  __ip_queue_xmit+0x1dc/0x5a0
      [  280.209931]  __tcp_transmit_skb+0xa0f/0xc70
      [  280.209937]  tcp_connect+0xb03/0xff0
      [  280.209939]  ? lockdep_hardirqs_on_prepare+0xe7/0x190
      [  280.209942]  ? ktime_get_with_offset+0x125/0x150
      [  280.209944]  ? trace_hardirqs_on+0x1c/0xe0
      [  280.209948]  tcp_v4_connect+0x449/0x550
      [  280.209953]  __inet_stream_connect+0xbb/0x320
      [  280.209955]  ? mark_held_locks+0x49/0x70
      [  280.209958]  ? lockdep_hardirqs_on_prepare+0xe7/0x190
      [  280.209960]  ? __local_bh_enable_ip+0x6b/0xa0
      [  280.209963]  inet_stream_connect+0x32/0x50
      [  280.209966]  __mptcp_subflow_connect+0x1fd/0x242
      [  280.209972]  mptcp_pm_create_subflow_or_signal_addr+0x2db/0x600
      [  280.209975]  mptcp_worker+0x543/0x7a0
      [  280.209980]  process_one_work+0x26d/0x5b0
      [  280.209984]  ? process_one_work+0x5b0/0x5b0
      [  280.209987]  worker_thread+0x48/0x3d0
      [  280.209990]  ? process_one_work+0x5b0/0x5b0
      [  280.209993]  kthread+0x117/0x150
      [  280.209996]  ? kthread_park+0x80/0x80
      [  280.209998]  ret_from_fork+0x22/0x30
      
      Fixes: 01cacb00 ("mptcp: add netlink-based PM")
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f612eb76
    • G
      mptcp: fix subflow's remote_id issues · 2ff0e566
      Geliang Tang 提交于
      This patch set the init remote_id to zero, otherwise it will be a random
      number.
      
      Then it added the missing subflow's remote_id setting code both in
      __mptcp_subflow_connect and in subflow_ulp_clone.
      
      Fixes: 01cacb00 ("mptcp: add netlink-based PM")
      Fixes: ec3edaa7 ("mptcp: Add handling of outgoing MP_JOIN requests")
      Fixes: f296234c ("mptcp: Add handling of incoming MP_JOIN requests")
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ff0e566
    • G
      mptcp: fix subflow's local_id issues · 57025817
      Geliang Tang 提交于
      In mptcp_pm_nl_get_local_id, skc_local is the same as msk_local, so it
      always return 0. Thus every subflow's local_id is 0. It's incorrect.
      
      This patch fixed this issue.
      
      Also, we need to ignore the zero address here, like 0.0.0.0 in IPv4. When
      we use the zero address as a local address, it means that we can use any
      one of the local addresses. The zero address is not a new address, we don't
      need to add it to PM, so this patch added a new function address_zero to
      check whether an address is the zero address, if it is, we ignore this
      address.
      
      Fixes: 01cacb00 ("mptcp: add netlink-based PM")
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57025817
  5. 01 9月, 2020 1 次提交
  6. 27 8月, 2020 1 次提交
  7. 24 8月, 2020 1 次提交
  8. 19 8月, 2020 1 次提交
  9. 17 8月, 2020 1 次提交
  10. 15 8月, 2020 1 次提交
  11. 08 8月, 2020 1 次提交
  12. 06 8月, 2020 1 次提交
    • P
      mptcp: be careful on subflow creation · adf73410
      Paolo Abeni 提交于
      Nicolas reported the following oops:
      
      [ 1521.392541] BUG: kernel NULL pointer dereference, address: 00000000000000c0
      [ 1521.394189] #PF: supervisor read access in kernel mode
      [ 1521.395376] #PF: error_code(0x0000) - not-present page
      [ 1521.396607] PGD 0 P4D 0
      [ 1521.397156] Oops: 0000 [#1] SMP PTI
      [ 1521.398020] CPU: 0 PID: 22986 Comm: kworker/0:2 Not tainted 5.8.0-rc4+ #109
      [ 1521.399618] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      [ 1521.401728] Workqueue: events mptcp_worker
      [ 1521.402651] RIP: 0010:mptcp_subflow_create_socket+0xf1/0x1c0
      [ 1521.403954] Code: 24 08 89 44 24 04 48 8b 7a 18 e8 2a 48 d4 ff 8b 44 24 04 85 c0 75 7a 48 8b 8b 78 02 00 00 48 8b 54 24 08 48 8d bb 80 00 00 00 <48> 8b 89 c0 00 00 00 48 89 8a c0 00 00 00 48 8b 8b 78 02 00 00 8b
      [ 1521.408201] RSP: 0000:ffffabc4002d3c60 EFLAGS: 00010246
      [ 1521.409433] RAX: 0000000000000000 RBX: ffffa0b9ad8c9a00 RCX: 0000000000000000
      [ 1521.411096] RDX: ffffa0b9ae78a300 RSI: 00000000fffffe01 RDI: ffffa0b9ad8c9a80
      [ 1521.412734] RBP: ffffa0b9adff2e80 R08: ffffa0b9af02d640 R09: ffffa0b9ad923a00
      [ 1521.414333] R10: ffffabc4007139f8 R11: fefefefefefefeff R12: ffffabc4002d3cb0
      [ 1521.415918] R13: ffffa0b9ad91fa58 R14: ffffa0b9ad8c9f9c R15: 0000000000000000
      [ 1521.417592] FS:  0000000000000000(0000) GS:ffffa0b9af000000(0000) knlGS:0000000000000000
      [ 1521.419490] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1521.420839] CR2: 00000000000000c0 CR3: 000000002951e006 CR4: 0000000000160ef0
      [ 1521.422511] Call Trace:
      [ 1521.423103]  __mptcp_subflow_connect+0x94/0x1f0
      [ 1521.425376]  mptcp_pm_create_subflow_or_signal_addr+0x200/0x2a0
      [ 1521.426736]  mptcp_worker+0x31b/0x390
      [ 1521.431324]  process_one_work+0x1fc/0x3f0
      [ 1521.432268]  worker_thread+0x2d/0x3b0
      [ 1521.434197]  kthread+0x117/0x130
      [ 1521.435783]  ret_from_fork+0x22/0x30
      
      on some unconventional configuration.
      
      The MPTCP protocol is trying to create a subflow for an
      unaccepted server socket. That is allowed by the RFC, even
      if subflow creation will likely fail.
      Unaccepted sockets have still a NULL sk_socket field,
      avoid the issue by failing earlier.
      Reported-and-tested-by: NNicolas Rybowski <nicolas.rybowski@tessares.net>
      Fixes: 7d14b0d2 ("mptcp: set correct vfs info for subflows")
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      adf73410
  13. 04 8月, 2020 2 次提交