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: <1392785935.2570.16.camel@Linux>
Date:	Tue, 18 Feb 2014 20:58:55 -0800
From:	Don Fry <pcnet32@...ntier.com>
To:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] pcnet32: fix reallocation error

-----Original Message-----
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Subject: Re: [PATCH net-next 1/2] pcnet32: fix reallocation error
Date: Tue, 18 Feb 2014 21:29:00 +0900

>Don Fry wrote:
>> pcnet32_realloc_rx_ring() only worked on the first log2 number of
>> entries in the receive ring instead of the all the entries.
>> Replaced "1 << size" with more descriptive variable.
>
>>  	/* first copy the current receive buffers */
>> -	overlap = min(size, lp->rx_ring_size);
>> +	overlap = min(entries, lp->rx_ring_size);
>
>>  	/* now allocate any new buffers needed */
>> -	for (; new < size; new++) {
>> +	for (; new < entries; new++) {
>>
>Until this fix, lp->rx_skbuff[size...(1<<size)-1] were not allocated by
>netdev_alloc_skb() and lp->rx_ring_dma_addr[size...(1<<size)-1] were not mapped
>by pci_map_single(), right?
>
>Since lp->rx_ring_size was set to (1<<size), wasn't there possibility that
>something bad happens by accessing lp->rx_skbuff[] and lp->rx_ring_dma_addr[]
>up to (1<<size)-1 ? (In other words, don't we want to backport this fix?)
>

I looked into this when testing.  If the device is operational
(netif_running) when the ring is resized, it will do pcnet32_restart and
make sure all rx buffers are full.  If the device is not operational it
will leave the ring partially full until it is opened and then the ring
is filled via pcnet32_init_ring().  Another thing that could happen
while it is down is that a selftest is done (offline) which also calls
pcnet32_restart and makes sure the ring is full.  I could not find a
case that would cause a problem.  No-one has reported this in the last 8
years so it does not look like backporting this fix is needed, in my
opinion.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ