…saction
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
When the UAC is used to send an outbound REGISTER message to an endpoint and has an incorrect password resulting in all messages with or without an authorization header being responded to with a 401/407 it is possible and likely that shared memory will be corrupted resulting in core dumps.
The response to the initial register calls into the uac modules uac_send_tm_callback where it generates the authorization constructs a a new request info that has a reference to the existing tp. As a result the 2 transactions and associated timers will have race conditions and ultimately can both attempt to deallocate the shared tp object in either uac_send_tm_callback or uac_resend_tm_callback.
As a solution I use the existing clone function uac_r.cbp = (void *)uac_send_info_clone(tp); which allows each transaction to use and deallocate only their own copy.
In addition to this a sanity check was also added around the to object where it was being used after a possible deallocation.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4210
-- Commit Summary --
* uac: fix memory corruption from shared tp being freed by another transaction
-- File Changes --
M src/modules/uac/uac_send.c (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4210.patchhttps://github.com/kamailio/kamailio/pull/4210.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4210
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4210(a)github.com>
Module: kamailio
Branch: master
Commit: d529b511b1ce722ceccf29dc006e92d45f1f340e
URL: https://github.com/kamailio/kamailio/commit/d529b511b1ce722ceccf29dc006e92d…
Author: ngash <ngash(a)west.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-04-11T13:33:23+02:00
uac: fix memory corruption from shared tp being freed by another transaction
- Shared memory corruption resulting in multiple process core dumps. Triggered by an outbound REGISTER receiving 401 for all requests which resulted in the shared tp being released in uac_resend_tm_callback whilst the current transaction was put on timer and also used after release and then re-released. In order to avoid sharing the tp I changed the code in uac_send_tm_callback to clone the existing tp. Also added a sanity check for null as tp could be released prior to a dereference of tp->event
---
Modified: src/modules/uac/uac_send.c
---
Diff: https://github.com/kamailio/kamailio/commit/d529b511b1ce722ceccf29dc006e92d…
Patch: https://github.com/kamailio/kamailio/commit/d529b511b1ce722ceccf29dc006e92d…
---
diff --git a/src/modules/uac/uac_send.c b/src/modules/uac/uac_send.c
index dd5de24b16c..f8a77b6a6b4 100644
--- a/src/modules/uac/uac_send.c
+++ b/src/modules/uac/uac_send.c
@@ -807,7 +807,7 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps)
/* Callback function */
uac_r.cb = uac_resend_tm_callback;
/* Callback parameter */
- uac_r.cbp = (void *)tp;
+ uac_r.cbp = (void *)uac_send_info_clone(tp);
}
ret = _uac_send_tmb.t_request_within(&uac_r);
@@ -816,13 +816,18 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps)
goto error;
}
if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) {
+ if(uac_r.cbp != NULL)
+ shm_free(uac_r.cbp);
+
shm_free(tp);
*ps->param = NULL;
tp = NULL;
}
- if(tp->evroute != 0) {
- return;
+ if(tp != NULL) {
+ if(tp->evroute != 0) {
+ return;
+ }
}
done:
Module: kamailio
Branch: master
Commit: 75a2c6ff992632d7149f2f0ebafa0ea704be28fd
URL: https://github.com/kamailio/kamailio/commit/75a2c6ff992632d7149f2f0ebafa0ea…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2025-04-11T13:31:10+02:00
modules: readme files regenerated - tm ... [skip ci]
---
Modified: src/modules/tm/README
---
Diff: https://github.com/kamailio/kamailio/commit/75a2c6ff992632d7149f2f0ebafa0ea…
Patch: https://github.com/kamailio/kamailio/commit/75a2c6ff992632d7149f2f0ebafa0ea…
---
diff --git a/src/modules/tm/README b/src/modules/tm/README
index 4821b265a91..9ddf3c6a626 100644
--- a/src/modules/tm/README
+++ b/src/modules/tm/README
@@ -773,8 +773,12 @@ failure_route["serial"]
3.1. fr_timer (integer)
- Timer which hits if no final reply for a request or ACK for a negative
- INVITE reply arrives (in milliseconds).
+ This timer is used for all SIP requests. It hits if no reply for an
+ request INVITE request or other request has been received within (F in
+ milliseconds). If a provisional reply is received for an INVITE (any
+ 1xx), then the fr_inv_timer will be used instead. And if no replies (at
+ all) for an INVITE are received before fr_timer hits, the transaction
+ is terminated with a 408 in failure route.
Default value is 30000 ms (30 seconds).
- Use description found in https://sip-router.org/wiki/ref_manual/timers
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [ ] Tested changes locally
- [x] Related to issue #3939
#### Description
<!-- Describe your changes in detail -->
Fix documentation according to the description found in https://sip-router.org/wiki/ref_manual/timers. They better reflect the actual procedure.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4207
-- Commit Summary --
* tm: Update docs of fr_timer to match the implementation
-- File Changes --
M src/modules/tm/doc/params.xml (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4207.patchhttps://github.com/kamailio/kamailio/pull/4207.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4207
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4207(a)github.com>
Module: kamailio
Branch: master
Commit: 1195252256858dc4419c179e5b72541018f5feab
URL: https://github.com/kamailio/kamailio/commit/1195252256858dc4419c179e5b72541…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-04-11T13:29:33+02:00
tm: Update docs of fr_timer to match the implementation
- Use description found in https://sip-router.org/wiki/ref_manual/timers
---
Modified: src/modules/tm/doc/params.xml
---
Diff: https://github.com/kamailio/kamailio/commit/1195252256858dc4419c179e5b72541…
Patch: https://github.com/kamailio/kamailio/commit/1195252256858dc4419c179e5b72541…
---
diff --git a/src/modules/tm/doc/params.xml b/src/modules/tm/doc/params.xml
index 1dd77f1df3f..31c7c55b9ef 100644
--- a/src/modules/tm/doc/params.xml
+++ b/src/modules/tm/doc/params.xml
@@ -18,8 +18,12 @@
<section id="tm.p.fr_timer">
<title><varname>fr_timer</varname> (integer)</title>
<para>
- Timer which hits if no final reply for a request or ACK for a
- negative INVITE reply arrives (in milliseconds).
+ This timer is used for all SIP requests. It hits if no reply for an
+ request INVITE request or other request has been received
+ within (F in milliseconds). If a provisional reply is received for an
+ INVITE (any 1xx), then the fr_inv_timer will be used instead. And if
+ no replies (at all) for an INVITE are received before fr_timer hits,
+ the transaction is terminated with a 408 in failure route.
</para>
<para>
Default value is 30000 ms (30 seconds).
Hampas-J created an issue (kamailio/kamailio#4211)
Hi,
I'm using "version: kamailio 6.0.0-dev2 (x86_64/linux) 0da3eb" to setup IMS and configured modparam("ims_ipsec_pcscf", "ipsec_preferred_ealg", "aes-cbc") to encrypt ESP payload, I can make a call, but I see the ealg is still null in SIP 401 Unauthorized message and ESP payload is not encrypted:
<img width="211" alt="Image" src="https://github.com/user-attachments/assets/f0d75ff0-1e40-429a-9511-da30cf63…" />
Is there any configuration missing?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4211
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4211(a)github.com>
Module: kamailio
Branch: master
Commit: 92e99afa95df80c762ce60f3b9eca7b7936c74b9
URL: https://github.com/kamailio/kamailio/commit/92e99afa95df80c762ce60f3b9eca7b…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2025-04-11T10:01:17+02:00
modules: readme files regenerated - ims_registrar_scscf ... [skip ci]
---
Modified: src/modules/ims_registrar_scscf/README
---
Diff: https://github.com/kamailio/kamailio/commit/92e99afa95df80c762ce60f3b9eca7b…
Patch: https://github.com/kamailio/kamailio/commit/92e99afa95df80c762ce60f3b9eca7b…
---
diff --git a/src/modules/ims_registrar_scscf/README b/src/modules/ims_registrar_scscf/README
index 100ea1e657c..5ef62cbb0e1 100644
--- a/src/modules/ims_registrar_scscf/README
+++ b/src/modules/ims_registrar_scscf/README
@@ -682,7 +682,7 @@ switch ($retcode) {
4.8. reg_fetch_contacts(domain, uri, profile)
The function fetches the contacts for 'uri' from table 'domain' to
- pseudo-variable $imssulc(profile) [imssulc = ims scscf ulc].
+ pseudo-variable $ulc(profile) [ulc = ims scscf ulc].
Meaning of the parameters is as follows:
* domain - Name of table that should be used for the lookup of
@@ -690,8 +690,8 @@ switch ($retcode) {
* uri - The SIP URI address of the user which to fetch the contact
addresses for. It can contain pseudo-variables that are evaluated
at runtime.
- * profile - Name of $imssulc pseudo-variable profile that will store
- the fetched contacts. It is a static string.
+ * profile - Name of $ulc pseudo-variable profile that will store the
+ fetched contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
@@ -709,7 +709,7 @@ reg_fetch_contacts("location", "sip:user@kamailio.org", "caller");
data in that profile.
Meaning of the parameters is as follows:
- * profile - Name of $imssulc pseudo-variable profile that stores the
+ * profile - Name of $ulc pseudo-variable profile that stores the
contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE