Project

General

Profile

Actions

Bug #2815

open

race condition during file-magic initialization

Added by magen bluten about 5 years ago. Updated 4 months ago.

Status:
Assigned
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

the function `magic_open()` initializes a static global table (c array) without locking. thus, there is a race condition if multiple threads call `magic_open` in parallel. the corresponding source in the `file` repository is (in function `init_file_tables`);

https://git.in-ulm.de/cbiedl/file/src/master/src/apprentice.c#L389

not sure how the init sequence works in suri. so this could also be a non-issue.

Actions #1

Updated by Victor Julien almost 5 years ago

  • Status changed from New to Assigned
  • Assignee set to magen bluten
  • Target version set to TBD
Actions #2

Updated by Philippe Antoine 4 months ago

Could you provide more details ?
I do not see any problem with https://github.com/file/file/blob/546a4fdd985acf1e6c9b096b97b9a1e6aad93a04/src/magic.c#L267
ie `magic_open()` initializes a static global table (c array) without locking

Actions

Also available in: Atom PDF