Skip to content

Commit a1c4b3c

Browse files
committed
perf: initialize synthetic fanotify metadata
The perf helper initialized only the fields it immediately needed, but decision_event_init copies the entire fanotify metadata structure. This propagated indeterminate bytes through the decision envelope. Zero-initialize the synthetic metadata record before setting the fd, pid, and mask fields used by the perf workload.
1 parent ac7ec31 commit a1c4b3c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/perf-test/fapolicyd-perf-test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ static int do_perf_test(FILE *input)
106106
if (fd < 0)
107107
continue;
108108
// Build an "event" to exercise fapolicyd's decision making
109-
struct fanotify_event_metadata metadata;
109+
// decision_event_init copies the complete kernel metadata record.
110+
struct fanotify_event_metadata metadata = { 0 };
110111
decision_event_t event;
111112

112113
metadata.fd = fd; // listener closes after reply

0 commit comments

Comments
 (0)