linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Karl Beldan <karl.beldan@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: Karl Beldan <karl.beldan@rivierawaves.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] mac80211: minstrels: fix buffer overflow in HT debugfs rc_stats
Date: Sat, 18 Oct 2014 11:27:47 +0200	[thread overview]
Message-ID: <54423293.3080404@openwrt.org> (raw)
In-Reply-To: <1413570840-27679-1-git-send-email-karl.beldan@gmail.com>

On 2014-10-17 20:34, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
> 
> ATM an HT rc_stats line is 106 chars.
> Times 8(MCS_GROUP_RATES)*3(SS)*2(GI)*2(BW) + CCK(4), i.e. x100, this is
> well above the current 8192 - sizeof(*ms) currently allocated.
> 
> Fix this by squeezing the output as follows (not that we're short on
> memory but this also improves readability and range, the new format adds
> one more digit to *ok/*cum and ok/cum):
> 
> - Before (HT) (106 ch):
> type           rate     throughput  ewma prob   this prob  retry   this succ/attempt   success    attempts
> CCK/LP          5.5M           0.0        0.0         0.0      0              0(  0)         0           0
> HT20/LGI ABCDP MCS0            0.0        0.0         0.0      1              0(  0)         0           0
> - After (75 ch):
> type           rate     tpt eprob *prob ret  *ok(*cum)        ok(      cum)
> CCK/LP          5.5M    0.0   0.0   0.0   0    0(   0)         0(        0)
> HT20/LGI ABCDP MCS0     0.0   0.0   0.0   1    0(   0)         0(        0)
> 
> - Align non-HT format Before (non-HT) (83 ch):
> rate      throughput  ewma prob  this prob  this succ/attempt   success    attempts
> ABCDP  6         0.0        0.0        0.0             0(  0)         0           0
>       54         0.0        0.0        0.0             0(  0)         0           0
> - After (61 ch):
> rate          tpt eprob *prob  *ok(*cum)        ok(      cum)
> ABCDP  1      0.0   0.0   0.0    0(   0)         0(        0)
>       54      0.0   0.0   0.0    0(   0)         0(        0)
> 
> *This also adds dynamic checks for overflow, lowers the size of the
> non-HT request (allowing > 30 entries) and replaces the buddy-rounded
> allocations (s/sizeof(*ms) + 8192/8192).
> 
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
> Cc: Felix Fietkau <nbd@openwrt.org>
Acked-by: Felix Fietkau <nbd@openwrt.org>

  reply	other threads:[~2014-10-18  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 18:34 [PATCH] mac80211: minstrels: fix buffer overflow in HT debugfs rc_stats Karl Beldan
2014-10-18  9:27 ` Felix Fietkau [this message]
2014-10-19 10:22 ` Karl Beldan
2014-10-20  7:28   ` Johannes Berg
2014-10-20  8:54 ` [PATCH v2] " Karl Beldan
2014-10-20 14:38   ` Johannes Berg

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=54423293.3080404@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=johannes@sipsolutions.net \
    --cc=karl.beldan@gmail.com \
    --cc=karl.beldan@rivierawaves.com \
    --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 NNTP newsgroup(s).