laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/42706?usp=email )
Change subject: asn1: ber_decoder: disable stack size check on ctx = NULL
......................................................................
asn1: ber_decoder: disable stack size check on ctx = NULL
The stack size check is triggering when using asan or
when compile with -O1.
It is unclear why this is problematic.
This is a not a leak.
Related: OS#7002
Change-Id: Id99531f62ccdf73497bb08483ca6adbabe1a7cd7
---
M src/rspro/ber_decoder.c
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
jolly: Looks good to me, but someone else must approve
diff --git a/src/rspro/ber_decoder.c b/src/rspro/ber_decoder.c
index 0f99400..1e150ac 100644
--- a/src/rspro/ber_decoder.c
+++ b/src/rspro/ber_decoder.c
@@ -44,7 +44,9 @@
} else {
/* If context is not given, be security-conscious anyway */
memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
- s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX;
+ /* TODO: disable stack check until the root cause can be debugged. See OS#7002
+ s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX; */
+ s_codec_ctx.max_stack_size = 0;
opt_codec_ctx = &s_codec_ctx;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/42706?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: Id99531f62ccdf73497bb08483ca6adbabe1a7cd7
Gerrit-Change-Number: 42706
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/42665?usp=email )
Change subject: Fix: Prevent bankd from exiting upon SIGPIPE
......................................................................
Fix: Prevent bankd from exiting upon SIGPIPE
If a client disconnects from a worker thread while the worker is
responding to a to a request from that client, the socket is closed and
SIGPIPE is sent to the worker, causing the application to exit.
To prevent this, all workers have a dummy handler to prevent this. Now
the worker can handle the closing of the socket.
Change-Id: I13d6e9da48d12f93c00bd2d021789bde71aca7cf
---
M src/bankd/bankd_main.c
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index fc8f480..5d46f97 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -55,6 +55,7 @@
#define SIGMAPADD SIGRTMIN+2
static void handle_sig_usr1(int sig);
+static void handle_sig_pipe(int sig);
static void handle_sig_mapdel(int sig);
static void handle_sig_mapadd(int sig);
@@ -439,6 +440,7 @@
g_bankd->main = pthread_self();
signal(SIGMAPDEL, handle_sig_mapdel);
signal(SIGMAPADD, handle_sig_mapadd);
+ signal(SIGPIPE, handle_sig_pipe);
signal(SIGUSR1, handle_sig_usr1);
LOGP(DMAIN, LOGL_INFO, "Reading PCSC slots...\n");
@@ -557,6 +559,13 @@
/* do nothing */
}
+/* signal handler for receiving SIGPIPE from worker thread */
+static void handle_sig_pipe(int sig)
+{
+ /* DO NOT LOG ANYTHING HERE, IT WILL DEADLOCK WITH THE osmo_log_tgt_mutex */
+ /* do nothing */
+}
+
static void handle_sig_usr1(int sig)
{
OSMO_ASSERT(sig == SIGUSR1);
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/42665?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I13d6e9da48d12f93c00bd2d021789bde71aca7cf
Gerrit-Change-Number: 42665
Gerrit-PatchSet: 6
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>