aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/socket.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-10 16:28:48 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-10 16:28:48 +0100
commitcc3d7df096a88cdf96d016bdcb2f78fa03abb6f3 (patch)
tree88858692a465c1c351fa0634b1ba74828f15df7f /src/socket.h
parentchacha20poly1305: don't forget version header (diff)
downloadwireguard-monolithic-historical-cc3d7df096a88cdf96d016bdcb2f78fa03abb6f3.tar.xz
wireguard-monolithic-historical-cc3d7df096a88cdf96d016bdcb2f78fa03abb6f3.zip
curve25519: use kmalloc in order to not overflow stackexperimental-0.0.20161110
On MIPS, the IRQ and SoftIRQ handlers share the stack with whatever kernel thread was interrupted. This means that Curve25519 can be interrupted by, say, an ethernet controller, that then gets handled by a SoftIRQ. If something like l2tp is being used, which uses quite a bit of stack, then by the time the SoftIRQ handler gets to WireGuard code and calls into the stack-heavy ChaPoly functions, our 8k stack is shot. In other words, since Curve25519 is such a big consumer of stack, if it's interrupted by anything else that uses a healthy amount of stack, then disaster strikes. The solution here is just to allocate using kmalloc. This is quite ugly, and if performance becomes an issue, we might consider moving to a kmem_cache allocator, or even having each peer keep its own preallocated space. But for now, we'll try this.
Diffstat (limited to 'src/socket.h')
0 files changed, 0 insertions, 0 deletions