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: <4EF8B42C.2020402@lwfinger.net>
Date:	Mon, 26 Dec 2011 11:51:40 -0600
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Guennadi Liakhovetski <g.liakhovetski@....de>
CC:	Rafał Miłecki <zajec5@...il.com>,
	linux-wireless@...r.kernel.org,
	"John W. Linville" <linville@...driver.com>,
	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	b43-dev <b43-dev@...ts.infradead.org>
Subject: Re: [PATCH] b43: fix regression in PIO case

On 12/26/2011 11:28 AM, Guennadi Liakhovetski wrote:
> This patch fixes the regression, introduced by
>
> commit 17030f48e31adde5b043741c91ba143f5f7db0fd
> From: Rafał Miłecki<zajec5@...il.com>
> Date: Thu, 11 Aug 2011 17:16:27 +0200
> Subject: [PATCH] b43: support new RX header, noticed to be used in 598.314+ fw
>
> in PIO case.
>
> Signed-off-by: Guennadi Liakhovetski<g.liakhovetski@....de>
> ---
> diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
> index ce8a4bd..b64b64c 100644
> --- a/drivers/net/wireless/b43/pio.c
> +++ b/drivers/net/wireless/b43/pio.c
> @@ -617,9 +617,19 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
>   	const char *err_msg = NULL;
>   	struct b43_rxhdr_fw4 *rxhdr =
>   		(struct b43_rxhdr_fw4 *)wl->pio_scratchspace;
> +	size_t rxhdr_size = sizeof(*rxhdr);
>
>   	BUILD_BUG_ON(sizeof(wl->pio_scratchspace)<  sizeof(*rxhdr));
> -	memset(rxhdr, 0, sizeof(*rxhdr));
> +	switch (dev->fw.hdr_format) {
> +	case B43_FW_HDR_410:
> +	case B43_FW_HDR_351:
> +		rxhdr_size -= sizeof(rxhdr->format_598) -
> +			sizeof(rxhdr->format_351);
> +		break;
> +	case B43_FW_HDR_598:
> +		break;
> +	}

I do not think the above will work for format_410. By my count, the format_410 
struct is 4 bytes longer than the format_351 struct.

Even if it does work, I suggest using the following:

	size_t rxhdr_size;

    	BUILD_BUG_ON(sizeof(wl->pio_scratchspace)<  sizeof(*rxhdr));
	switch (dev->fw.hdr_format) {
	case B43_FW_HDR_351:
		rxhdr_size = sizeof(rxhdr->format_351);
		break;
	case B43_FW_HDR_410:
etc.


Larry
--
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