summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/smipcie
diff options
context:
space:
mode:
authorharperchen <harperchen1110@gmail.com>2023-03-02 13:39:05 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-03-19 22:55:33 +0100
commit47e8b73bc35d7c54642f78e498697692f6358996 (patch)
tree7cf3c7da143b75e4d156d8fe3c484a24179f3db2 /drivers/media/pci/smipcie
parentffa331d9bf9407655fc4c4d57dcc92ed2868e326 (diff)
downloadlinux-stable-47e8b73bc35d7c54642f78e498697692f6358996.tar.gz
linux-stable-47e8b73bc35d7c54642f78e498697692f6358996.tar.bz2
linux-stable-47e8b73bc35d7c54642f78e498697692f6358996.zip
media: cx23885: Fix a null-ptr-deref bug in buffer_prepare() and buffer_finish()
When the driver calls cx23885_risc_buffer() to prepare the buffer, the function call dma_alloc_coherent may fail, resulting in a empty buffer risc->cpu. Later when we free the buffer or access the buffer, null ptr deref is triggered. This bug is similar to the following one: https://git.linuxtv.org/media_stage.git/commit/?id=2b064d91440b33fba5b452f2d1b31f13ae911d71. We believe the bug can be also dynamically triggered from user side. Similarly, we fix this by checking the return value of cx23885_risc_buffer() and the value of risc->cpu before buffer free. Signed-off-by: harperchen <harperchen1110@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/pci/smipcie')
0 files changed, 0 insertions, 0 deletions