netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] net: brocade: bna: Possible concurrency use-after-free bugs
@ 2018-12-26 14:35 Jia-Ju Bai
  0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2018-12-26 14:35 UTC (permalink / raw)
  To: rasesh.mody, sudarsana.kalluru, Dept-GELinuxNICDev, davem
  Cc: netdev, Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-26 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26 14:35 [BUG] net: brocade: bna: Possible concurrency use-after-free bugs Jia-Ju Bai

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).