All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Pedersen <thomas@adapt-ip.com>
To: Nick Owens <mischief@offblast.org>
Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang <yhchuang@realtek.com>
Subject: Re: [PATCH] rtw88: fix skb_under_panic in tx path
Date: Thu, 25 Jun 2020 17:10:51 -0700	[thread overview]
Message-ID: <3d8546b66a4f2027a7fab1de291ec40f@adapt-ip.com> (raw)
In-Reply-To: <20200625201857.almm27xgzburyxxu@wololo.home.arpa>

On 2020-06-25 13:18, Nick Owens wrote:
> hello :)

Hi Nick :)

> this change fixes a reliable crash on my thinkpad A485.
> 
> please note i have no prior experience doing kernel development or
> sending patches, and i'm not sure if this is a correct approach.

You probably want to submit patches with git-send-email. See 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

> From aa589182d30a0f99e1b3201ed4f3830e8af71dac Mon Sep 17 00:00:00 2001
> From: Nick Owens <mischief@offblast.org>
> Date: Thu, 25 Jun 2020 12:55:41 -0700
> Subject: [PATCH] rtw88: fix skb_under_panic in tx path
> 
> fixes the following panic on my thinkpad A485
> 
> Oops#1 Part3
> <0>[ 3743.881656] skbuff: skb_under_panic: text:000000005f69fd98
> len:208 put:48 head:000000009e2719e8 data:00000000bd3795e0 tail:0xc2
> end:0x2c0 dev:wlp2s0

skb->head and skb->data here are really far (0.5GB) apart. Maybe 
skb->data actually got corrupted earlier?

> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c
> b/drivers/net/wireless/realtek/rtw88/pci.c
> index d735f3127fe8..21b3b268cb25 100644
> --- a/drivers/net/wireless/realtek/rtw88/pci.c
> +++ b/drivers/net/wireless/realtek/rtw88/pci.c
> @@ -741,6 +741,12 @@ static int rtw_pci_tx_write_data(struct rtw_dev 
> *rtwdev,
>  	else if (!avail_desc(ring->r.wp, ring->r.rp, ring->r.len))
>  		return -ENOSPC;
> 
> +	if (skb_headroom(skb) < chip->tx_pkt_desc_sz &&
> +	    pskb_expand_head(skb, chip->tx_pkt_desc_sz - skb_headroom(skb),
> 0, GFP_ATOMIC)) {
> +		dev_err(rtwdev->dev, "no headroom available");
> +		return -ENOMEM;
> +	}
> +

If it is a headroom issue, you can actually express the needed headroom 
needed by the driver in hw->extra_tx_headroom during init and avoid the 
pskb_expand_head() here.

-- 
thomas

  reply	other threads:[~2020-06-26  0:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 20:18 [PATCH] rtw88: fix skb_under_panic in tx path Nick Owens
2020-06-26  0:10 ` Thomas Pedersen [this message]
2020-06-29  5:20   ` Tony Chuang
2020-11-21  1:43     ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d8546b66a4f2027a7fab1de291ec40f@adapt-ip.com \
    --to=thomas@adapt-ip.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mischief@offblast.org \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.