Commit Graph

5 Commits

Author SHA1 Message Date
Harald Welte e36dbcbc03 daemon_vty: avoid null-dereference in argc < 0 case
in show_gtp_cmd, we have two different checks (argc > 0) vs (argc)
which means in theory argc could be negative and the second clause
would be executed without the first having set up related data such as
'ai'.

Fixes: CID#307521: Explicit null dereferenced (FORWARD_NULL)
Change-Id: I4149b0b191a34168ba6649338d3cdf6c6af6cfe7
2023-07-18 14:35:41 +02:00
Pau Espin a459b5c756 Fix use-after-free by tun thread after tun obj destroyed
The main thread calls pthread_cancel before freeing the tun object.
However, pthread_cancel doesn't kill the thread synchronously (man
pthread_cancel). Hence, the tun thread may still be running for a while
after the tun object is/has been(ing) freed.
Let's avoid this by making sure the thread is stopped before
freeing the object.
To accomplish it, we must wait for the thread to be cancelled. A cleanup
routie is added which will signal the "tun_released" message to the main
thread through an osmo_itq, which will then free the object (since
talloc context is managed by the main thread).

Related: SYS#5523
Change-Id: Idf005359afb41d3413b09281a9ff937d5eafcc7c
2022-04-12 10:54:04 +02:00
Harald Welte 8362efef7c daemon: Add VTY command to configure local bind IP of UECUPS socket
Change-Id: Iabe37ce5c77fddcc146fca3b81660822071d1925
2020-04-26 22:44:28 +02:00
Harald Welte f23abd74cf work around bogus compiler warnings
Change-Id: I9170e4de857c1f3e003a480b12dd16fe796ec763
2020-04-20 13:21:12 +02:00
Harald Welte f7365595ac initial check-in of the UECUPS daemon and the related TTCN3 code
Change-Id: I5acf7059722b58e6f57dbf31e18abcc385533970
2020-04-15 22:01:52 +02:00