Attention is currently required from: laforge.
jolly has uploaded a new patch set (#2) to the change originally created by laforge. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36077?usp=email )
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: osmo_io: make use of osmo_iofd_get_ioops()
......................................................................
osmo_io: make use of osmo_iofd_get_ioops()
This avoids resetting the callbacks with the wrong ones in the SCTP
case.
Change-Id: Id3cb11bc0000299faa79d980de8abc1980916d70
Depends: libosmocore.git Change-Id I03398c811b9534f50c6644b21eea89a04be29fb0
---
M src/stream_cli.c
M src/stream_srv.c
2 files changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/77/36077/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36077?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id3cb11bc0000299faa79d980de8abc1980916d70
Gerrit-Change-Number: 36077
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36125?usp=email )
Change subject: stream_{cli,srv}: Free received messages when not forwarded
......................................................................
stream_{cli,srv}: Free received messages when not forwarded
If a message is not forwarded (to a read callback function, it must be
freed, to prevent memory leaks.
The message musst be freed before calling osmo_stream_srv_destroy() or
stream_cli_handle_connecting(), because within the function calls the
client/server instance may get destroyed and the message is 'owned' by
it. Calling msgb_free(msg) afterwards may result in double free bug.
Related: OS#5753
Change-Id: Ic043f11cdba0df9e0b78cac8db7206800098e0ba
---
M src/stream_cli.c
M src/stream_srv.c
2 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/36125/1
diff --git a/src/stream_cli.c b/src/stream_cli.c
index f9e52a0..61fb4b7 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -439,6 +439,7 @@
switch (cli->state) {
case STREAM_CLI_STATE_CONNECTING:
+ msgb_free(msg);
stream_cli_handle_connecting(cli, res);
break;
case STREAM_CLI_STATE_CONNECTED:
@@ -447,6 +448,8 @@
/* Forward message to read callback, also if the connection failed. */
if (cli->iofd_read_cb)
cli->iofd_read_cb(cli, msg);
+ else
+ msgb_free(msg);
break;
default:
osmo_panic("%s() called with unexpected state %d\n", __func__, cli->state);
@@ -488,6 +491,7 @@
switch (cli->state) {
case STREAM_CLI_STATE_CONNECTING:
+ msgb_free(msg);
stream_cli_handle_connecting(cli, res);
break;
case STREAM_CLI_STATE_CONNECTED:
@@ -496,6 +500,8 @@
/* Forward message to read callback, also if the connection failed. */
if (cli->iofd_read_cb)
cli->iofd_read_cb(cli, msg);
+ else
+ msgb_free(msg);
break;
default:
osmo_panic("%s() called with unexpected state %d\n", __func__, cli->state);
diff --git a/src/stream_srv.c b/src/stream_srv.c
index f82a9a0..852154a 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -562,6 +562,7 @@
if (OSMO_UNLIKELY(res <= 0)) {
/* This connection is dead, destroy it. */
+ msgb_free(msg);
osmo_stream_srv_destroy(conn);
} else {
if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) {
@@ -609,6 +610,7 @@
if (OSMO_UNLIKELY(res <= 0)) {
/* This connection is dead, destroy it. */
+ msgb_free(msg);
osmo_stream_srv_destroy(conn);
} else {
if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) {
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36125?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ic043f11cdba0df9e0b78cac8db7206800098e0ba
Gerrit-Change-Number: 36125
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange
Attention is currently required from: daniel, laforge, pespin.
jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35984?usp=email )
Change subject: osmo_io_uring: Run check of tests/osmo_io with io_uring also
......................................................................
Patch Set 6:
(1 comment)
File tests/testsuite.at:
https://gerrit.osmocom.org/c/libosmocore/+/35984/comment/18ee800e_c556ea96
PS6, Line 535: AT_SKIP_IF([ test "$ENABLE_URING" != "yes" ])
> shouldn't this be = "yes"? […]
AT_SKIP_IF will run the test, if the condition is false. if ENABLE_URING is "yes" this condition is false. i tested that with --disable-uring
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35984?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I82db9a15bc483a5447d86352512afaafa2bcfbb6
Gerrit-Change-Number: 35984
Gerrit-PatchSet: 6
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Feb 2024 08:17:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: daniel, laforge, pespin.
jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35982?usp=email )
Change subject: osmo_io_uring: Detach msghdr from iofd before calling iofd_handle_send_completion()
......................................................................
Patch Set 9:
(1 comment)
File src/core/osmo_io_uring.c:
https://gerrit.osmocom.org/c/libosmocore/+/35982/comment/239e58ef_242b6b4b
PS6, Line 200: * iofd_handle_send_completion() will free msghdr at the end. the previous callback function may destroy iofd.
> Still waiting for this to be clarified.
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35982?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia349f73de2145fa360b20dd40deb73a8ffc71f07
Gerrit-Change-Number: 35982
Gerrit-PatchSet: 9
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Feb 2024 08:17:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36121?usp=email )
Change subject: osmo_io: Assign const name when stealing TX msg from iofd ctx
......................................................................
osmo_io: Assign const name when stealing TX msg from iofd ctx
All TX messages are moved from iofd instance to the user's context.
iofd may be destroyed, but the message is still available to the user.
To prevent a use-after-free, the context name must be changed from
iofd->name to a constant that does not belong to iofd.
Change-Id: Ib8dae924fa2d94a7f636136ba7279b965a18cf5b
---
M src/core/osmo_io.c
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/36121/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 7ea959b..89690ae 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -334,7 +334,9 @@
* \param[in] hdr serialized msghdr containing state of completed I/O */
void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *hdr)
{
+ /* Steal the msg from iofd. Also assign const name, because iofd->name will be freed when iofd is destroyed. */
talloc_steal(iofd->msgb_alloc.ctx, msg);
+ talloc_set_name(msg, "osmo_io_rx_msgb");
switch (iofd->mode) {
case OSMO_IO_FD_MODE_READ_WRITE:
iofd_handle_segmented_read(iofd, msg, rc);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36121?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib8dae924fa2d94a7f636136ba7279b965a18cf5b
Gerrit-Change-Number: 36121
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange
Attention is currently required from: daniel, jolly, pespin.
Hello Jenkins Builder, daniel, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email
to look at the new patch set (#9).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c
......................................................................
osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c
In order to receive a connect notification from SCTP socket,
poll/select event must be used instead of a write notification via
io_uring completion event.
Once the connect notification has been received, subsequent write
notifications via io_uring are used.
Change-Id: I4eca9ea72beb0d6ea4d44cce81ed620033f07270
Related: OS#5751
---
M src/core/osmo_io_internal.h
M src/core/osmo_io_uring.c
2 files changed, 93 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/35910/9
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4eca9ea72beb0d6ea4d44cce81ed620033f07270
Gerrit-Change-Number: 35910
Gerrit-PatchSet: 9
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: daniel, laforge.
Hello Jenkins Builder, daniel, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: osmo_io: Move notify_connected function to backend
......................................................................
osmo_io: Move notify_connected function to backend
This relocation is necessary as the backend (osmo_io_fd or
osmo_io_uring) requires a different approach in handling connect
notifications. As a result, a function call has been introduced to
struct iofd_backend_ops.
In a subsequent patch, the process for the osmo_io_uring backend will
be modified to handle SCTP connect notifications using poll/select.
If connect notification is requested using poll/select, the file
descriptior must be registered to osmo_fd, using osmo_fd_register. If
read / write notification is requested by application, the file
descriptior must be registered also. A flag is used prevent calling
osmo_fd_register / osmo_fd_unregister multiple times, which would cause
a crash.
Change-Id: I905ec85210570aff8addadfc9603335d04eb057a
Related: OS#5751
---
M src/core/osmo_io.c
M src/core/osmo_io_internal.h
M src/core/osmo_io_poll.c
M src/core/osmo_io_uring.c
4 files changed, 54 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/35909/6
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I905ec85210570aff8addadfc9603335d04eb057a
Gerrit-Change-Number: 35909
Gerrit-PatchSet: 6
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newpatchset