bisecting cause commit starting from b2768df24ec400dd4f7fa79542f797e904812053 building syzkaller on 99b258ddc33e296f07588a15397ae426c6ed236c testing commit b2768df24ec400dd4f7fa79542f797e904812053 with gcc (GCC) 8.1.0 kernel signature: b6d7639613d16c1d1dba4769dcf17c5c71cd7e710a22c5f5940475c179fcb3f7 all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker testing release v5.6 testing commit 7111951b8d4973bda27ff663f2cf18b663d15b48 with gcc (GCC) 8.1.0 kernel signature: 01fe55b6e2ba0aab4fc3d59ce75d4444959d30d545d0ce9eef8e2357e2af09c0 all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker testing release v5.5 testing commit d5226fa6dbae0569ee43ecfc08bdcd6770fc4755 with gcc (GCC) 8.1.0 kernel signature: 4d9eaaf3b3d7b1111c05a53ec09aa756a2d04a16e61ef585999b521794743631 all runs: OK # git bisect start 7111951b8d4973bda27ff663f2cf18b663d15b48 d5226fa6dbae0569ee43ecfc08bdcd6770fc4755 Bisecting: 6113 revisions left to test after this (roughly 13 steps) [9f68e3655aae6d49d6ba05dd263f99f33c2567af] Merge tag 'drm-next-2020-01-30' of git://anongit.freedesktop.org/drm/drm testing commit 9f68e3655aae6d49d6ba05dd263f99f33c2567af with gcc (GCC) 8.1.0 kernel signature: 098ad1c746682da1b4b091f42185f35a6fc914270dd5a9dc9493f33b51a2a6da run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in netlink_sendmsg run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor007139604" "root@10.128.15.200:./syz-executor007139604"]: exit status 1 ssh: connect to host 10.128.15.200 port 22: Connection timed out lost connection # git bisect bad 9f68e3655aae6d49d6ba05dd263f99f33c2567af Bisecting: 3686 revisions left to test after this (roughly 12 steps) [fb95aae6e67c4e319a24b3eea32032d4246a5335] Merge tag 'sound-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound testing commit fb95aae6e67c4e319a24b3eea32032d4246a5335 with gcc (GCC) 8.1.0 kernel signature: 86cd24f7df5fb9ffdc238e0386abc00a9862010ed1a9d75291801873017ea2b1 run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in netlink_sendmsg run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor147074918" "root@10.128.1.10:./syz-executor147074918"]: exit status 1 ssh: connect to host 10.128.1.10 port 22: Connection timed out lost connection # git bisect bad fb95aae6e67c4e319a24b3eea32032d4246a5335 Bisecting: 2267 revisions left to test after this (roughly 11 steps) [f76e4c167ea2212e23c15ee7e601a865e822c291] net: phy: add default ARCH_BCM_IPROC for MDIO_BCM_IPROC testing commit f76e4c167ea2212e23c15ee7e601a865e822c291 with gcc (GCC) 8.1.0 kernel signature: 1db22d7d21b2675930ae4f0bec856d4d4078a31f4169a66d142ec58671830d31 all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad f76e4c167ea2212e23c15ee7e601a865e822c291 Bisecting: 810 revisions left to test after this (roughly 10 steps) [f41aa387a7896c193b384c5fb531cd2cb9e00128] Merge branch 'selftest-makefile-cleanup' testing commit f41aa387a7896c193b384c5fb531cd2cb9e00128 with gcc (GCC) 8.1.0 kernel signature: e3c575068bacf229afc3cd01890061df907702fe6d2229b7c1ff25508b7308b2 run #0: crashed: INFO: rcu detected stall in netlink_sendmsg run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in netlink_sendmsg run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad f41aa387a7896c193b384c5fb531cd2cb9e00128 Bisecting: 404 revisions left to test after this (roughly 9 steps) [9f6cff995e98258b6b81cc864532f633e5b3a081] Merge branch 'Simplify-IPv6-route-offload-API' testing commit 9f6cff995e98258b6b81cc864532f633e5b3a081 with gcc (GCC) 8.1.0 kernel signature: b1db86ec132b8d5ed135f8da0a77ab4c01780ee9067568ad91942d280f16ef4a run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in netlink_sendmsg run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad 9f6cff995e98258b6b81cc864532f633e5b3a081 Bisecting: 202 revisions left to test after this (roughly 8 steps) [206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7] net: bcmgenet: Utilize bcmgenet_set_features() during resume/open testing commit 206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7 with gcc (GCC) 8.1.0 kernel signature: 3dd5dd1f780059f668fab75479c69a421428eb4cd2cb67555de6fd1c7f56a424 run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in netlink_sendmsg run #3: crashed: INFO: rcu detected stall in netlink_sendmsg run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad 206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7 Bisecting: 101 revisions left to test after this (roughly 7 steps) [a8674f753e36f566d6c1d992ab85323d784281d9] ipv4: Notify newly added route if should be offloaded testing commit a8674f753e36f566d6c1d992ab85323d784281d9 with gcc (GCC) 8.1.0 kernel signature: 86be3836eecdede3346f88ae25ce98edae01dba0637a96bb070d3d2e931ea046 run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in netlink_sendmsg run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_handshake_receive_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor528052587" "root@10.128.0.21:./syz-executor528052587"]: exit status 1 ssh: connect to host 10.128.0.21 port 22: Connection timed out lost connection run #8: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor113589198" "root@10.128.15.200:./syz-executor113589198"]: exit status 1 ssh: connect to host 10.128.15.200 port 22: Connection timed out lost connection run #9: OK # git bisect bad a8674f753e36f566d6c1d992ab85323d784281d9 Bisecting: 49 revisions left to test after this (roughly 6 steps) [bea0f4a5115aaf6f59c6d2125f52ff149874b6d2] Merge branch 'sfp-slow-to-probe-copper' testing commit bea0f4a5115aaf6f59c6d2125f52ff149874b6d2 with gcc (GCC) 8.1.0 kernel signature: 69aad9a5142cea589c34d8fdf3ce2819b82f0a17cff53a8fb2bb82f5cefa46ec all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad bea0f4a5115aaf6f59c6d2125f52ff149874b6d2 Bisecting: 24 revisions left to test after this (roughly 5 steps) [bb9d8454bb0fed028558d1e66b12d50db5e43e06] Merge branch 'tipc-introduce-variable-window-congestion-control' testing commit bb9d8454bb0fed028558d1e66b12d50db5e43e06 with gcc (GCC) 8.1.0 kernel signature: fdf454fe1dbd4913770f4101ce2240648f68e626fabf73054d18df57061df7f0 run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor537181647" "root@10.128.10.44:./syz-executor537181647"]: exit status 1 ssh: connect to host 10.128.10.44 port 22: Connection timed out lost connection # git bisect bad bb9d8454bb0fed028558d1e66b12d50db5e43e06 Bisecting: 12 revisions left to test after this (roughly 4 steps) [e70ac628289766bc2c81a0db161368b69da774fd] qed: remove redundant assignments to rc testing commit e70ac628289766bc2c81a0db161368b69da774fd with gcc (GCC) 8.1.0 kernel signature: a47e2401a711f6494b0c960d44af583580efd71b5c6d7ba19260bdbd6198a918 run #0: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #1: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #2: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #3: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #4: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #5: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #6: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #7: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #8: crashed: INFO: rcu detected stall in wg_packet_tx_worker run #9: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/tmp/syz-executor723282649" "root@10.128.15.201:./syz-executor723282649"]: exit status 1 ssh: connect to host 10.128.15.201 port 22: Connection timed out lost connection # git bisect bad e70ac628289766bc2c81a0db161368b69da774fd Bisecting: 6 revisions left to test after this (roughly 3 steps) [3cd9d35ee5f7a23203443f1a0d3c344f034c0dc7] dt-bindings: net: bluetooth: Minor fix in broadcom-bluetooth testing commit 3cd9d35ee5f7a23203443f1a0d3c344f034c0dc7 with gcc (GCC) 8.1.0 kernel signature: edd24c8730e7ae1fc0770fcc46a8a33a769189358ed42443a7098416ca97b783 all runs: OK # git bisect good 3cd9d35ee5f7a23203443f1a0d3c344f034c0dc7 Bisecting: 3 revisions left to test after this (roughly 2 steps) [7ecacafc240638148567742cca41aa7144b4fe1e] Bluetooth: btusb: Disable runtime suspend on Realtek devices testing commit 7ecacafc240638148567742cca41aa7144b4fe1e with gcc (GCC) 8.1.0 kernel signature: cabb1eb2907276159f2875e02122bce593d7290d2c1b6b5355b931ad98f517e1 all runs: OK # git bisect good 7ecacafc240638148567742cca41aa7144b4fe1e Bisecting: 1 revision left to test after this (roughly 1 step) [4a63ef710cc3e79ce58b46b122118e415a44b3db] Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next testing commit 4a63ef710cc3e79ce58b46b122118e415a44b3db with gcc (GCC) 8.1.0 kernel signature: 991ebabcb661264aae6d7840d3617b66f0155cd655a591a59e500b6ce5383916 all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad 4a63ef710cc3e79ce58b46b122118e415a44b3db Bisecting: 0 revisions left to test after this (roughly 0 steps) [e7096c131e5161fa3b8e52a650d7719d2857adfd] net: WireGuard secure network tunnel testing commit e7096c131e5161fa3b8e52a650d7719d2857adfd with gcc (GCC) 8.1.0 kernel signature: 28a1bd06f20e47135d19ee46292f647cb980814f3bdac41f18b2c4b473c1254a all runs: crashed: INFO: rcu detected stall in wg_packet_tx_worker # git bisect bad e7096c131e5161fa3b8e52a650d7719d2857adfd e7096c131e5161fa3b8e52a650d7719d2857adfd is the first bad commit commit e7096c131e5161fa3b8e52a650d7719d2857adfd Author: Jason A. Donenfeld Date: Mon Dec 9 00:27:34 2019 +0100 net: WireGuard secure network tunnel WireGuard is a layer 3 secure networking tunnel made specifically for the kernel, that aims to be much simpler and easier to audit than IPsec. Extensive documentation and description of the protocol and considerations, along with formal proofs of the cryptography, are available at: * https://www.wireguard.com/ * https://www.wireguard.com/papers/wireguard.pdf This commit implements WireGuard as a simple network device driver, accessible in the usual RTNL way used by virtual network drivers. It makes use of the udp_tunnel APIs, GRO, GSO, NAPI, and the usual set of networking subsystem APIs. It has a somewhat novel multicore queueing system designed for maximum throughput and minimal latency of encryption operations, but it is implemented modestly using workqueues and NAPI. Configuration is done via generic Netlink, and following a review from the Netlink maintainer a year ago, several high profile userspace tools have already implemented the API. This commit also comes with several different tests, both in-kernel tests and out-of-kernel tests based on network namespaces, taking profit of the fact that sockets used by WireGuard intentionally stay in the namespace the WireGuard interface was originally created, exactly like the semantics of userspace tun devices. See wireguard.com/netns/ for pictures and examples. The source code is fairly short, but rather than combining everything into a single file, WireGuard is developed as cleanly separable files, making auditing and comprehension easier. Things are laid out as follows: * noise.[ch], cookie.[ch], messages.h: These implement the bulk of the cryptographic aspects of the protocol, and are mostly data-only in nature, taking in buffers of bytes and spitting out buffers of bytes. They also handle reference counting for their various shared pieces of data, like keys and key lists. * ratelimiter.[ch]: Used as an integral part of cookie.[ch] for ratelimiting certain types of cryptographic operations in accordance with particular WireGuard semantics. * allowedips.[ch], peerlookup.[ch]: The main lookup structures of WireGuard, the former being trie-like with particular semantics, an integral part of the design of the protocol, and the latter just being nice helper functions around the various hashtables we use. * device.[ch]: Implementation of functions for the netdevice and for rtnl, responsible for maintaining the life of a given interface and wiring it up to the rest of WireGuard. * peer.[ch]: Each interface has a list of peers, with helper functions available here for creation, destruction, and reference counting. * socket.[ch]: Implementation of functions related to udp_socket and the general set of kernel socket APIs, for sending and receiving ciphertext UDP packets, and taking care of WireGuard-specific sticky socket routing semantics for the automatic roaming. * netlink.[ch]: Userspace API entry point for configuring WireGuard peers and devices. The API has been implemented by several userspace tools and network management utility, and the WireGuard project distributes the basic wg(8) tool. * queueing.[ch]: Shared function on the rx and tx path for handling the various queues used in the multicore algorithms. * send.c: Handles encrypting outgoing packets in parallel on multiple cores, before sending them in order on a single core, via workqueues and ring buffers. Also handles sending handshake and cookie messages as part of the protocol, in parallel. * receive.c: Handles decrypting incoming packets in parallel on multiple cores, before passing them off in order to be ingested via the rest of the networking subsystem with GRO via the typical NAPI poll function. Also handles receiving handshake and cookie messages as part of the protocol, in parallel. * timers.[ch]: Uses the timer wheel to implement protocol particular event timeouts, and gives a set of very simple event-driven entry point functions for callers. * main.c, version.h: Initialization and deinitialization of the module. * selftest/*.h: Runtime unit tests for some of the most security sensitive functions. * tools/testing/selftests/wireguard/netns.sh: Aforementioned testing script using network namespaces. This commit aims to be as self-contained as possible, implementing WireGuard as a standalone module not needing much special handling or coordination from the network subsystem. I expect for future optimizations to the network stack to positively improve WireGuard, and vice-versa, but for the time being, this exists as intentionally standalone. We introduce a menu option for CONFIG_WIREGUARD, as well as providing a verbose debug log and self-tests via CONFIG_WIREGUARD_DEBUG. Signed-off-by: Jason A. Donenfeld Cc: David Miller Cc: Greg KH Cc: Linus Torvalds Cc: Herbert Xu Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller MAINTAINERS | 8 + drivers/net/Kconfig | 41 ++ drivers/net/Makefile | 1 + drivers/net/wireguard/Makefile | 18 + drivers/net/wireguard/allowedips.c | 381 ++++++++++++ drivers/net/wireguard/allowedips.h | 59 ++ drivers/net/wireguard/cookie.c | 236 ++++++++ drivers/net/wireguard/cookie.h | 59 ++ drivers/net/wireguard/device.c | 458 +++++++++++++++ drivers/net/wireguard/device.h | 73 +++ drivers/net/wireguard/main.c | 64 +++ drivers/net/wireguard/messages.h | 128 +++++ drivers/net/wireguard/netlink.c | 642 +++++++++++++++++++++ drivers/net/wireguard/netlink.h | 12 + drivers/net/wireguard/noise.c | 828 +++++++++++++++++++++++++++ drivers/net/wireguard/noise.h | 137 +++++ drivers/net/wireguard/peer.c | 240 ++++++++ drivers/net/wireguard/peer.h | 83 +++ drivers/net/wireguard/peerlookup.c | 221 +++++++ drivers/net/wireguard/peerlookup.h | 64 +++ drivers/net/wireguard/queueing.c | 53 ++ drivers/net/wireguard/queueing.h | 197 +++++++ drivers/net/wireguard/ratelimiter.c | 223 ++++++++ drivers/net/wireguard/ratelimiter.h | 19 + drivers/net/wireguard/receive.c | 595 +++++++++++++++++++ drivers/net/wireguard/selftest/allowedips.c | 683 ++++++++++++++++++++++ drivers/net/wireguard/selftest/counter.c | 104 ++++ drivers/net/wireguard/selftest/ratelimiter.c | 226 ++++++++ drivers/net/wireguard/send.c | 413 +++++++++++++ drivers/net/wireguard/socket.c | 437 ++++++++++++++ drivers/net/wireguard/socket.h | 44 ++ drivers/net/wireguard/timers.c | 243 ++++++++ drivers/net/wireguard/timers.h | 31 + drivers/net/wireguard/version.h | 1 + include/uapi/linux/wireguard.h | 196 +++++++ tools/testing/selftests/wireguard/netns.sh | 537 +++++++++++++++++ 36 files changed, 7755 insertions(+) create mode 100644 drivers/net/wireguard/Makefile create mode 100644 drivers/net/wireguard/allowedips.c create mode 100644 drivers/net/wireguard/allowedips.h create mode 100644 drivers/net/wireguard/cookie.c create mode 100644 drivers/net/wireguard/cookie.h create mode 100644 drivers/net/wireguard/device.c create mode 100644 drivers/net/wireguard/device.h create mode 100644 drivers/net/wireguard/main.c create mode 100644 drivers/net/wireguard/messages.h create mode 100644 drivers/net/wireguard/netlink.c create mode 100644 drivers/net/wireguard/netlink.h create mode 100644 drivers/net/wireguard/noise.c create mode 100644 drivers/net/wireguard/noise.h create mode 100644 drivers/net/wireguard/peer.c create mode 100644 drivers/net/wireguard/peer.h create mode 100644 drivers/net/wireguard/peerlookup.c create mode 100644 drivers/net/wireguard/peerlookup.h create mode 100644 drivers/net/wireguard/queueing.c create mode 100644 drivers/net/wireguard/queueing.h create mode 100644 drivers/net/wireguard/ratelimiter.c create mode 100644 drivers/net/wireguard/ratelimiter.h create mode 100644 drivers/net/wireguard/receive.c create mode 100644 drivers/net/wireguard/selftest/allowedips.c create mode 100644 drivers/net/wireguard/selftest/counter.c create mode 100644 drivers/net/wireguard/selftest/ratelimiter.c create mode 100644 drivers/net/wireguard/send.c create mode 100644 drivers/net/wireguard/socket.c create mode 100644 drivers/net/wireguard/socket.h create mode 100644 drivers/net/wireguard/timers.c create mode 100644 drivers/net/wireguard/timers.h create mode 100644 drivers/net/wireguard/version.h create mode 100644 include/uapi/linux/wireguard.h create mode 100755 tools/testing/selftests/wireguard/netns.sh parent commit e42617b825f8073569da76dc4510bfa019b1c35a wasn't tested testing commit e42617b825f8073569da76dc4510bfa019b1c35a with gcc (GCC) 8.1.0 kernel signature: 822d963a86cd8b11f3bed37f03f608c5f845f3af88ca5120d866ce6ca71b5b21 culprit signature: 28a1bd06f20e47135d19ee46292f647cb980814f3bdac41f18b2c4b473c1254a parent signature: 822d963a86cd8b11f3bed37f03f608c5f845f3af88ca5120d866ce6ca71b5b21 revisions tested: 17, total time: 4h39m17.709049363s (build: 1h53m29.546924734s, test: 2h43m32.352662441s) first bad commit: e7096c131e5161fa3b8e52a650d7719d2857adfd net: WireGuard secure network tunnel cc: ["davem@davemloft.net" "f.fainelli@gmail.com" "gregkh@linuxfoundation.org" "jason@zx2c4.com" "krzk@kernel.org" "kvalo@codeaurora.org" "leon@kernel.org" "linux-kernel@vger.kernel.org" "linux-kselftest@vger.kernel.org" "netdev@vger.kernel.org" "shuah@kernel.org" "tglx@linutronix.de" "vivien.didelot@gmail.com"] crash: INFO: rcu detected stall in wg_packet_tx_worker rcu: INFO: rcu_preempt self-detected stall on CPU rcu: 0-....: (10499 ticks this GP) idle=a3a/1/0x4000000000000002 softirq=90208/90208 fqs=5223 (t=10500 jiffies g=99353 q=5782) NMI backtrace for cpu 0 CPU: 0 PID: 8390 Comm: kworker/0:5 Not tainted 5.5.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: wg-crypt-wg0 wg_packet_tx_worker Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x128/0x182 lib/dump_stack.c:118 nmi_cpu_backtrace.cold.7+0x4b/0x83 lib/nmi_backtrace.c:101 nmi_trigger_cpumask_backtrace+0x183/0x1ac lib/nmi_backtrace.c:62 trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline] rcu_dump_cpu_stacks+0x16d/0x1b9 kernel/rcu/tree_stall.h:254 print_cpu_stall kernel/rcu/tree_stall.h:455 [inline] check_cpu_stall kernel/rcu/tree_stall.h:529 [inline] rcu_pending kernel/rcu/tree.c:2827 [inline] rcu_sched_clock_irq.cold.90+0x50e/0xc54 kernel/rcu/tree.c:2271 update_process_times+0x1f/0x50 kernel/time/timer.c:1726 tick_sched_handle+0x6f/0x130 kernel/time/tick-sched.c:167 tick_sched_timer+0x3e/0xf0 kernel/time/tick-sched.c:1310 __run_hrtimer kernel/time/hrtimer.c:1517 [inline] __hrtimer_run_queues+0x2e1/0xac0 kernel/time/hrtimer.c:1579 hrtimer_interrupt+0x2e5/0x770 kernel/time/hrtimer.c:1641 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1110 [inline] smp_apic_timer_interrupt+0x15e/0x5f0 arch/x86/kernel/apic/apic.c:1135 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:sfq_dequeue+0x196/0xdc0 net/sched/sch_sfq.c:493 Code: 48 89 f8 83 e0 07 83 c0 01 40 38 f0 7c 09 40 84 f6 0f 85 73 0a 00 00 44 0f b7 63 12 48 8b 9d 00 03 00 00 4d 89 e0 4d 6b e4 38 <4c> 01 e3 4c 8d 6b 1a 4c 89 e8 48 c1 e8 03 42 0f b6 34 30 4c 89 e8 RSP: 0018:ffffc900048275a8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000003 RBX: ffff8880a886bf00 RCX: ffff8880a777b2e2 RDX: ffffed1014eef65c RSI: 0000000000000000 RDI: ffff8880a886bf82 RBP: ffff8880a777b000 R08: 0000000000000002 R09: fffff52000904ea1 R10: fffff52000904ea1 R11: 0000000000000003 R12: 0000000000000070 R13: ffff8880a886bf8a R14: dffffc0000000000 R15: 0000000000000003 dequeue_skb net/sched/sch_generic.c:263 [inline] qdisc_restart net/sched/sch_generic.c:366 [inline] __qdisc_run+0x161/0x16e0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3665 [inline] __dev_queue_xmit+0x1602/0x2ed0 net/core/dev.c:3982 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0xc90/0x2340 net/ipv6/ip6_output.c:116 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x200/0x700 net/ipv6/ip6_output.c:175 ip6tunnel_xmit include/net/ip6_tunnel.h:160 [inline] udp_tunnel6_xmit_skb+0x69f/0xd70 net/ipv6/ip6_udp_tunnel.c:114 send6+0x452/0xa50 drivers/net/wireguard/socket.c:164 wg_socket_send_skb_to_peer+0xc1/0x1c0 drivers/net/wireguard/socket.c:189 wg_packet_create_data_done drivers/net/wireguard/send.c:244 [inline] wg_packet_tx_worker+0x2dd/0xa80 drivers/net/wireguard/send.c:272 process_one_work+0x8d1/0x15b0 kernel/workqueue.c:2264 worker_thread+0x82/0xb50 kernel/workqueue.c:2410 kthread+0x31d/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352