Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191191 - app-mobilephone/gammu crash while --identify(ing) or --backup(ing)
Summary: app-mobilephone/gammu crash while --identify(ing) or --backup(ing)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Mobile Phone Developers (INACTIVE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 191303
  Show dependency tree
 
Reported: 2007-09-03 22:12 UTC by Tupone Alfredo
Modified: 2007-09-06 10:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gammu-1.12.0-fixups.patch (gammu-1.12.0-fixups.patch,3.93 KB, patch)
2007-09-03 22:13 UTC, Tupone Alfredo
Details | Diff
gammu-1.13.0.ebuild (gammu-1.13.0.ebuild,1.79 KB, text/plain)
2007-09-04 20:03 UTC, Tupone Alfredo
Details
gammu-1.13.0-fixups.patch (gammu-1.13.0-fixups.patch,1018 bytes, patch)
2007-09-04 20:03 UTC, Tupone Alfredo
Details | Diff
gammu-1.13.0-fixups.patch (gammu-1.13.0-fixups.patch,2.68 KB, patch)
2007-09-05 19:01 UTC, Alin Năstac (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tupone Alfredo gentoo-dev 2007-09-03 22:12:20 UTC
I attached my Siemens C72 to my desktop and gammu failed, with segment violation, at least 2 commands.
That is due to non-checking of buffer overflow in several place.

Reproducible: Always




I'm going to submit a patch that fixes these faults, just increasing the size of the array it is writing into. No guarantee that with a more powerful phone you will not overflow even the patched one.
Comment 1 Tupone Alfredo gentoo-dev 2007-09-03 22:13:38 UTC
Created attachment 129946 [details, diff]
gammu-1.12.0-fixups.patch

I changed the already present patch file, adding my patches.
Comment 2 Tupone Alfredo gentoo-dev 2007-09-03 22:16:46 UTC
Maybe, instead of patching this version, is better to have the 1.13.0 version in the tree. The 1.13.0 does not need anymore the old patch file, just the new one, as the 1.13.0 version too is bugged. At least we can hope upstream will take more into account for the "incoming".

I will test more commands to see what else is bugged.
Comment 3 Tupone Alfredo gentoo-dev 2007-09-04 20:03:15 UTC
Created attachment 130031 [details]
gammu-1.13.0.ebuild

An ebuild for the 1.13.0 with the same fix
Comment 4 Tupone Alfredo gentoo-dev 2007-09-04 20:03:34 UTC
Created attachment 130033 [details, diff]
gammu-1.13.0-fixups.patch
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2007-09-05 16:40:33 UTC
But this don't fix completely the buffer overflow occured in GSM_GetFirmware. There are 2 places where firmware buffer overflow will occur: functions GSM_Init and Backup (both in gammu.c). 

Also SaveRingtoneEntry() could be modified to use a much smaller buffer (4096 bytes for instance) and do it safely.
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2007-09-05 19:01:16 UTC
Created attachment 130106 [details, diff]
gammu-1.13.0-fixups.patch

Seems it is not possible to reuse a buffer of fixed length for SaveRingtoneEntry() so I used dynamic allocation instead.

Please check this patch with your phone.
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2007-09-06 10:05:31 UTC
The patched gammu-1.13.0 is now in the tree. The patch used is the one offered by upstream.

Thanks!