Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#2926 assigned defect

Coverity Reports Multiple Out of Bounds Accesses in rtd-mdreloc-sparc.c — at Version 1

Reported by: Joel Sherrill Owned by: chrisj@…
Priority: normal Milestone:
Component: lib/dl Version:
Severity: normal Keywords: coverity
Cc: Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

Coverity spots an out of bounds read in rtl-mdreloc-sparc.c. Given the comment at the top that it was "Taken from NetBSD and stripped of the relocations not needed on RTEMS", I am unsure how to correlate the code back to the original to see if the issue exists upstream. Also I do not know where in the NetBSD source this came from.

The first issue is: https://scan5.coverity.com/reports.htm#v29808/p10069/fileInstanceId=109360252&defectInstanceId=30967451&mergedDefectId=1255330

The long analysis ends with:

226

CID 1255330 (#1 of 1): Out-of-bounds read (OVERRUN)

  1. overrun-local: Overrunning array reloc_target_bitmask of 24 4-byte elements at element index 45 (byte offset 180) using index type (which evaluates to 45).

227 mask = RELOC_VALUE_BITMASK (type);
228 value >>= RELOC_VALUE_RIGHTSHIFT (type);
229 value &= mask;

The others are:

https://scan5.coverity.com/reports.htm#v29808/p10069/fileInstanceId=109360252&defectInstanceId=30967452&mergedDefectId=1255332
https://scan5.coverity.com/reports.htm#v29808/p10069/fileInstanceId=109360252&defectInstanceId=30967450&mergedDefectId=1255342

Change History (1)

comment:1 Changed on 03/14/17 at 21:28:40 by Joel Sherrill

Description: modified (diff)
Summary: Out of Bounds Access in rtd-mdreloc-sparc.cCoverity Reports Multiple Out of Bounds Accesses in rtd-mdreloc-sparc.c
Note: See TracTickets for help on using tickets.