Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba17833f authored by Takaya Saeki's avatar Takaya Saeki
Browse files

libmodprobe: add missing locks in LoadWithAliases

`Modprobe::LoadWithAliases` searches `module_loaded_` for a new element
without holding the lock of `module_loaded_lock_`. However,
`InsmodWithDeps` will insert an element later in this function, and
`LoadWithAliases` can be called by `LoadModulesParallel` in parallel.
Therefore `LoadWithAliases` touches `module_loaded_` while it's being
modified by other threads. That means it accesses corrputed memory.

This change inserts a necessary lock to fix this bug of
`LoadModulesParallel` and `LoadWithAliases`. This change does not
include changes to add thread safety annotations to prevent future same
problem, but following other changes will do that.

Bug: 400592897
Test: cuttlefish boots
Change-Id: Ib52a3b147cbe4122ae42c9fd377e9ea728a4aa41
parent 937d02a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment