RTEMS | posix/aio_misc.c: Uninitialized lock use (#5132)

Alessandro Nardin (@AlessandroNardin) gitlab at rtems.org
Thu Sep 26 10:16:16 UTC 2024



Alessandro Nardin created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5132



## Summary

Coverity CID 1619695

When an error occurs during lock initialization in rtems_aio_init(), the error is not handled and the code ends up accessing uninitialized memory.

```
** CID 1619695:  API usage errors  (LOCK)
/cpukit/posix/src/aio_misc.c: 153 in rtems_aio_init()


________________________________________________________________________________________________________
*** CID 1619695:  API usage errors  (LOCK)
/cpukit/posix/src/aio_misc.c: 153 in rtems_aio_init()
147     
148       aio_request_queue.active_threads = 0;
149       aio_request_queue.idle_threads = 0;
150       atomic_init( &aio_request_queue.queued_requests, 0 );
151       aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
152     
>>>     CID 1619695:  API usage errors  (LOCK)
>>>     "pthread_mutex_unlock" uses "aio_request_queue.mutex" in an uninitialized state. [Note: The source code implementation of the function has been overridden by a builtin model.]
153       pthread_mutex_unlock( &aio_request_queue.mutex );
154     
155       return result;
156     }
157     
158     rtems_aio_request *init_write_req( struct aiocb* aiocbp )
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5132
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240926/001a8431/attachment.htm>


More information about the bugs mailing list