lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200821102614.GA490417@PWN>
Date:   Fri, 21 Aug 2020 06:26:14 -0400
From:   Peilin Ye <yepeilin.cs@...il.com>
To:     Hans Verkuil <hverkuil@...all.nl>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-media@...r.kernel.org,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        syzkaller-bugs@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix
 global-out-of-bounds read in precalculate_color()

On Fri, Aug 21, 2020 at 12:12:28PM +0200, Hans Verkuil wrote:
> Arrgh! I know what this is. /dev/video6 corresponds to the Metadata output
> device of vivid, and that metadata format sets brightness, contrast,
> saturation and hue:
> 
> struct vivid_meta_out_buf {
>         u16     brightness;
>         u16     contrast;
>         u16     saturation;
>         s16     hue;
> };
> 
> vivid_meta_out_process() calls tpg_s_* functions to set these values. But
> this is wrong, it should set the corresponding V4L2 controls instead since
> calling these tpg_s_* functions bypasses all range checks. It also will
> not update the controls themselves, so they are out-of-sync with the actual
> values. I.e. the test pattern generator uses different values compared to
> the values in the controls.
> 
> So two patches are needed:
> 
> 1) a patch for include/media/tpg/v4l2-tpg.h where tpg_s_hue will clamp the
> hue value to the valid range. This to prevent anyone else from setting invalid
> hue values in the tpg.
> 
> 2) a patch for drivers/media/test-drivers/vivid/vivid-meta-out.c where,
> instead of calling the tpg_s_* functions in vivid_meta_out_process(), it
> calls instead:
> 
>         v4l2_ctrl_s_ctrl(dev->brightness, meta->brightness);
>         v4l2_ctrl_s_ctrl(dev->contrast, meta->contrast);
> 	etc.
> 
> Do patch 2 first and test with syzkaller to check that by going through the
> controls this issue is resolved. Since with that approach the tpg should
> always get valid hue values.

Ah, now it all makes sense! Thank you! I will do them now.

Peilin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ