* [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
2012-09-10 15:04 ` Eric Dumazet
@ 2012-09-10 17:55 ` Eric Dumazet
2012-09-10 18:34 ` Larry Finger
0 siblings, 1 reply; 7+ messages in thread
From: Eric Dumazet @ 2012-09-10 17:55 UTC (permalink / raw)
To: Larry Finger; +Cc: linville, linux-wireless, netdev
From: Eric Dumazet <edumazet@google.com>
64bit arches have a buggy r8712u driver, let's fix it.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/staging/rtl8712/recv_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 0e26d5f..495ee12 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
if (skb == NULL)
goto _recv_indicatepkt_drop;
skb->data = precv_frame->u.hdr.rx_data;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
- precv_frame->u.hdr.rx_head);
-#else
- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
-#endif
skb->len = precv_frame->u.hdr.len;
+ skb_set_tail_pointer(skb, skb->len);
if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
2012-09-10 17:55 ` [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt() Eric Dumazet
@ 2012-09-10 18:34 ` Larry Finger
0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2012-09-10 18:34 UTC (permalink / raw)
To: Eric Dumazet; +Cc: linville, linux-wireless, netdev, Greg Kroah-Hartman
On 09/10/2012 12:55 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
Eric,
Thanks for this. It works for me. I had looked at this code a number of times,
but for some reason, I thought that the u.hdr.rx_yyyy parameters were like
32-bit systems and that all 4 values were pointers, and not like 64-bit systems,
thus the funny conversion. Strange that the bug was never triggered until commit
c8628155ece3 - this code has not changed since the driver was accepted into 2.6.37.
A few points on the patch. As the driver is in staging, the patch needs to go to
Greg Kroah-Hartman. In addition, please add the "Cc: Stable
<stable@vger.kernel.org>" line. You may also give an a s-o-b for me. Finally,
this patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=847525, and
https://bugzilla.kernel.org/show_bug.cgi?id=45071.
Larry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
@ 2012-09-10 18:34 ` Larry Finger
0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2012-09-10 18:34 UTC (permalink / raw)
To: Eric Dumazet
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev, Greg Kroah-Hartman
On 09/10/2012 12:55 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> Signed-off-by: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
Eric,
Thanks for this. It works for me. I had looked at this code a number of times,
but for some reason, I thought that the u.hdr.rx_yyyy parameters were like
32-bit systems and that all 4 values were pointers, and not like 64-bit systems,
thus the funny conversion. Strange that the bug was never triggered until commit
c8628155ece3 - this code has not changed since the driver was accepted into 2.6.37.
A few points on the patch. As the driver is in staging, the patch needs to go to
Greg Kroah-Hartman. In addition, please add the "Cc: Stable
<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>" line. You may also give an a s-o-b for me. Finally,
this patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=847525, and
https://bugzilla.kernel.org/show_bug.cgi?id=45071.
Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
@ 2012-09-10 19:22 Eric Dumazet
2012-09-10 19:40 ` Larry Finger
0 siblings, 1 reply; 7+ messages in thread
From: Eric Dumazet @ 2012-09-10 19:22 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Larry Finger, netdev, Dave Jones
From: Eric Dumazet <edumazet@google.com>
64bit arches have a buggy r8712u driver, let's fix it.
skb->tail must be set properly or network stack behavior is undefined.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dave Jones <davej@redhat.com>
Cc: stable@vger.kernel.org [2.6.37+]
---
drivers/staging/rtl8712/recv_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 0e26d5f..495ee12 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
if (skb == NULL)
goto _recv_indicatepkt_drop;
skb->data = precv_frame->u.hdr.rx_data;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
- precv_frame->u.hdr.rx_head);
-#else
- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
-#endif
skb->len = precv_frame->u.hdr.len;
+ skb_set_tail_pointer(skb, skb->len);
if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
2012-09-10 19:22 [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt() Eric Dumazet
@ 2012-09-10 19:40 ` Larry Finger
0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2012-09-10 19:40 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Greg Kroah-Hartman, netdev, Dave Jones
On 09/10/2012 02:22 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> skb->tail must be set properly or network stack behavior is undefined.
>
> Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
> Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Dave Jones <davej@redhat.com>
> Cc: stable@vger.kernel.org [2.6.37+]
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Larry
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
@ 2012-09-12 17:52 Aki Parviainen
2012-09-12 18:25 ` Eric Dumazet
0 siblings, 1 reply; 7+ messages in thread
From: Aki Parviainen @ 2012-09-12 17:52 UTC (permalink / raw)
To: edumazet; +Cc: netdev
>From: Eric Dumazet <edumazet@google.com>
>
>64bit arches have a buggy r8712u driver, let's fix it.
>
>skb->tail must be set properly or network stack behavior is undefined.
>
>Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
>Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Larry Finger <Larry.Finger@lwfinger.net>
>Cc: Dave Jones <davej@redhat.com>
>Cc: stable@vger.kernel.org [2.6.37+]
Tested this patch on 64bit linux-3.6-rc5 & fixes problem for me. Thank
you very much for fixing this very annoying & long time open bug!
Tested-by: Aki Parviainen <aki.parviainen@iki.fi>
Aki
>---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
>diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
>index 0e26d5f..495ee12 100644
>--- a/drivers/staging/rtl8712/recv_linux.c
>+++ b/drivers/staging/rtl8712/recv_linux.c
>@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
>-#ifdef NET_SKBUFF_DATA_USES_OFFSET
>- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
>- precv_frame->u.hdr.rx_head);
>-#else
>- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
>-#endif
> skb->len = precv_frame->u.hdr.len;
>+ skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
2012-09-12 17:52 Aki Parviainen
@ 2012-09-12 18:25 ` Eric Dumazet
0 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2012-09-12 18:25 UTC (permalink / raw)
To: Aki Parviainen; +Cc: edumazet, netdev
On Wed, 2012-09-12 at 20:52 +0300, Aki Parviainen wrote:
> Tested this patch on 64bit linux-3.6-rc5 & fixes problem for me. Thank
> you very much for fixing this very annoying & long time open bug!
>
> Tested-by: Aki Parviainen <aki.parviainen@iki.fi>
Thanks for testing !
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-09-12 18:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 19:22 [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt() Eric Dumazet
2012-09-10 19:40 ` Larry Finger
-- strict thread matches above, loose matches on Subject: below --
2012-09-12 17:52 Aki Parviainen
2012-09-12 18:25 ` Eric Dumazet
2012-08-23 20:57 Regression associated with commit c8628155ece3 - "tcp: reduce out_of_order memory use" Larry Finger
2012-08-23 21:26 ` Eric Dumazet
2012-08-24 14:09 ` Larry Finger
2012-08-24 15:19 ` David Miller
2012-08-24 15:58 ` Larry Finger
2012-08-24 16:18 ` Eric Dumazet
2012-08-24 16:23 ` Eric Dumazet
2012-08-24 16:58 ` Larry Finger
2012-08-24 17:47 ` Eric Dumazet
2012-08-27 17:55 ` Larry Finger
2012-09-10 8:39 ` Eric Dumazet
2012-09-10 14:53 ` Larry Finger
2012-09-10 15:04 ` Eric Dumazet
2012-09-10 17:55 ` [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt() Eric Dumazet
2012-09-10 18:34 ` Larry Finger
2012-09-10 18:34 ` Larry Finger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.