github / glb-director

GitHub Load Balancer Director and supporting tooling.
Other
2.37k stars 227 forks source link

glb-redirect: fix two socket freeing bugs #94

Closed lmb closed 4 years ago

lmb commented 4 years ago

I think I've found two bugs in the way glb-redirect releases socket references. One of them is leading to kernel crashes, while the other one I spotted because I fixed a different SOCK_RCU_FREE bug recently (so you can consider it a preemptive fix). Please see the commit descriptions for details.

We're in the process of migrating away from glb-redirect, so I haven't run this through the test suite. I'd appreciate it if you could do that for me.

lmb commented 4 years ago

I've removed the patch to not sock_put listeners. You bump the refcount just before, which I missed. However, I think that the code handling listening sockets still has problems:

My suggestion is to drop the listening socket refcount logic on >= 4.6 kernels.