From 3ad5f86cf6803204b98760cdce0c56ef6d79bccd Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 3 Jun 2016 08:15:21 +0200 Subject: 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 --- cpukit/rtems/src/semrelease.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpukit/rtems/src/semrelease.c') diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c index ccd4e63d64..39c467da62 100644 --- a/cpukit/rtems/src/semrelease.c +++ b/cpukit/rtems/src/semrelease.c @@ -64,9 +64,10 @@ rtems_status_code rtems_semaphore_release( rtems_id id ) ); break; case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL: - _CORE_recursive_mutex_Surrender_no_protocol_classic( + _CORE_recursive_mutex_Surrender_no_protocol( &the_semaphore->Core_control.Mutex.Recursive, _Semaphore_Get_operations( the_semaphore ), + executing, &queue_context ); status = STATUS_SUCCESSFUL; -- cgit v1.2.3