)]}'
{
  "commit": "032be5f19a94de51093851757089133dcc1e92aa",
  "tree": "14791d09ca7ec49e7b597d9facdbc5a0a407be5b",
  "parents": [
    "4b9fc7146249a6e0e3175d0acc033fdcd2bfcb17"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "edumazet@google.com",
    "time": "Wed Apr 24 09:44:11 2019 -0700"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Wed Apr 24 14:05:09 2019 -0700"
  },
  "message": "rxrpc: fix race condition in rxrpc_input_packet()\n\nAfter commit 5271953cad31 (\"rxrpc: Use the UDP encap_rcv hook\"),\nrxrpc_input_packet() is directly called from lockless UDP receive\npath, under rcu_read_lock() protection.\n\nIt must therefore use RCU rules :\n\n- udp_sk-\u003esk_user_data can be cleared at any point in this function.\n  rcu_dereference_sk_user_data() is what we need here.\n\n- Also, since sk_user_data might have been set in rxrpc_open_socket()\n  we must observe a proper RCU grace period before kfree(local) in\n  rxrpc_lookup_local()\n\nv4: @local can be NULL in xrpc_lookup_local() as reported by kbuild test robot \u003clkp@intel.com\u003e\n        and Julia Lawall \u003cjulia.lawall@lip6.fr\u003e, thanks !\n\nv3,v2 : addressed David Howells feedback, thanks !\n\nsyzbot reported :\n\nkasan: CONFIG_KASAN_INLINE enabled\nkasan: GPF could be caused by NULL-ptr deref or user memory access\ngeneral protection fault: 0000 [#1] PREEMPT SMP KASAN\nCPU: 0 PID: 19236 Comm: syz-executor703 Not tainted 5.1.0-rc6 #79\nHardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011\nRIP: 0010:__lock_acquire+0xbef/0x3fb0 kernel/locking/lockdep.c:3573\nCode: 00 0f 85 a5 1f 00 00 48 81 c4 10 01 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 \u003c80\u003e 3c 02 00 0f 85 4a 21 00 00 49 81 7d 00 20 54 9c 89 0f 84 cf f4\nRSP: 0018:ffff88809d7aef58 EFLAGS: 00010002\nRAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000\nRDX: 0000000000000026 RSI: 0000000000000000 RDI: 0000000000000001\nRBP: ffff88809d7af090 R08: 0000000000000001 R09: 0000000000000001\nR10: ffffed1015d05bc7 R11: ffff888089428600 R12: 0000000000000000\nR13: 0000000000000130 R14: 0000000000000001 R15: 0000000000000001\nFS:  00007f059044d700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000\nCS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nCR2: 00000000004b6040 CR3: 00000000955ca000 CR4: 00000000001406f0\nCall Trace:\n lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211\n __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]\n _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152\n skb_queue_tail+0x26/0x150 net/core/skbuff.c:2972\n rxrpc_reject_packet net/rxrpc/input.c:1126 [inline]\n rxrpc_input_packet+0x4a0/0x5536 net/rxrpc/input.c:1414\n udp_queue_rcv_one_skb+0xaf2/0x1780 net/ipv4/udp.c:2011\n udp_queue_rcv_skb+0x128/0x730 net/ipv4/udp.c:2085\n udp_unicast_rcv_skb.isra.0+0xb9/0x360 net/ipv4/udp.c:2245\n __udp4_lib_rcv+0x701/0x2ca0 net/ipv4/udp.c:2301\n udp_rcv+0x22/0x30 net/ipv4/udp.c:2482\n ip_protocol_deliver_rcu+0x60/0x8f0 net/ipv4/ip_input.c:208\n ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:234\n NF_HOOK include/linux/netfilter.h:289 [inline]\n NF_HOOK include/linux/netfilter.h:283 [inline]\n ip_local_deliver+0x1e9/0x520 net/ipv4/ip_input.c:255\n dst_input include/net/dst.h:450 [inline]\n ip_rcv_finish+0x1e1/0x300 net/ipv4/ip_input.c:413\n NF_HOOK include/linux/netfilter.h:289 [inline]\n NF_HOOK include/linux/netfilter.h:283 [inline]\n ip_rcv+0xe8/0x3f0 net/ipv4/ip_input.c:523\n __netif_receive_skb_one_core+0x115/0x1a0 net/core/dev.c:4987\n __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5099\n netif_receive_skb_internal+0x117/0x660 net/core/dev.c:5202\n napi_frags_finish net/core/dev.c:5769 [inline]\n napi_gro_frags+0xade/0xd10 net/core/dev.c:5843\n tun_get_user+0x2f24/0x3fb0 drivers/net/tun.c:1981\n tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2027\n call_write_iter include/linux/fs.h:1866 [inline]\n do_iter_readv_writev+0x5e1/0x8e0 fs/read_write.c:681\n do_iter_write fs/read_write.c:957 [inline]\n do_iter_write+0x184/0x610 fs/read_write.c:938\n vfs_writev+0x1b3/0x2f0 fs/read_write.c:1002\n do_writev+0x15e/0x370 fs/read_write.c:1037\n __do_sys_writev fs/read_write.c:1110 [inline]\n __se_sys_writev fs/read_write.c:1107 [inline]\n __x64_sys_writev+0x75/0xb0 fs/read_write.c:1107\n do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290\n entry_SYSCALL_64_after_hwframe+0x49/0xbe\n\nFixes: 5271953cad31 (\"rxrpc: Use the UDP encap_rcv hook\")\nSigned-off-by: Eric Dumazet \u003cedumazet@google.com\u003e\nReported-by: syzbot \u003csyzkaller@googlegroups.com\u003e\nAcked-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4c6f9d0a00e79e1874f6ff6ceb6632a42c5072ff",
      "old_mode": 33188,
      "old_path": "net/rxrpc/input.c",
      "new_id": "c2c35cf4e3089038bcc73663f0a0d3ccf24b9743",
      "new_mode": 33188,
      "new_path": "net/rxrpc/input.c"
    },
    {
      "type": "modify",
      "old_id": "15cf42d5b53a56d8d19cabdc8c2b55156d73d28a",
      "old_mode": 33188,
      "old_path": "net/rxrpc/local_object.c",
      "new_id": "01959db51445ca00e6044d8a849e698c4ab17a33",
      "new_mode": 33188,
      "new_path": "net/rxrpc/local_object.c"
    }
  ]
}
