]> git.ipfire.org Git - thirdparty/squid.git/commit - src/auth/ntlm/UserRequest.cc
Reuse reserved Negotiate and NTLM helpers after an idle timeout (#59)
authorChristos Tsantilas <christos@chtsanti.net>
Tue, 12 Feb 2019 17:16:23 +0000 (17:16 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 14 Feb 2019 16:03:51 +0000 (16:03 +0000)
commita56fcf0b804aebbea6dcc59d99448dcc84925ac7
treec92ec6cb30c82a0a06c541fce9c5ada653f1b6f0
parent07d4ea38faaaff658164395a16a4a1499d03b334
Reuse reserved Negotiate and NTLM helpers after an idle timeout (#59)

Squid can be killed or maimed by enough clients that start multi-step
connection authentication but never follow up with the second HTTP
request while keeping their HTTP connection open. Affected helpers
remain in the "reserved" state and cannot be reused for other clients.
Observed helper exhaustion has happened without any malicious intent.

To address the problem, we add a helper reservation timeout. Timed out
reserved helpers may be reused by new clients/connections. To minimize
problems with slow-to-resume-authentication clients, timed out reserved
helpers are not reused until there are no unreserved running helpers
left. The reservations are tracked using unique integer IDs.

Also fixed Squid crashes caused by unexpected helper termination -- the
raw UserRequest::authserver pointer could point to a deleted helper.

This is a Measurement Factory project.
14 files changed:
src/auth/negotiate/UserRequest.cc
src/auth/negotiate/UserRequest.h
src/auth/ntlm/UserRequest.cc
src/auth/ntlm/UserRequest.h
src/cf.data.pre
src/helper.cc
src/helper.h
src/helper/ChildConfig.cc
src/helper/ChildConfig.h
src/helper/Makefile.am
src/helper/Reply.cc
src/helper/Reply.h
src/helper/ReservationId.cc [new file with mode: 0644]
src/helper/ReservationId.h [new file with mode: 0644]