ATH11K Archive mirror
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Kalle Valo <kvalo@kernel.org>
Cc: Jeff Johnson <jjohnson@kernel.org>,
	kuba@kernel.org, keescook@chromium.org,
	"open list:NETWORKING DRIVERS (WIRELESS)"
	<linux-wireless@vger.kernel.org>,
	"open list:QUALCOMM ATHEROS ATH11K WIRELESS DRIVER"
	<ath11k@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] wifi: ath11k: allocate dummy net_device dynamically
Date: Fri, 22 Mar 2024 08:16:17 -0700	[thread overview]
Message-ID: <Zf2gwaEU4PQ+6GMe@gmail.com> (raw)
In-Reply-To: <871q85as8e.fsf@kernel.org>

On Wed, Mar 20, 2024 at 04:32:49PM +0200, Kalle Valo wrote:
> Breno Leitao <leitao@debian.org> writes:
> 
> > Embedding net_device into structures prohibits the usage of flexible
> > arrays in the net_device structure. For more details, see the discussion
> > at [1].
> >
> > Un-embed the net_device from struct ath11k_ext_irq_grp by converting it
> > into a pointer. Then use the leverage alloc_netdev() to allocate the
> > net_device object at ath11k_ahb_config_ext_irq() for ahb, and
> > ath11k_pcic_ext_irq_config() for pcic.
> >
> >  The free of the device occurs at ath11k_ahb_free_ext_irq() for the ahb
> > case, and ath11k_pcic_free_ext_irq() for the pcic case.
> >
> > [1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/
> >
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> 
> This crashes on my nuc x86 test box with WCN6855 hw2.0 when running
> rmmod, stacktrace below. I used tag ath-202403201010 from my ath.git
> tree as the baseline. Sorry that I'm not able to debug this further
> right now.

Thanks for the detailed log. I am trying to understood the issue, and I think
we are deferring a null pointer, which is likely net_device->dev_addr.

Here, dev->dev_addr seems to be NULL.

>   27:	83 e6 07             	and    $0x7,%esi
>   2a:*	42 0f b6 14 30       	movzbl (%rax,%r14,1),%edx		<-- trapping instruction

In this case, and I understand RAX seems to be dev->addr, and R14 is the
KASAN shadow:

	RAX = 0000000000000000
	R14 = dffffc0000000000 (CONFIG_KASAN_SHADOW_OFFSET)

So, we are clearly deferring a NULL pointer.

Now, why? Not sure yet.


      parent reply	other threads:[~2024-03-22 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 18:57 [PATCH] wifi: ath11k: allocate dummy net_device dynamically Breno Leitao
2024-03-20 14:05 ` Florian Fainelli
2024-03-21 14:26   ` Jakub Kicinski
2024-03-20 14:32 ` Kalle Valo
2024-03-20 15:06   ` Jeff Johnson
2024-03-22 15:16   ` Breno Leitao [this message]

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=Zf2gwaEU4PQ+6GMe@gmail.com \
    --to=leitao@debian.org \
    --cc=ath11k@lists.infradead.org \
    --cc=jjohnson@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).