CVE-2024-50175

In the Linux kernel, the following vulnerability has been resolved: media: qcom: camss: Remove use_count guard in stop_streaming The use_count check was introduced so that multiple concurrent Raw Data Interfaces RDIs could be driven by different virtual channels VCs on the CSIPHY input driving the video pipeline. This is an invalid use of use_count though as use_count pertains to the number of times a video entity has been opened by user-space not the number of active streams. If use_count and stream-on count don't agree then stop_streaming() will break as is currently the case and has become apparent when using CAMSS with libcamera's released softisp 0.3. The use of use_count like this is a bit hacky and right now breaks regular usage of CAMSS for a single stream case. Stopping qcam results in the splat below, and then it cannot be started again and any attempts to do so fails with -EBUSY. [ 1265.509831] WARNING: CPU: 5 PID: 919 at drivers/media/common/videobuf2/videobuf2-core.c:2183 __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] ... [ 1265.510630] Call trace: [ 1265.510636] __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] [ 1265.510648] vb2_core_streamoff+0x24/0xcc [videobuf2_common] [ 1265.510660] vb2_ioctl_streamoff+0x5c/0xa8 [videobuf2_v4l2] [ 1265.510673] v4l_streamoff+0x24/0x30 [videodev] [ 1265.510707] __video_do_ioctl+0x190/0x3f4 [videodev] [ 1265.510732] video_usercopy+0x304/0x8c4 [videodev] [ 1265.510757] video_ioctl2+0x18/0x34 [videodev] [ 1265.510782] v4l2_ioctl+0x40/0x60 [videodev] ... [ 1265.510944] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state [ 1265.511175] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 1 in active state [ 1265.511398] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 2 in active st One CAMSS specific way to handle multiple VCs on the same RDI might be: - Reference count each pipeline enable for CSIPHY, CSID, VFE and RDIx. - The video buffers are already associated with msm_vfeN_rdiX so release video buffers when told to do so by stop_streaming. - Only release the power-domains for the CSIPHY, CSID and VFE when their internal refcounts drop. Either way refusing to release video buffers based on use_count is erroneous and should be reverted. The silicon enabling code for selecting VCs is perfectly fine. Its a "known missing feature" that concurrent VCs won't work with CAMSS right now. Initial testing with this code didn't show an error but, SoftISP and "real" usage with Google Hangouts breaks the upstream code pretty quickly, we need to do a partial revert and take another pass at VCs. This commit partially reverts commit 89013969e232 ("media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels")
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

27 Nov 2024, 20:16

Type Values Removed Values Added
First Time Linux linux Kernel
Linux
References () https://git.kernel.org/stable/c/25f18cb1b673220b76a86ebef8e7fb79bd303b27 - () https://git.kernel.org/stable/c/25f18cb1b673220b76a86ebef8e7fb79bd303b27 - Patch
References () https://git.kernel.org/stable/c/a975db8aea152f9907aa53a7f517e557ccb40da3 - () https://git.kernel.org/stable/c/a975db8aea152f9907aa53a7f517e557ccb40da3 - Patch
References () https://git.kernel.org/stable/c/c2218a82f795dc3d0b6210bcaa3d9c5ca736fcd9 - () https://git.kernel.org/stable/c/c2218a82f795dc3d0b6210bcaa3d9c5ca736fcd9 - Patch
References () https://git.kernel.org/stable/c/d7d4dde3decef1b5aa1f5c390147f79aae412dee - () https://git.kernel.org/stable/c/d7d4dde3decef1b5aa1f5c390147f79aae412dee - Patch
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CWE NVD-CWE-noinfo

08 Nov 2024, 19:01

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: media: qcom: camss: Eliminar la protección use_count en stop_streaming La comprobación use_count se introdujo para que varias interfaces de datos sin procesar (RDI) simultáneas pudieran ser controladas por diferentes canales virtuales VC en la entrada CSIPHY que controlan la canalización de vídeo. Sin embargo, este es un uso inválido de use_count, ya que use_count pertenece a la cantidad de veces que una entidad de vídeo ha sido abierta por el espacio de usuario, no a la cantidad de transmisiones activas. Si use_count y stream-on count no coinciden, stop_streaming() se romperá, como es el caso actualmente y se ha hecho evidente al usar CAMSS con el softisp 0.3 lanzado por libcamera. El uso de use_count de esta manera es un poco chapucero y, en este momento, interrumpe el uso regular de CAMSS para un solo caso de transmisión. Detener qcam da como resultado el splat a continuación, y luego no se puede iniciar de nuevo y cualquier intento de hacerlo falla con -EBUSY. [ 1265.509831] ADVERTENCIA: CPU: 5 PID: 919 en drivers/media/common/videobuf2/videobuf2-core.c:2183 __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] ... [ 1265.510630] Rastreo de llamadas: [ 1265.510636] __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] [ 1265.510648] vb2_core_streamoff+0x24/0xcc [videobuf2_common] [ 1265.510660] vb2_ioctl_streamoff+0x5c/0xa8 [videobuf2_v4l2] [ 1265.510673] v4l_streamoff+0x24/0x30 [videodev] [ 1265.510707] __video_do_ioctl+0x190/0x3f4 [videodev] [ 1265.510732] video_usercopy+0x304/0x8c4 [videodev] [ 1265.510757] video_ioctl2+0x18/0x34 [videodev] [ 1265.510782] v4l2_ioctl+0x40/0x60 [videodev] ... [ 1265.510944] videobuf2_common: error del controlador: la operación stop_streaming deja el búfer 0 en estado activo [ 1265.511175] videobuf2_common: error del controlador: la operación stop_streaming deja el búfer 1 en estado activo [ 1265.511398] videobuf2_common: error del controlador: la operación stop_streaming deja el buffer 2 en st activo Una forma específica de CAMSS para manejar múltiples VC en el mismo RDI podría ser: - Conteo de referencia de cada canalización habilitada para CSIPHY, CSID, VFE y RDIx. - Los búferes de video ya están asociados con msm_vfeN_rdiX, por lo que libera los búferes de video cuando stop_streaming te lo indica. - Solo libera los dominios de energía para CSIPHY, CSID y VFE cuando sus recuentos de referencia internos caen. De cualquier manera, negarse a liberar búferes de video según use_count es erróneo y debe revertirse. El código de habilitación de silicio para seleccionar VC está perfectamente bien. Es una "característica faltante conocida" que los VC simultáneos no funcionarán con CAMSS en este momento. Las pruebas iniciales con este código no mostraron ningún error, pero SoftISP y el uso "real" con Google Hangouts rompen el código ascendente con bastante rapidez. Necesitamos hacer una reversión parcial y volver a pasar por los VC. Esta confirmación revierte parcialmente el commit 89013969e232 ("media: camss: sm8250: Pipeline iniciando y deteniéndose para múltiples canales virtuales")

08 Nov 2024, 06:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-11-08 06:15

Updated : 2024-11-27 20:16


NVD link : CVE-2024-50175

Mitre link : CVE-2024-50175

CVE.ORG link : CVE-2024-50175


JSON object : View

Products Affected

linux

  • linux_kernel