summary refs log tree commit diff stats
path: root/docs/devel/secure-coding-practices.rst
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-07-23 16:09:27 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2024-07-25 15:57:38 -0400
commit851495571d14fe2226c52b9d423f88a4f5460836 (patch)
treebe03a258d2ad2dec1bc0f623e1965c4696eda45f /docs/devel/secure-coding-practices.rst
parent029e13a8a56a2931e7c24c0db52ae7256b932cb0 (diff)
downloadfocaccia-qemu-851495571d14fe2226c52b9d423f88a4f5460836.tar.gz
focaccia-qemu-851495571d14fe2226c52b9d423f88a4f5460836.zip
util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()
aio_context_set_thread_pool_params() takes two int64_t arguments to
set the minimum and maximum number of threads in the pool.  We do
some bounds checking on these, but we don't catch the case where the
inputs are negative.  This means that later in the function when we
assign these inputs to the AioContext::thread_pool_min and
::thread_pool_max fields, which are of type int, the values might
overflow the smaller type.

A negative number of threads is meaningless, so make
aio_context_set_thread_pool_params() return an error if either min or
max are negative.

Resolves: Coverity CID 1547605
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240723150927.1396456-1-peter.maydell@linaro.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'docs/devel/secure-coding-practices.rst')
0 files changed, 0 insertions, 0 deletions