Skip to content

Cinterion: Fix WS46 mode parsing for ELS62 modem and avoid double free#26

Open
ihasz wants to merge 2 commits intolinux-mobile-broadband:mainfrom
ihasz:cinterion-ws46-fix
Open

Cinterion: Fix WS46 mode parsing for ELS62 modem and avoid double free#26
ihasz wants to merge 2 commits intolinux-mobile-broadband:mainfrom
ihasz:cinterion-ws46-fix

Conversation

@ihasz
Copy link
Copy Markdown

@ihasz ihasz commented Mar 23, 2026

Problem

ModemManager crashes with certain Cinterion ELS62 modems when querying +WS46 mode.
The modem responds with +WS46: 30, which the current parser does not recognize, leading to an unhandled GError and a double free crash.
Observed on Debian stable 1.24.0 package (ModemManager 1.24.0-1+deb13u1).

Solution

Extend the switch in mm_cinterion_parse_ws46_response() to handle mode 30 properly.
Ensure that GError is handled safely to prevent double free in ws46_query_ready().

This brings Cinterion support in line with Telit parser logic, which handles all modes reported by AT+WS46=?:

+WS46: (12,22,25,28,29,30,31)

Testing

Tested on ELS62 modem, Debian 13, ModemManager 1.24.0 patched with this fix.
No crashes observed when querying WS46.
Verified the allowed modem modes are parsed correctly for mode 30.

Notes

Backwards compatible with existing modem types and other WS46 modes.
This patch only affects Cinterion WS46 parsing; other modem families remain unchanged.

ihasz added 2 commits March 22, 2026 17:58
g_task_return_error() takes ownership of the GError, but the
g_autoptr(GError) cleanup also frees it, causing a double free
and crash when parsing fails.

Fix by using g_steal_pointer(&error) when returning the error.
Some modems (e.g. Cinterion ELS62) report additional WS46 modes
(29, 30, 31) which are currently treated as errors.

Align behavior with Telit plugin by mapping these modes to
appropriate MMModemMode bitmasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant