#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 06/03/16 at 06:24:47 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 06/03/16 at 06:25:16 by Chris Johns

Description: modified (diff)

comment:3 Changed on 06/06/16 at 11:17:00 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 12/23/16 at 14:10:09 by Sebastian Huber

Priority: normalhigh

comment:5 Changed on 01/23/17 at 12:46:12 by Sebastian Huber

Resolution: fixed
Status: newclosed
Last edited on 01/23/17 at 12:46:24 by Sebastian Huber (previous) (diff)

comment:6 Changed on 05/11/17 at 07:31:02 by Sebastian Huber

Milestone: 4.124.12.0

comment:7 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.