From: Michael Straube <straube.linux@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: r8188eu: do not write past the end of an array
Date: Sat, 18 Sep 2021 16:26:33 +0200 [thread overview]
Message-ID: <71fb25dd-b695-47ac-2bfc-7e7cb2baf6c5@gmail.com> (raw)
In-Reply-To: <20210918134024.23837-1-martin@kaiser.cx>
On 9/18/21 15:40, Martin Kaiser wrote:
> Commit f7b687d6b67e ("staging: r8188eu: remove NumTotalRFPath from struct
> hal_data_8188e") removed a for loop around a block of code that is executed
> only once when i == 0. However, without the for loop, i will never be set
> to 0 before the code block is executed. i remains at 2, which is the final
> value after the previous loop. This results in a write past the end of the
> powerlevel and MCSBase arrays.
>
> [ 28.480809] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: rtl8188e_PHY_RF6052SetOFDMTxPower+0x124/0x128 [r8188eu]
> [ 28.493752] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: rtl8188e_PHY_RF6052SetOFDMTxPower+0x124/0x128 [r8188eu] ]---
>
> Fix this by replacing i with 0 in the code block that used to be the body of
> the loop. While at it, remove the powerlevel array that was just holding a
> temporary value.
>
Oh, I missed that.
Many thanks for fixing this, Martin. Looks good to me.
Acked-by: Michael Straube <straube.linux@gmail.com>
Thanks,
Michael
prev parent reply other threads:[~2021-09-18 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-18 13:40 Martin Kaiser
2021-09-18 14:26 ` Michael Straube [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=71fb25dd-b695-47ac-2bfc-7e7cb2baf6c5@gmail.com \
--to=straube.linux@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin@kaiser.cx \
--cc=phil@philpotter.co.uk \
/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
Powered by JetHome