From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: rasesh.mody@cavium.com, sudarsana.kalluru@cavium.com,
Dept-GELinuxNICDev@cavium.com, davem@davemloft.net
Cc: netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [BUG] net: brocade: bna: Possible concurrency use-after-free bugs
Date: Wed, 26 Dec 2018 22:35:45 +0800 [thread overview]
Message-ID: <f04fa5fa-c340-5afe-a5a1-52806c7981a3@gmail.com> (raw)
In drivers/net/ethernet/brocade/bna/bnad_debugfs.c, the functions
bnad_debugfs_read_regrd() and bnad_debugfs_write_regrd() may be
concurrently executed.
bnad_debugfs_read_regrd()
line 293: if (!bnad->regdata)
line 297: simple_read_from_buffer(..., bnad->regdata, ...)
line 300: kfree(bnad->regdata)
bnad_debugfs_write_regrd()
line 335: kfree(bnad->regdata)
line 338: kfree(bnad->regdata)
line 357: regbuf = (u32 *)bnad->regdata
All these accesses to bnad->regdata are not protected by any lock.
Thus, possible concurrency use-after-free bugs may occur.
A possible fixing way is to use a lock to protect these accesses.
I am not sure about this way, so I only report the bugs.
Best wishes,
Jia-Ju Bai
reply other threads:[~2018-12-26 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=f04fa5fa-c340-5afe-a5a1-52806c7981a3@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=Dept-GELinuxNICDev@cavium.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rasesh.mody@cavium.com \
--cc=sudarsana.kalluru@cavium.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®