From: Dan Carpenter <dan.carpenter@oracle.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mac80211: prevent out of bounds access in ieee80211_rx_h_action()
Date: Wed, 19 Jan 2022 18:07:33 +0300 [thread overview]
Message-ID: <20220119150733.GB1978@kadam> (raw)
In-Reply-To: <ea8638fcd820e5b777bc6d5befc5eab9369edbbf.camel@sipsolutions.net>
On Wed, Jan 19, 2022 at 02:56:52PM +0100, Johannes Berg wrote:
> On Wed, 2022-01-19 at 15:59 +0300, Dan Carpenter wrote:
> > Smatch complains that status->band comes from the skb->data
> >
>
> Hmm. How does it come to that conclusion? It's not really true? It comes
> from skb->cb, and the driver should fill it.
Ugh... Sorry. I misread the code. I spent some time trying to figure
this out as well, but I still didn't figure it out.
So, yeah. It's skb->cb and Smatch for some reason thinks skb->cb holds
user data... I will look into this.
> Also, we have:
>
> void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
> struct sk_buff *skb, struct list_head *list)
> {
> ...
> if (WARN_ON(status->band >= NUM_NL80211_BANDS))
> goto drop;
>
>
> so I really don't think this patch is needed?
The problem with that is that ->cb is an array of char so Smatch doesn't
track status->band across function boundaries.
regards,
dan carpenter
next prev parent reply other threads:[~2022-01-19 15:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 12:59 [PATCH] mac80211: prevent out of bounds access in ieee80211_rx_h_action() Dan Carpenter
2022-01-19 13:56 ` Johannes Berg
2022-01-19 15:07 ` Dan Carpenter [this message]
2022-01-22 7:14 ` Dan Carpenter
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=20220119150733.GB1978@kadam \
--to=dan.carpenter@oracle.com \
--cc=johannes@sipsolutions.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).