From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oleksij Rempel <linux@rempel-privat.de>
Cc: "Toke Høiland-Jørgensen" <toke@toke.dk>,
"Kalle Valo" <kvalo@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ath9k_htc: fix potential out of bounds access with invalid rxstatus->rs_keyix
Date: Mon, 11 Apr 2022 10:54:03 +0300 [thread overview]
Message-ID: <20220411075403.GZ12805@kadam> (raw)
In-Reply-To: <00a0f9f7-2fbf-8883-38e7-edec3687e6a8@rempel-privat.de>
On Sat, Apr 09, 2022 at 09:53:53AM +0200, Oleksij Rempel wrote:
> > diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> > index 6a850a0bfa8a..a23eaca0326d 100644
> > --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> > +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> > @@ -1016,6 +1016,14 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
> > goto rx_next;
> > }
> >
> > + if (rxstatus->rs_keyix >= ATH_KEYMAX &&
> > + rxstatus->rs_keyix != ATH9K_RXKEYIX_INVALID) {
> > + ath_dbg(common, ANY,
> > + "Invalid keyix, dropping (keyix: %d)\n",
> > + rxstatus->rs_keyix);
> > + goto rx_next;
> > + }
> > +
> > /* Get the RX status information */
> >
> > memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
>
> Looks ok to me.
Thanks!
>
> By the way, rs_keyix seems to have a wrong type. It is declared as u8, but used as s8.
That sounds like something outside the scope of the patch...
Why do you mean "used as s8"? Which function are you talking about?
You made me panic briefly because ATH9K_RXKEYIX_INVALID is a u8 so it
needs to be u8. I would have thought instinctively that u8 would be the
right type for an index like this.
regards,
dan carpenter
next prev parent reply other threads:[~2022-04-11 7:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-09 6:12 [PATCH] ath9k_htc: fix potential out of bounds access with invalid rxstatus->rs_keyix Dan Carpenter
2022-04-09 7:53 ` Oleksij Rempel
2022-04-11 7:54 ` Dan Carpenter [this message]
2022-04-11 10:24 ` Oleksij Rempel
2022-04-09 21:37 ` Toke Høiland-Jørgensen
2022-04-12 13:26 ` Kalle Valo
2022-04-12 13:29 ` Dan Carpenter
2022-04-23 9:32 ` Kalle Valo
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=20220411075403.GZ12805@kadam \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@rempel-privat.de \
--cc=linville@tuxdriver.com \
--cc=pabeni@redhat.com \
--cc=toke@toke.dk \
/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).