#2725 closed defect (fixed)

Classic binary semaphores without a locking protocol can be released by everyone

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: high Milestone: 5.1
Component: score Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Chris Johns)

The Classic binary semaphores without a locking protocol can be released by everyone, e.g. in contrast to the POSIX mutexes (all variants) or the Classic binary semphores with priority inheritance or ceiling, there is no owner check in the release path.

This behaviour is a bit unexpected and not documented.

The following test case fails in case an owner check is added:

*** BEGIN OF TEST SP 42 ***
Exercising blocking discipline w/extract in FIFO order 
Exercising blocking discipline w/unblock in FIFO order
TA00 - unblocked - OK

rtems_semaphore_delete FAILED -- expected (RTEMS_SUCCESSFUL) got (RTEMS_RESOURCE_IN_USE)

This is actually a bug in the test, since an available mutex is released again.

Change History (7)

comment:1 Changed on Jun 3, 2016 at 6:24:47 AM by Sebastian Huber

Component: Generalcpukit
Summary: Classic binary semaphores without a locking protocol can be release by everyoneClassic binary semaphores without a locking protocol can be released by everyone

comment:2 Changed on Jun 3, 2016 at 6:25:16 AM by Chris Johns

Description: modified (diff)

comment:3 Changed on Jun 6, 2016 at 11:17:00 AM by Sebastian Huber <sebastian.huber@…>

In 3ad5f86cf6803204b98760cdce0c56ef6d79bccd/rtems:

rtems: Fix no protocol mutex release

The Classic binary semaphores without a locking protocol
(RTEMS_BINARY_SEMAPHORE) could be released by everyone, e.g. in contrast
to the POSIX mutexes (all variants) or the Classic binary semphores with
priority inheritance or ceiling, there was no owner check in the release
path.

This behaviour was a bit unexpected and not documented. Add an owner
check to the release path. Update sptests/sp42 accordingly.

This change has nothing to do with the simple binary semaphores
(RTEMS_SIMPLE_BINARY_SEMAPHORE) which have no owner at all.

Update #2725

comment:4 Changed on Dec 23, 2016 at 2:10:09 PM by Sebastian Huber

Priority: normalhigh

comment:5 Changed on Jan 23, 2017 at 12:46:12 PM by Sebastian Huber

Resolution: fixed
Status: newclosed
Last edited on Jan 23, 2017 at 12:46:24 PM by Sebastian Huber (previous) (diff)

comment:6 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:7 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.