bugGPSD - Bugs: bug #44919, Incorrect size passed to shmget()...

 
 

bug #44919: Incorrect size passed to shmget() when allocating segment for shm export

Submitter:  Zbigniew Chyla <zchyla_nokia>
Submitted:  Fri 24 Apr 2015 04:15:11 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  esr
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 24 Apr 2015 04:46:05 PM UTC, comment #1: 

Additional Note…
You'll need to remove shm segment with the old size before running gpsd with the fix applied (shmget() returns EINVAL if existing segment with specified key is smaller than requested size).

Zbigniew Chyla <zchyla_nokia>
Fri 24 Apr 2015 04:15:11 PM UTC, original submission:  

When allocating shm segment for exporting data via shared memory, shmget() is called with “sizeof(struct gps_data_t)” as the segment size, while actually more memory is used. The correct size is “sizeof(struct shmexport_t)” (shmexport_t contains gps_data_t and an additional fields).

Attached patch with correction.

The first patch is actually not needed to fix the bug - I made this change to eliminate complexity which made code analysis more difficult to me.

Zbigniew Chyla <zchyla_nokia>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by esr (Updated the item)
  • -email is unavailable- added by zchyla_nokia (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-03 esr Open/ClosedOpen Closed
    2015-04-28 esr StatusNone Fixed
        Assigned toNone esr
    2015-04-24 zchyla_nokia Attached File- Added 0001-Replace-overly-complex-memcpy-with-struct-assignment.patch, #33772
        Attached File- Added 0002-Use-correct-size-of-segment-for-shared-mem-export.patch, #33773

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code