]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Make OPENVPN_PLUGIN_ENABLE_PF failures FATAL
authorGert Doering <gert@greenie.muc.de>
Thu, 21 Jan 2021 13:39:29 +0000 (14:39 +0100)
committerGert Doering <gert@greenie.muc.de>
Sat, 23 Jan 2021 12:14:34 +0000 (13:14 +0100)
commitcbbdcd4f97bb19e5be6c11cf94397b38e869a0ee
treeff58539d4c9867ca70aca951fe13e28b8b796191
parent4008ce020526f950cb2055ba7effff8f7ceb13e4
Make OPENVPN_PLUGIN_ENABLE_PF failures FATAL

Without this patch, if openpn is using a plugin that provides
OPENVPN_PLUGIN_ENABLE_PF but then fails (returns OPENVPN_PLUGIN_FUNC_ERROR),
OpenVPN will crash on a NULL pointer reference.

The underlying cause is (likely) the refactoring work regarding
CAS_SUCCEEDED etc., and that nobody adjusted the pf.c code accordingly
(it tries to sent itself a SIGUSR1, which tries to tear down the
client MI instance, but since it is not fully set up yet at this
point, things explode).  Full details on the call chain in Trac...

Since we intend to remove pf in 2.6, but we still do not want OpenVPN
to ever SIGSEGV, change the requirements for the plugins to "MUST SUCCEED",
so if the plugin ENABLE_PF call fails, abort openvpn with a M_FATAL
message.

Trac: #1377

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20210121133929.20186-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21464.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 6a0c51baaa4d2b329183601ec35d3d16f127519e)
src/openvpn/pf.c