Skip to contentSkip to conversation

drivers/media/video/bt866.c: array overflows

DISCUSSION Adrian Bunk 2 participants 4 messages Aug 14, 2006 – Aug 15, 2006

lore
Share & tools
lore
#0 lore raw

The Coverity checker spotted the following two array overflows:

<-- snip -->

...
struct bt866 {
...

        unsigned char reg[128];

...
}
...
static int bt866_do_command(struct bt866 *encoder,
unsigned int cmd, void *arg)
{
...

                val = encoder->reg[0xdc];
...
                bt866_write(encoder, 0xdc, val);

...
}
...
static int bt866_write(struct bt866 *encoder,
unsigned char subaddr, unsigned char data)
{
...

        encoder->reg[subaddr] = data;

...
}
...

<-- snip -->

The two bugs are obvious:
0xdc = 220 >= 128

cu
Adrian

Signature · 6 lines
    Gentoo kernels are 42 times more popular than SUSE kernels among
    KLive users  (a service by SUSE contractor Andrea Arcangeli that
    gathers data about kernels from many users worldwide).

       There are three kinds of lies: Lies, Damn Lies, and Statistics.
                                                    Benjamin Disraeli
#1 lore raw
Quoted 1 line · On Tue, 15 Aug 2006 01:23:37 +0200 Adrian Bunk <[email protected]> wrote:

The Coverity checker spotted the following two array overflows:

Nice coverity checker! *pat pat*

Now, a question: Where can I find the latest version of the files that concern the avs6eyes driver? In april, I got this mail that informed me that the avs6eyes driver patch had been removed from the -mm tree. I figured that it was removed because of the lack of internal V4L2 support when V4L1 was about to be chucked out from the kernel. I looked around a little to see if I could find the driver, but I couldn't.

Obviously, as you've found bugs in it, I didn't look in the right places. Where, pray tell, did the little critter go?

Getting a new job and moving to another city has hampered me in my efforts to work on the driver, that's why I've been so quiet.

Quoted 2 lines

The two bugs are obvious:
0xdc = 220 >= 128

Gotta fix that. Good work.

/Sam

#2 lore raw
Quoted 11 lines · Martin Samuelsson
Quoted 1 line · On Tue, 15 Aug 2006 01:23:37 +0200 Adrian Bunk <[email protected]> wrote:

The Coverity checker spotted the following two array overflows:

Nice coverity checker! *pat pat*

Now, a question: Where can I find the latest version of the files that concern the avs6eyes driver? In april, I got this mail that informed me that the avs6eyes driver patch had been removed from the -mm tree. I figured that it was removed because of the lack of internal V4L2 support when V4L1 was about to be chucked out from the kernel. I looked around a little to see if I could find the driver, but I couldn't.

Obviously, as you've found bugs in it, I didn't look in the right places. Where, pray tell, did the little critter go?
...

It's in 2.6.18-rc4.

Quoted 1 line

/Sam

cu
Adrian

Signature · 4 lines
       "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
#3 lore raw
Quoted 5 lines · On Tue, 15 Aug 2006 20:13:20 +0200 Adrian Bunk <[email protected]> wrote:
Quoted 2 lines · Martin Samuelsson

Obviously, as you've found bugs in it, I didn't look in the right places. Where, pray tell, did the little critter go?
...

It's in 2.6.18-rc4.

Nice, it hid in Linus' tree for a while, then. Compiling it now.

Thanks!

/Sam