All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
@ 2011-05-18 22:59 Dennis Aberilla
  2011-05-19 20:12 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Dennis Aberilla @ 2011-05-18 22:59 UTC (permalink / raw)
  To: info; +Cc: davem, netdev


This patch fixes a kernel crash during packet reception due to not enough allocated bytes for the skb. This applies to the driver when running in PIO mode in an ISA bus setup.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>

---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9069aee 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
 
 	/* check the status */
 	if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
-		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
+		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 2);
 
 		if (skb) {
 


--

Using mutt this time.

|Dennis
=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-18 22:59 [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode Dennis Aberilla
@ 2011-05-19 20:12 ` David Miller
  2011-05-19 23:30   ` Dennis Aberilla
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2011-05-19 20:12 UTC (permalink / raw)
  To: dennis.aberilla; +Cc: info, netdev

From: Dennis Aberilla <dennis.aberilla@mimomax.com>
Date: Thu, 19 May 2011 10:59:47 +1200

> This patch fixes a kernel crash during packet reception due to not
> enough allocated bytes for the skb. This applies to the driver when
> running in PIO mode in an ISA bus setup.
> 
> Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>

If you're trying to accomodate the fact that the loops iterate
always by 2 or 4 bytes at a time, then you will need to allocate
up to "3" bytes of slack space, not just "2".

You need to describe exactly what the precise problem is in your
commit message, or else people might find it difficult to figure
out exactly what the problem is.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-19 20:12 ` David Miller
@ 2011-05-19 23:30   ` Dennis Aberilla
  0 siblings, 0 replies; 8+ messages in thread
From: Dennis Aberilla @ 2011-05-19 23:30 UTC (permalink / raw)
  To: David Miller; +Cc: info, netdev

On Thu, May 19, 2011 at 04:12:28PM -0400, David Miller wrote:
> From: Dennis Aberilla <dennis.aberilla@mimomax.com>
> Date: Thu, 19 May 2011 10:59:47 +1200
> 
> > This patch fixes a kernel crash during packet reception due to not
> > enough allocated bytes for the skb. This applies to the driver when
> > running in PIO mode in an ISA bus setup.
> > 
> > Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>
> 
> If you're trying to accomodate the fact that the loops iterate
> always by 2 or 4 bytes at a time, then you will need to allocate
> up to "3" bytes of slack space, not just "2".
> 
> You need to describe exactly what the precise problem is in your
> commit message, or else people might find it difficult to figure
> out exactly what the problem is.

Ah right, it should actually be 3. Yes, it accounts for the fact that the
loops are reading the Rx buffer 4 bytes at a time. Sorry it wasn't too
clear previously.

|Dennis
=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-29 21:46 Dennis Aberilla
@ 2011-05-31 22:15 ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2011-05-31 22:15 UTC (permalink / raw)
  To: dennis.aberilla; +Cc: info, netdev

From: Dennis Aberilla <dennis.aberilla@mimomax.com>
Date: Mon, 30 May 2011 09:46:54 +1200

> This patch fixes a driver crash during packet reception due to not enough
> bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we
> need to allow for up to 3 bytes of slack space.
> 
> Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>

Applied, thanks.

> |Dennis
> =======================================================================
> This email, including any attachments, is only for the intended
> addressee.  It is subject to copyright, is confidential and may be
> the subject of legal or other privilege, none of which is waived or
> lost by reason of this transmission.
> If the receiver is not the intended addressee, please accept our
> apologies, notify us by return, delete all copies and perform no
> other act on the email.
> Unfortunately, we cannot warrant that the email has not been
> altered or corrupted during transmission.
> =======================================================================

Please turn this off for future patch submissions or I will
completely ignore them.  It is entirely inappropriate for emails
destined for a public mailing list.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
@ 2011-05-29 21:46 Dennis Aberilla
  2011-05-31 22:15 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Dennis Aberilla @ 2011-05-29 21:46 UTC (permalink / raw)
  To: info, davem; +Cc: netdev

This patch fixes a driver crash during packet reception due to not enough
bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we
need to allow for up to 3 bytes of slack space.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>

---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9bd0f55 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
 
 	/* check the status */
 	if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
-		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
+		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3);
 
 		if (skb) {
 

--

Thanks.

|Dennis
=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-18 22:03 ` David Miller
@ 2011-05-18 22:03   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2011-05-18 22:03 UTC (permalink / raw)
  To: denzzzhome; +Cc: info, linux-kernel


BTW, you also sent this to the wrong list.

Networking patches must be sent to netdev@vger.kernel.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-18 21:51 Dennis Aberilla
@ 2011-05-18 22:03 ` David Miller
  2011-05-18 22:03   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2011-05-18 22:03 UTC (permalink / raw)
  To: denzzzhome; +Cc: info, linux-kernel

From: Dennis Aberilla <denzzzhome@yahoo.com>
Date: Wed, 18 May 2011 14:51:14 -0700 (PDT)

> diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
> index f0d8346..9069aee 100644
> --- a/drivers/net/ks8842.c
> +++ b/drivers/net/ks8842.c
> @@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
> 
>    /* check the status */
>    if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
> -     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
> +     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 2);

Your patch has been corrupted by your email client, it has turned TAB
characters into spaces, amongst other things.  This makes your patch
unusable.

Please read Documentation/email-clients.txt, and use that information
to fix your email client, and then send the patch as a test email
to yourself and make sure that you can extract the patch and apply
it cleanly before you resend it here.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
@ 2011-05-18 21:51 Dennis Aberilla
  2011-05-18 22:03 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Dennis Aberilla @ 2011-05-18 21:51 UTC (permalink / raw)
  To: info; +Cc: davem, linux-kernel


This patch fixes a kernel crash during packet reception due to not enough allocated bytes for the skb. This applies to the driver when running in PIO mode in an ISA bus setup.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>


---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9069aee 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,

   /* check the status */
   if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
-     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
+     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 2);

      if (skb) {



--

|Dennis

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-31 22:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 22:59 [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode Dennis Aberilla
2011-05-19 20:12 ` David Miller
2011-05-19 23:30   ` Dennis Aberilla
  -- strict thread matches above, loose matches on Subject: below --
2011-05-29 21:46 Dennis Aberilla
2011-05-31 22:15 ` David Miller
2011-05-18 21:51 Dennis Aberilla
2011-05-18 22:03 ` David Miller
2011-05-18 22:03   ` David Miller

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.