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: <Pine.LNX.4.64.0710221657450.21323@pub1.ifh.de>
Date:	Mon, 22 Oct 2007 17:10:07 +0200 (CEST)
From:	Patrick Boettcher <patrick.boettcher@...y.de>
To:	Adrian Bunk <bunk@...nel.org>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	v4l-dvb maintainer list <v4l-dvb-maintainer@...uxtv.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [v4l-dvb-maintainer] DVB: BANDWIDTH_TO_KHZ strangeness

Hi all,

This coverity checker is great. He even finds all the things which are 
there because I'm lazy ;) .

The dibXXXX-drivers are all generated from our internal drivers to have at 
least something for Linux. Because of no time there is no dedicated 
source for the kernel but just the processed one.

The particular issue here is, that the internal architecture supports a 
variable bandwidth while the linux-dvb architecture only has 3 fixed 
values. 

I know that in the future the linux-dvb-API will also support other 
bandwidths so I'm begging for mercy for those 3 things here to not get too 
much out-of-sync with our internal code.

thanks,
Patrick.

On Sun, 14 Oct 2007, Adrian Bunk wrote:
> drivers/media/dvb/frontends/dibx000_common.h contains:
> 
> <--  snip  -->
> 
> ...
> #define BANDWIDTH_TO_KHZ(v) ( (v) == BANDWIDTH_8_MHZ  ? 8000 : \
>                              (v) == BANDWIDTH_7_MHZ  ? 7000 : \
>                              (v) == BANDWIDTH_6_MHZ  ? 6000 : 8000 )
> ...
> 
> <--  snip  -->
> 
> 
> Commit b6884a17fc70e979ef34e4b5560988b522bb50a0 added to both of 
> drivers/media/dvb/frontends/dib7000{m,p}.c:
> 
> <--  snip  -->
> 
> ...
>         factor = BANDWIDTH_TO_KHZ(ch->u.ofdm.bandwidth);
>         if (factor >= 5000)
>                 factor = 1;
>         else
>                 factor = 6;
> ...
> 
> <--  snip  -->
> 
> 
> factor < 5000 is obviously never possible.
> 
> drivers/media/dvb/frontends/dib0070.c contains a similar assumption that 
> BANDWIDTH_TO_KHZ() could result in values other than {6,7,8}000
> (I haven't checked whether there are more such assumptions in other 
> places).
> 
> Spotted by the Coverity checker.
> 
> 
> cu
> Adrian
> 
> -- 
> 
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
> 
> 
> _______________________________________________
> v4l-dvb-maintainer mailing list
> v4l-dvb-maintainer@...uxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/v4l-dvb-maintainer
> 

-
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