]> git.ipfire.org Git - thirdparty/openvpn.git/commit
dco_linux: validate tun interface before fetching stats
authorRalf Lici <ralf@mandelbit.com>
Tue, 2 Sep 2025 16:45:15 +0000 (18:45 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 2 Sep 2025 16:57:05 +0000 (18:57 +0200)
commit14ced61eef89797e606c3b7600adc4da83a336f4
tree605dcef495da88b00d8c4297d61c1e8deda7b6bc
parent9e9ba09adbe08e93d91d8340efe63bae978f5f34
dco_linux: validate tun interface before fetching stats

If dco_get_peer_stats() is called with an uninitialized c->c1.tuntap it
results in a segfault. This issue happens when a client who has not
connected to any server:
  - has --management and exits,
  - has --management and a management interface client issues either
    `bytecount` or `status` or
  - if SIGUSR2 is sent to it.

Add a check to ensure the tun interface was set up before attempting to
retrieve peer statistics.

Change-Id: I40c11864745cc1619cb9cbf490b168f90feb5eac
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250902164521.23145-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32768.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/dco_linux.c