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] [day] [month] [year] [list]
Date:	Sat, 2 May 2009 16:17:16 +0200
From:	Hans Verkuil <hverkuil@...all.nl>
To:	Julia Lawall <julia@...u.dk>
Cc:	mchehab@...radead.org, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: tvaudio.c: possible problem with V4L2_TUNER_MODE_MONO

On Saturday 02 May 2009 15:19:03 Julia Lawall wrote:
> The file drivers/media/video/tvaudio.c contains the following code:
>
> (starting at line 1257 in a recent linux-next)
>
> 		if (mode & V4L2_TUNER_MODE_MONO)
> 			s1 |= TDA8425_S1_STEREO_MONO;
> 		if (mode & V4L2_TUNER_MODE_STEREO)
> 			s1 |= TDA8425_S1_STEREO_SPATIAL;
>
> (starting at line 1856 in a recent linux-next)
>
> 	if (mode & V4L2_TUNER_MODE_MONO)
> 		vt->rxsubchans |= V4L2_TUNER_SUB_MONO;
> 	if (mode & V4L2_TUNER_MODE_STEREO)
> 		vt->rxsubchans |= V4L2_TUNER_SUB_STEREO;
>
> The only possible value of V4L2_TUNER_MODE_MONO, however, seems to be 0,
> as defined in include/linux/videodev2.h, and thus the first test in each
> case is never true.  Is this what is intended, or should the tests be
> expressed in another way?

Hi Julia,

Nope, this isn't intended. A grep over the v4l sources shows that it is 
handled incorrectly in several other drivers as well. I'll prepare patches 
to fix all these drivers.

Thanks,

	Hans

>
> julia
>
> This problem was found using the following semantic match:
> (http://www.emn.fr/x-info/coccinelle/)
>
> @r expression@
> identifier C;
> expression E;
> position p;
> @@
>
> (
>  E & C@p && ...
>
>  E & C@p || ...
> )
>
> @s@
> identifier r.C;
> position p1;
> @@
>
> #define C 0
>
> @t@
> identifier r.C;
> expression E != 0;
> @@
>
> #define C E
>
> @script:python depends on s && !t@
> p << r.p;
> C << r.C;
> @@
>
> cocci.print_main("and with 0", p)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ