Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash upon PSDBU report triggered on a multi-buffer frame #240

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

ivan4th
Copy link
Contributor

@ivan4th ivan4th commented Apr 20, 2022

Make sure that the session is not deleted multiple times

Copy link
Member

@RoadRunnr RoadRunnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole problem makes we wonder if the current URR event queuing model should be changed (but not in this bugfix).
It might be worth having a outstanding URR events queue per session and only queue a trigger to process the URRs to the PFCP server.
That way additional events can be added to the URR queue for a session while the trigger is in the queue. Of course, some mutual exclusion on the per session URR event buffer would be needed.

* CP-SEID in the event.
*/
if (pool_is_free_index (gtm->sessions, ueh->session_idx))
continue;
Copy link
Member

@RoadRunnr RoadRunnr Apr 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The continue skips over the vec_free_h at the end. Wouldn't this cause a leak of the ueh entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing this problem. Adjusted the code slightly to avoid the leak

@ivan4th
Copy link
Contributor Author

ivan4th commented Apr 21, 2022

I agree concerning the per-session URR event queue (to be done later)

Copy link
Member

@RoadRunnr RoadRunnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 1225 to 1229
if (!sx || sx->cp_seid != ueh->cp_seid)
{
vec_free_h (uev, sizeof (upf_event_urr_hdr_t));
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those lines are fine, still I would have coded this as:

Suggested change
if (!sx || sx->cp_seid != ueh->cp_seid)
{
vec_free_h (uev, sizeof (upf_event_urr_hdr_t));
continue;
}
if (!sx || sx->cp_seid != ueh->cp_seid)
{
goto next_ev_urr;
}

with a the goto label` place right before the free.

That way it would be harder to accidentally use different cleanups for both cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the code to use goto, as indeed we might introduce a hard-to-catch bug later with different cleanup code paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants