Attention is currently required from: osmith, pespin, lynxis lazus.
Hello osmith, Jenkins Builder, fixeria, daniel, lynxis lazus,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-uecups/+/27739
to look at the new patch set (#3).
Change subject: Fix use-after-free by tun thread after tun obj destroyed
......................................................................
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
---
M daemon/daemon_vty.c
M daemon/internal.h
M daemon/main.c
M daemon/tun_device.c
4 files changed, 84 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-uecups refs/changes/39/27739/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/27739
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: Idf005359afb41d3413b09281a9ff937d5eafcc7c
Gerrit-Change-Number: 27739
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: newpatchset
Attention is currently required from: osmith, pespin, lynxis lazus.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/27739 )
Change subject: Fix use-after-free by tun thread after tun obj destroyed
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
File daemon/tun_device.c:
https://gerrit.osmocom.org/c/osmo-uecups/+/27739/comment/c8cde187_2997d548
PS2, Line 204: pthread_cleanup_pop(tun_device_pthread_cleanup_routine);
man pthread_cleanup_pop reads:
"""The pthread_cleanup_pop() function removes the routine at the top of the stack of clean-up handlers, and optionally executes it if execute is nonzero."""
So it will always pop the last cleanup handler, the only choice you have is if you want it to be executed or not.
I also don't see how you can reach this code (at the moment), there's no break in the while loop.
--
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/27739
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: Idf005359afb41d3413b09281a9ff937d5eafcc7c
Gerrit-Change-Number: 27739
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 12 Apr 2022 06:41:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27734 )
Change subject: ttcn3-pgw: Pass config file to osmo-uecups
......................................................................
Patch Set 1:
(1 comment)
File ttcn3-pgw-test/jenkins.sh:
https://gerrit.osmocom.org/c/docker-playground/+/27734/comment/805d301c_d7e…
PS1, Line 74: -c /data/osmo-uecups-daemon.cfg
Have you checked that it actually works? The current osmo-uecups master does not parse command like arguments at all. It simply expects osmo-uecups-daemon.cfg to be present in the current directory. This is why we set $WORKDIR above.
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27734
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I714172ca063c76a3104daf06f52b5823f304dffe
Gerrit-Change-Number: 27734
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 12 Apr 2022 04:12:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27741 )
Change subject: bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
......................................................................
bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
Deactivate as_Media() once the handover is completed, so that it does
not fail on the expected MGCP DLCX from release.
Fix fallout seen in these tests:
SCCPlite
BSC_Tests.TC_ho_into_this_bsc
BSC_Tests.TC_ho_into_this_bsc_a5_0
BSC_Tests.TC_ho_into_this_bsc_a5_1
BSC_Tests.TC_ho_into_this_bsc_a5_3
BSC_Tests.TC_ho_into_this_bsc_a5_4
BSC_Tests.TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
BSC_Tests.TC_ho_into_this_bsc_a5_1_3
BSC_Tests.TC_srvcc_eutran_to_geran
BSC_Tests.TC_srvcc_eutran_to_geran_a5_3
BSC_Tests.TC_srvcc_eutran_to_geran_src_sai
BSC_Tests.TC_srvcc_eutran_to_geran_forbid_fast_return
BSC_Tests.TC_ho_into_this_bsc_sccp_cr_without_bssap
All of these tests use f_ho_into_this_bsc().
(It is not clear to me why only the SCCPlite tests show the fallout, the
AoIP should be similarly affected, but isn't.)
The failures were introduced by recent merge of
I0633f60f09d58802f6be0238ef41a632d93a4327, which made as_Media()
stricter by failing on early DLCX.
Related: SYS#5916
Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
---
M bsc/BSC_Tests.ttcn
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
neels: Looks good to me, approved
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a2add34..3a40d8d 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -5997,7 +5997,7 @@
f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
f_MscConnHdlr_init(g_pars.media_nr, "127.0.0.2", "127.0.0.3", FR_AMR);
- activate(as_Media());
+ var default as_media := activate(as_Media());
var PDU_BSSAP ho_req := f_gen_handover_req(aoip_tla := g_pars.host_aoip_tla,
cell_id_source := g_pars.cell_id_source,
@@ -6130,6 +6130,7 @@
enc_PDU_ML3_MS_NW(l3_tx)));
BSSAP.receive(tr_BSSMAP_HandoverComplete);
+ deactivate(as_media);
setverdict(pass);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27741
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
Gerrit-Change-Number: 27741
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27741 )
Change subject: bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
......................................................................
bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
Deactivate as_Media() once the handover is completed, so that it does
not fail on the expected MGCP DLCX from release.
Fix fallout seen in these tests:
SCCPlite
BSC_Tests.TC_ho_into_this_bsc
BSC_Tests.TC_ho_into_this_bsc_a5_0
BSC_Tests.TC_ho_into_this_bsc_a5_1
BSC_Tests.TC_ho_into_this_bsc_a5_3
BSC_Tests.TC_ho_into_this_bsc_a5_4
BSC_Tests.TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
BSC_Tests.TC_ho_into_this_bsc_a5_1_3
BSC_Tests.TC_srvcc_eutran_to_geran
BSC_Tests.TC_srvcc_eutran_to_geran_a5_3
BSC_Tests.TC_srvcc_eutran_to_geran_src_sai
BSC_Tests.TC_srvcc_eutran_to_geran_forbid_fast_return
BSC_Tests.TC_ho_into_this_bsc_sccp_cr_without_bssap
All of these tests use f_ho_into_this_bsc().
(It is not clear to me why only the SCCPlite tests show the fallout, the
AoIP should be similarly affected, but isn't.)
The failures were introduced by recent merge of
I0633f60f09d58802f6be0238ef41a632d93a4327, which made as_Media()
stricter by failing on early DLCX.
Related: SYS#5916
Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
---
M bsc/BSC_Tests.ttcn
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/27741/1
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a2add34..3a40d8d 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -5997,7 +5997,7 @@
f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
f_MscConnHdlr_init(g_pars.media_nr, "127.0.0.2", "127.0.0.3", FR_AMR);
- activate(as_Media());
+ var default as_media := activate(as_Media());
var PDU_BSSAP ho_req := f_gen_handover_req(aoip_tla := g_pars.host_aoip_tla,
cell_id_source := g_pars.cell_id_source,
@@ -6130,6 +6130,7 @@
enc_PDU_ML3_MS_NW(l3_tx)));
BSSAP.receive(tr_BSSMAP_HandoverComplete);
+ deactivate(as_media);
setverdict(pass);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27741
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
Gerrit-Change-Number: 27741
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: osmith, fixeria, daniel, lynxis lazus.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/27739 )
Change subject: Fix use-after-free by tun thread after tun obj destroyed
......................................................................
Patch Set 2:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/27739
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: Idf005359afb41d3413b09281a9ff937d5eafcc7c
Gerrit-Change-Number: 27739
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Mon, 11 Apr 2022 18:19:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment