Bug 1419716 - Summary: modem-manager-gui segfaults in strftime(3)
Summary: Summary: modem-manager-gui segfaults in strftime(3)
Alias: None
Product: Fedora
Classification: Fedora
Component: modem-manager-gui
Version: 24
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-02-06 20:40 UTC by Bruce Jerrick
Modified: 2017-08-08 19:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-08-08 19:38:18 UTC
Type: Bug

Attachments (Terms of Use)
Patch to avoid modem-manager-gui segfault in strftime(3). (663 bytes, patch)
2017-02-06 20:40 UTC, Bruce Jerrick
no flags Details | Diff

Description Bruce Jerrick 2017-02-06 20:40:22 UTC
Created attachment 1248190 [details]
Patch to avoid modem-manager-gui segfault in strftime(3).

Description of problem:
When processing the timestamp on received SMS messages, modem-manager-gui
will segfault in strftime(3) if the timestamp of the message is bogusly

Version-Release number of selected component:

How reproducible:
Always, but depends on the device type and perhaps on the carrier (given
  some of T-M*bile's bogosity, the latter is a distinct possibility).
I get it with a Sierra/Netgear AirCard 340U, using T-Mobile carrier:
    Sierra MBIM [1199:9051]
    Version:NTG9X15C_01.13.12.14 Port:cdc-wdm0 Type:GSM
And there will have to be received SMS messages on the device.
The source of the message doesn't seem to matter.
The segfault occurs after the device is connected (immediately if already

Steps to Reproduce:
Start modem-manager-gui, preferably from a shell command line.

Actual results:
If started from a shell command line:
    Thread 1 "modem-manager-g" received signal SIGSEGV, Segmentation fault.
    0x00007ffff4fddcd1 in __strftime_internal () from /lib64/libc.so.6
If started from a desktop menu nothing visible happens.

Expected results:
GUI window appears.

Additional info:
Patch included as an attachment.  A bit of a hack, it just rejects timestamps
  beyond Dec 31 2099 23:59:59 UTC (arbitrarily chosen).
I have seen these timestamps:
    9223372036854775807		# note: 2^63-1 (i.e., -1 in signed long)
(The range of those would seem to preclude them being valid but in some
  other format.  I haven't seen any in Un*x epoch format.)

In an ideal world, strftime(3) wouldn't segfault from bad data (in the
  struct tm argument).

Comment 1 Bruce Jerrick 2017-02-06 22:46:20 UTC
I don't reproduce the problem on F25 (modem-manager-gui-0.0.18-3.fc24.x86_64;
  that's the latest available for F25 or F26 Rawhide).
So I would assume it's something in the libs it uses to pull the raw info
  off the device -- I may have some mixed versions of those.
So this can probably be considered closed -- my patch will be good enough
  for me.

Comment 2 Bruce Jerrick 2017-02-10 07:39:11 UTC
Well, today things are different -- modem-manager-gui-0.0.18-3.fc24.x86_64
does segfault on F25.  I have now idea why the change in behavior (but I've
noticed in the past that modem-manager-gui can be rather inconsistent).

Comment 3 Bruce Jerrick 2017-02-17 17:12:41 UTC
This change should be made to the patch attachment:
Instead of:
    if (timestamp > 4102444799 {    /* Dec 31 2099 23:59:59 UTC */
this is better:
    if (timestamp < 0 || timestamp > 4102444799 {	/* Dec 31 2099 23:59:59 UTC */
because I've seen bogus -1 timestamps.
Of course, that will reject all the SMS messages sent prior to 1970. :-)

Comment 4 Fedora Admin XMLRPC Client 2017-07-05 10:48:29 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora End Of Life 2017-07-26 00:14:58 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2017-08-08 19:38:18 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.