From: Dan Carpenter <dan.carpenter@linaro.org>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: Su Hui <suhui@nfschina.com>, Kalle Valo <kvalo@kernel.org>,
johannes.berg@intel.com, kees@kernel.org, a@bayrepo.ru,
marcan@marcan.st, quic_alokad@quicinc.com, zyytlz.wz@163.com,
petr.tesarik.ext@huawei.com, duoming@zju.edu.cn,
colin.i.king@gmail.com, frankyl@broadcom.com,
meuleman@broadcom.com, phaber@broadcom.com,
linville@tuxdriver.com, linux-wireless@vger.kernel.org,
brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH wireless 1/9] wifi: cfg80211: avoid garbage value of 'io_type' in brcmf_cfg80211_attach()
Date: Wed, 3 Jul 2024 15:23:14 +0200 [thread overview]
Message-ID: <3f7bcda7-092f-4d94-80c7-2015e860fbe2@suswa.mountain> (raw)
In-Reply-To: <19076e6bec0.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>
On Wed, Jul 03, 2024 at 06:42:32AM +0200, Arend Van Spriel wrote:
> On July 3, 2024 3:42:18 AM Su Hui <suhui@nfschina.com> wrote:
>
> > On 2024/7/2 23:39, Arend Van Spriel wrote:
> > > On July 2, 2024 5:29:27 PM Kalle Valo <kvalo@kernel.org> wrote:
> > >
> > > > Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
> > > >
> > > > > On July 2, 2024 3:57:27 PM Dan Carpenter <dan.carpenter@linaro.org>
> > > > > wrote:
> > > > >
> > > > > > On Tue, Jul 02, 2024 at 08:24:44PM +0800, Su Hui wrote:
> > > > > > > brcmf_fil_cmd_int_get() reads the value of 'io_type' and passes it to
> > > > > > > brcmf_fil_cmd_data_get(). Initialize 'io_type' to avoid garbage
> > > > > > > value.
> > > > > >
> > > > > > Since you're going to be resending anyway, please delete the space
> > > > > > char
> > > > > > from the start of the line.
> > > > > >
> > > > > > It's weird that brcmf_fil_cmd_data_get() uses the uninitialized data.
> > > > > > It looks like it just goes to great lengths to preserve the original
> > > > > > data in io_type... So it likely is harmless enough but still a
> > > > > > strange
> > > > > > and complicated way write a no-op.
> > > > >
> > > > > Not sure if it helps, but I tried to explain the reason in response to
> > > > > patch 0 (cover letter).
> > > >
> > > > Would it make more sense to have just one patch? It's the same issue
> > > > anyway.
> > >
> > > Yes, but I would solve it in brcmf_fil_* functions (fwil.[ch]).
> > It seems you will send a new patch to solve this issue.
> > And I guess there is no need for me to resend a v2 patchset or just one
> > patch.
>
> I am not entirely sure. If both gcc and clang would warn about using
> uninitialized data I would be fine with these patches rolled into one.
We should definitely fix this, it's just a matter of how. UBSan will
also detect these at run time. And honestly, it's not clear to me where
these eventually do get copied to? Is it to the firmware? In that case
it might be that we'd treat these as a CVE.
regards,
dan carpenter
next prev parent reply other threads:[~2024-07-03 13:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 12:24 [PATCH wireless 0/9] wifi: cfg80211: avoid some garbage values Su Hui
2024-07-02 12:24 ` [PATCH wireless 1/9] wifi: cfg80211: avoid garbage value of 'io_type' in brcmf_cfg80211_attach() Su Hui
2024-07-02 13:57 ` Dan Carpenter
2024-07-02 15:07 ` Arend Van Spriel
2024-07-02 15:29 ` Kalle Valo
2024-07-02 15:37 ` Dan Carpenter
2024-07-02 16:26 ` Arend Van Spriel
2024-07-02 16:37 ` Dan Carpenter
2024-07-02 15:39 ` Arend Van Spriel
2024-07-03 1:41 ` Su Hui
2024-07-03 4:42 ` Arend Van Spriel
2024-07-03 7:38 ` Su Hui
2024-07-03 13:23 ` Dan Carpenter [this message]
2024-07-02 12:24 ` [PATCH wireless 2/9] wifi: brcmfmac: avoid garbage value of 'status' in brcmf_c_download_blob() Su Hui
2024-07-02 12:24 ` [PATCH wireless 3/9] wifi: cfg80211: avoid garbage value of 'noise' in brcmf_cfg80211_dump_survey() Su Hui
2024-07-02 12:24 ` [PATCH wireless 4/9] wifi: cfg80211: avoid garbage value of 'chanspec' in brcmf_cfg80211_get_channel() Su Hui
2024-07-02 12:24 ` [PATCH wireless 5/9] wifi: cfg80211: avoid garbage value of 'freq' in brcmf_cfg80211_mgmt_tx() Su Hui
2024-07-02 12:24 ` [PATCH wireless 6/9] wifi: cfg80211: avoid garbage value of 'wsec' in brcmf_cfg80211_reconfigure_wep() Su Hui
2024-07-02 12:24 ` [PATCH wireless 7/9] wifi: cfg80211: avoid garbage value of 'wsec' in brcmf_cfg80211_add_key() Su Hui
2024-07-02 12:24 ` [PATCH wireless 8/9] wifi: cfg80211: avoid garbage value of 'val' in brcmf_set_key_mgmt() Su Hui
2024-07-02 12:24 ` [PATCH wireless 9/9] wifi: cfg80211: avoid garbage value of 'wsec' in brcmf_cfg80211_{get,config_default}_key() Su Hui
2024-07-02 12:49 ` [PATCH wireless 0/9] wifi: cfg80211: avoid some garbage values Johannes Berg
2024-07-02 14:41 ` Arend Van Spriel
2024-07-02 14:02 ` Jonas Gorski
2024-07-02 15:01 ` Arend Van Spriel
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=3f7bcda7-092f-4d94-80c7-2015e860fbe2@suswa.mountain \
--to=dan.carpenter@linaro.org \
--cc=a@bayrepo.ru \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211@lists.linux.dev \
--cc=colin.i.king@gmail.com \
--cc=duoming@zju.edu.cn \
--cc=frankyl@broadcom.com \
--cc=johannes.berg@intel.com \
--cc=kees@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=marcan@marcan.st \
--cc=meuleman@broadcom.com \
--cc=petr.tesarik.ext@huawei.com \
--cc=phaber@broadcom.com \
--cc=quic_alokad@quicinc.com \
--cc=suhui@nfschina.com \
--cc=zyytlz.wz@163.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
all inboxes | Powered by JetHome®