[RTEMS Project] #4738: psxrwlock01 uses uninitialized lock that may or may not autoinitialize

RTEMS trac trac at rtems.org
Thu Oct 6 14:29:15 UTC 2022


#4738: psxrwlock01 uses uninitialized lock that may or may not autoinitialize
-----------------------------------+--------------------
  Reporter:  Lucian-Raul Silistru  |      Owner:  joel@…
      Type:  defect                |     Status:  new
  Priority:  normal                |  Milestone:
 Component:  test                  |    Version:
  Severity:  normal                |   Keywords:
Blocked By:                        |   Blocking:
-----------------------------------+--------------------
 When running psxrwlock01, the NULL argument check from
 testsuites/psxtests/psxrwlock01/test.c:458 uses the uninitialized rwlock.
 Depending on memory content this lock may or may not be auto-initialized.
 The cases I can see are:

 1. if memory is zeroed, it will auto a new lock and acquire without
 checking abstime value. Will return SUCCESS and test will fail.
 2. if memory is random it will instantly return EINVAL from
 autoinitialization, again not checking abstime. Test will pass.
 3. if memory somehow ends up over another older lock structure, it will
 try to take over that lock - not encountered this specific behaviour.

--
Ticket URL: <http://devel.rtems.org/ticket/4738>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list