From: Krzysztof Mazur <krzysiek@podlesie.net>
To: Felix Fietkau <nbd@openwrt.org>
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
peizhao.research@gmail.com, linux-wireless@vger.kernel.org
Subject: Re: kernel panic on 3.10.0-rc7
Date: Mon, 15 Jul 2013 13:25:02 +0200 [thread overview]
Message-ID: <20130715112502.GA10778@shrek.podlesie.net> (raw)
In-Reply-To: <51E3C571.2060602@openwrt.org>
On Mon, Jul 15, 2013 at 11:48:33AM +0200, Felix Fietkau wrote:
> On 2013-07-15 11:35 AM, Krzysztof Mazur wrote:
> > On Mon, Jul 15, 2013 at 11:27:30AM +0200, Krzysztof Mazur wrote:
> >> On Mon, Jul 15, 2013 at 11:06:27AM +0200, Felix Fietkau wrote:
> >> > Please post the actual message output. Saying "it looks like something
> >> > wrong with the rate control mechanism" doesn't give me anything useful
> >> > to work with.
> >> >
> >>
> >> Sorry, I added you to Cc after I removed the original Oops.
> >>
> >
> > On my system the NULL pointer dereference occurs at 0x806389b0,
> > and the minstrel_get_rate() looks like:
> >
> > 80638990 <minstrel_get_rate>:
> > 80638990: 83 ec 1c sub $0x1c,%esp
> > 80638993: 89 7c 24 14 mov %edi,0x14(%esp)
> > 80638997: 8b 7c 24 20 mov 0x20(%esp),%edi
> > 8063899b: 89 5c 24 0c mov %ebx,0xc(%esp)
> > 8063899f: 89 cb mov %ecx,%ebx
> > 806389a1: 89 6c 24 18 mov %ebp,0x18(%esp)
> > 806389a5: 89 c5 mov %eax,%ebp
> > 806389a7: 89 d0 mov %edx,%eax
> > 806389a9: 89 74 24 10 mov %esi,0x10(%esp)
> > 806389ad: 8b 77 0c mov 0xc(%edi),%esi
> > * 806389b0: 0f b6 49 38 movzbl 0x38(%ecx),%ecx *
> > 806389b4: 8d 56 20 lea 0x20(%esi),%edx
> > 806389b7: 89 54 24 04 mov %edx,0x4(%esp)
> > 806389bb: 89 da mov %ebx,%edx
> > 806389bd: 88 4c 24 0b mov %cl,0xb(%esp)
> > 806389c1: 89 f9 mov %edi,%ecx
> > 806389c3: e8 38 2f fe ff call 8061b900 <rate_control_send_low>
> My x86 assembly is a a bit rusty (I usually work with ARM and MIPS), so
> I'm having trouble figuring out the exact line of code here. Please use
> gdb to track it down.
>
The priv_sta is NULL and it's later dereferenced in:
bool prev_sample = mi->prev_sample;
static void
minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
void *priv_sta, struct ieee80211_tx_rate_control *txrc)
{
struct sk_buff *skb = txrc->skb;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct minstrel_sta_info *mi = priv_sta;
struct minstrel_priv *mp = priv;
struct ieee80211_tx_rate *rate = &info->control.rates[0];
struct minstrel_rate *msr, *mr;
unsigned int ndx;
bool mrr_capable;
bool prev_sample = mi->prev_sample;
int delta;
int sampling_ratio;
With:
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index ac7ef54..be17d52 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -290,9 +290,15 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
struct minstrel_rate *msr, *mr;
unsigned int ndx;
bool mrr_capable;
- bool prev_sample = mi->prev_sample;
+ bool prev_sample;
int delta;
int sampling_ratio;
+
+ if (!mi) {
+ printk("Oops, mi is NULL\n");
+ return;
+ }
+ prev_sample = mi->prev_sample;
/* management/no-ack frames do not use rate control */
if (rate_control_send_low(sta, priv_sta, txrc))
the system no longer crashes and just prints a message.
Krzysiek
prev parent reply other threads:[~2013-07-15 11:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 6:55 kernel panic on 3.10.0-rc7 Peizhao Hu
2013-07-01 7:37 ` Sedat Dilek
2013-07-15 8:52 ` Krzysztof Mazur
2013-07-15 9:06 ` Felix Fietkau
2013-07-15 9:27 ` Krzysztof Mazur
2013-07-15 9:35 ` Krzysztof Mazur
2013-07-15 9:48 ` Felix Fietkau
2013-07-15 11:25 ` Krzysztof Mazur [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=20130715112502.GA10778@shrek.podlesie.net \
--to=krzysiek@podlesie.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@openwrt.org \
--cc=peizhao.research@gmail.com \
--cc=sedat.dilek@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox