[rilmodem/gril] If RIL message event_data is NULL, ril_msg->buf contains garbage

Bug #1254219 reported by Tony Espy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ofono (Ubuntu)
Fix Released
Undecided
Alfonso Sanchez-Beato

Bug Description

A RIL Reply is comprised of the following fields:

uint32_t - Length
uint32_t - 0 (this means it's a reply vs. an event)
uint32_t - Serial Number
uint32_t - Error code
void* - Event Data

If the event data is empty, the low-level gril.c function dispatch() incorrectly handles the message, and fails to free the buf pointer and set the buf_len to 0.

Currently all of our rilmodem code checks the error code first, before attempting to parse the buffer. We recently discovered that SIM_IO responses may contain event_data even though error is non-zero. When we changed the code to parse the data on a SIM IO even when error was non-zero, bad things happened due to buf and buf_len being invalid.

Related branches

Tony Espy (awe)
Changed in ofono (Ubuntu):
status: New → Confirmed
Tony Espy (awe)
Changed in ofono (Ubuntu):
status: Confirmed → In Progress
Changed in ofono (Ubuntu):
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ofono - 1.12+bzr6846-0ubuntu1

---------------
ofono (1.12+bzr6846-0ubuntu1) trusty; urgency=low

  [ Alfonso Sanchez-Beato ]
  * gril, include, rilmodem/sms, unit: SMS re-factoring
    - merge applicable nemomobile code
    - re-factor parcel code
    - add sms parcel unit tests
  * build, doc, plugins, test: Add SMS history plugin
    - adds support for SMS delivery reports (LP: #1223314)
  * gril, src, unit: Fix build warning
  * gril, rilmodem/voicecall, unit: Voicecall re-factoring
    - merge applicable nemomobile code, including support
      for multi-party calling and call hold
    - re-factor parcel code
    - add voicecall parcel unit tests
  * rilmodem: fix memory leaks reported by valgrind
  * gril, rilmodem/sim: Remove SIM file-not-found error logging
    - includes low-level gril fix to handle ril messages
      that include a failure code, but also include event
      data (LP: #1254219)
  * gril, rilmodem/call-volume, unit: Call-volume re-factoring
    - merge applicable nemomobile code
    - re-factor parcel code
    - add call-volume parcel unit tests
  * gril, rilmodem/devinfo, unit: Devinfo re-factoring
    - re-factor parcel code
    - add devinfo parcel unit tests

  [ Tony Espy ]
  * unit: Add rilmodem gprs/netreg parcel unit tests
  * debian/rules: Add CFLAGS to enable strict warnings checking
  * gril, unit: fix const casts in gril and unit tests
  * rilmodem/gprs: set default max_cids to 1 (LP: 1254746)
 -- Ricardo Salveti de Araujo <email address hidden> Mon, 09 Dec 2013 23:05:49 -0200

Changed in ofono (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.