Patch "media: vivid: Fix global-out-of-bounds read in precalculate_color()" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: vivid: Fix global-out-of-bounds read in precalculate_color()

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-vivid-fix-global-out-of-bounds-read-in-precalc.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c8df67bd3406a3649eedcbafb5603f961e7a16c8
Author: Peilin Ye <yepeilin.cs@xxxxxxxxx>
Date:   Fri Aug 21 14:46:45 2020 +0200

    media: vivid: Fix global-out-of-bounds read in precalculate_color()
    
    [ Upstream commit e3158a5e7e661786b3ab650c7e4d21024e8eff0f ]
    
    vivid_meta_out_process() is setting `brightness`, `contrast`, `saturation`
    and `hue` using tpg_s_*(). This is wrong, since tpg_s_*() do not provide
    range checks. Using tpg_s_*() here also makes the control framework
    out-of-sync with the actual values. Use v4l2_ctrl_s_ctrl() instead.
    
    This issue has been reported by syzbot as an out-of-bounds read bug in
    precalculate_color().
    
    Reported-and-tested-by: syzbot+02d9172bf4c43104cd70@xxxxxxxxxxxxxxxxxxxxxxxxx
    Link: https://syzkaller.appspot.com/bug?extid=02d9172bf4c43104cd70
    
    Fixes: 746facd39370 ("media: vivid: Add metadata output support")
    Suggested-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Peilin Ye <yepeilin.cs@xxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/test-drivers/vivid/vivid-meta-out.c b/drivers/media/test-drivers/vivid/vivid-meta-out.c
index ff8a039aba72e..95835b52b58fc 100644
--- a/drivers/media/test-drivers/vivid/vivid-meta-out.c
+++ b/drivers/media/test-drivers/vivid/vivid-meta-out.c
@@ -164,10 +164,11 @@ void vivid_meta_out_process(struct vivid_dev *dev,
 {
 	struct vivid_meta_out_buf *meta = vb2_plane_vaddr(&buf->vb.vb2_buf, 0);
 
-	tpg_s_brightness(&dev->tpg, meta->brightness);
-	tpg_s_contrast(&dev->tpg, meta->contrast);
-	tpg_s_saturation(&dev->tpg, meta->saturation);
-	tpg_s_hue(&dev->tpg, meta->hue);
+	v4l2_ctrl_s_ctrl(dev->brightness, meta->brightness);
+	v4l2_ctrl_s_ctrl(dev->contrast, meta->contrast);
+	v4l2_ctrl_s_ctrl(dev->saturation, meta->saturation);
+	v4l2_ctrl_s_ctrl(dev->hue, meta->hue);
+
 	dprintk(dev, 2, " %s brightness %u contrast %u saturation %u hue %d\n",
 		__func__, meta->brightness, meta->contrast,
 		meta->saturation, meta->hue);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux