ucsb-seclab / dr_checker

DR.CHECKER : A Soundy Vulnerability Detection Tool for Linux Kernel Drivers
BSD 2-Clause "Simplified" License
329 stars 71 forks source link

What the dangerous for "Trying to use a global variable without locking." #27

Closed leiwen83 closed 5 years ago

leiwen83 commented 5 years ago

Hi, I see lots of warns with "Trying to use a global variable without locking." But I cannot see any harm for the reported functions, could someone describe more about the harm for this kind of potential bugs?

Machiry commented 5 years ago

These warnings are raised when a global variable is used without holding a lock. There could be potential race conditions, ideally, all global variables should be used by holding locks.

However, I agree with you. Depending on the usage, these may or may not be a security issue. Btw, You can ignore these errors by enabling a flag in the code: https://github.com/ucsb-seclab/dr_checker/blob/speedy/llvm_analysis/MainAnalysisPasses/SoundyAliasAnalysis/src/bug_detectors/BugDetectorDriver.cpp#L26