]> git.proxmox.com Git - mirror_qemu.git/commit
audio/jackaudio: Avoid dynamic stack allocation in qjack_process()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 18 Aug 2023 15:58:46 +0000 (16:58 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Sep 2023 15:07:14 +0000 (16:07 +0100)
commit07ffc4b90f0c2b4ec13ba804fdffc56d49dff93c
tree53b1d261522bb45a9cd6258d18aba7b4729f1a83
parentd71c3d305980b38c6e6794da7401172ac0fec891
audio/jackaudio: Avoid dynamic stack allocation in qjack_process()

Avoid a dynamic stack allocation in qjack_process().  Since this
function is a JACK process callback, we are not permitted to malloc()
here, so we allocate a working buffer in qjack_client_init() instead.

The codebase has very few VLAs, and if we can get rid of them all we
can make the compiler error on new additions.  This is a defensive
measure against security bugs where an on-stack dynamic allocation
isn't correctly size-checked (e.g.  CVE-2021-3527).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-id: 20230818155846.1651287-3-peter.maydell@linaro.org
audio/jackaudio.c