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

 
 

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

Submitted by:  Zbigniew Chyla <zchyla_nokia>
Submitted on:  Fri 24 Apr 2015 04:15:11 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eric S. Raymond <esr>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Jun 2015 02:13:03 PM UTCesrOpen/ClosedOpen=>Closed
    Tue 28 Apr 2015 12:49:27 PM UTCesrStatusNone=>Fixed
      Assigned toNone=>esr
    Fri 24 Apr 2015 04:15:11 PM UTCzchyla_nokiaAttached 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.1-cleanup1