]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firmware: qcom: uefisecapp: fix efivars registration race
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 20 Jan 2025 15:10:00 +0000 (16:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:30 +0000 (22:03 +0100)
commitc4e37b381a7a243c298a4858fc0a5a74e737c79a
tree4b58e21549791b9e64507febb50b440bba7d3aeb
parent54ccfef4377345a79b026e3c046fa23ff4b1927e
firmware: qcom: uefisecapp: fix efivars registration race

commit da8d493a80993972c427002684d0742560f3be4a upstream.

Since the conversion to using the TZ allocator, the efivars service is
registered before the memory pool has been allocated, something which
can lead to a NULL-pointer dereference in case of a racing EFI variable
access.

Make sure that all resources have been set up before registering the
efivars.

Fixes: 6612103ec35a ("firmware: qcom: qseecom: convert to using the TZ allocator")
Cc: stable@vger.kernel.org # 6.11
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250120151000.13870-1-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/qcom/qcom_qseecom_uefisecapp.c