Bug 4747 - use-after-free bugs caused by ene_tx_irqsim()
Summary: use-after-free bugs caused by ene_tx_irqsim()
Status: NEW
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: 4.19-028.x
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-11 16:42 UTC by inspursand
Modified: 2023-04-11 16:42 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description inspursand inspur_group 2023-04-11 16:42:00 UTC
Description of problem:

When the ene device is detaching, function ene_remove() will
be called. But there is no function to cancel tx_sim_timer
in ene_remove(), the timer handler ene_tx_irqsim() could race
with ene_remove(). As a result, the UAF bugs could happen,
the process is shown below.

    (cleanup routine)          |        (timer routine)
                               | mod_timer(&dev->tx_sim_timer, ..)
ene_remove()                   | (wait a time)
  kfree(dev) //FREE            |
                               | ene_tx_irqsim()
                               |   dev->hw_lock //USE
                               |   ene_tx_sample(dev) //USE
Version-Release number of selected component (if applicable):

4.19
How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info: