mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
kcov: move thread attach from open to start
The current kcov code attaches a kcov object to the thread which opened it. This is not desirable, as syzkaller opens /dev/kcov in a parent process and passes it down to the child. Move the thread attachment from open() time to start time.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#define KCOV_CMP_FLAGS_64BIT 6
|
||||
|
||||
typedef struct {
|
||||
unsigned int mode;
|
||||
unsigned int mode; // transitions protected by mutex
|
||||
mutex_t mapping_mutex;
|
||||
unsigned int entry_count; // protected by mutex
|
||||
uint64_t *buffer; // pointer protected by mutex
|
||||
@@ -34,8 +34,8 @@ typedef struct {
|
||||
|
||||
void kcov_publish_pc(uint64_t pc);
|
||||
void kcov_publish_cmp(uint64_t pc, uint64_t v1, uint64_t v2, uint64_t flags);
|
||||
int kcov_set_buffer_size(unsigned int entry_count);
|
||||
int kcov_set_mode(unsigned int mode);
|
||||
int kcov_set_buffer_size(kcov_t *kcov, unsigned int entry_count);
|
||||
int kcov_set_mode(kcov_t *kcov, unsigned int mode);
|
||||
void kcov_hold(kcov_t *kcov);
|
||||
void kcov_release(kcov_t *kcov);
|
||||
void kcov_free_buffer(kcov_t *kcov);
|
||||
|
||||
Reference in New Issue
Block a user