[<prev] [next>] [day] [month] [year] [list]
Message-ID: <f04fa5fa-c340-5afe-a5a1-52806c7981a3@gmail.com>
Date: Wed, 26 Dec 2018 22:35:45 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: rasesh.mody@...ium.com, sudarsana.kalluru@...ium.com,
Dept-GELinuxNICDev@...ium.com, davem@...emloft.net
Cc: netdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] net: brocade: bna: Possible concurrency use-after-free bugs
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
Powered by blists - more mailing lists