| /linux/tools/testing/selftests/landlock/ |
| H A D | audit_test.c | 25 int audit_fd, const pid_t opid, __u64 *domain_id) in matches_log_signal() argument 37 return audit_match_record(audit_fd, AUDIT_LANDLOCK_ACCESS, log_match, in matches_log_signal() 44 int audit_fd; in FIXTURE() local 51 self->audit_fd = audit_init_with_exe_filter(&self->audit_filter); in FIXTURE_SETUP() 52 EXPECT_LE(0, self->audit_fd) in FIXTURE_SETUP() 57 if (self->audit_fd == -EEXIST) in FIXTURE_SETUP() 60 error_msg = strerror(-self->audit_fd); in FIXTURE_SETUP() 69 EXPECT_EQ(0, audit_cleanup(self->audit_fd, &self->audit_filter)); in FIXTURE_TEARDOWN() 106 matches_log_signal(_metadata, self->audit_fd, in TEST_F() 109 self->audit_fd, getpid(), in TEST_F() [all …]
|
| H A D | audit.h | 141 static int audit_filter_exe(const int audit_fd, in audit_filter_exe() argument 167 return audit_request(audit_fd, &msg, NULL); in audit_filter_exe() 170 static int audit_filter_drop(const int audit_fd, const __u16 type) in audit_filter_drop() argument 188 return audit_request(audit_fd, &msg, NULL); in audit_filter_drop() 249 static int audit_match_record(int audit_fd, const __u16 type, in audit_match_record() argument 264 err = audit_recv(audit_fd, &msg); in audit_match_record() 301 static int __maybe_unused matches_log_domain_allocated(int audit_fd, pid_t pid, in matches_log_domain_allocated() argument 315 return audit_match_record(audit_fd, AUDIT_LANDLOCK_DOMAIN, log_match, in matches_log_domain_allocated() 320 int audit_fd, unsigned int num_denials, __u64 *domain_id) in matches_log_domain_deallocated() argument 332 return audit_match_record(audit_fd, AUDIT_LANDLOCK_DOMAIN, log_match, in matches_log_domain_deallocated() [all …]
|
| H A D | ptrace_test.c | 296 int audit_fd, const pid_t opid) in matches_log_ptrace() argument 308 return audit_match_record(audit_fd, AUDIT_LANDLOCK_ACCESS, log_match, in matches_log_ptrace() 315 int audit_fd; in FIXTURE() local 322 self->audit_fd = audit_init_with_exe_filter(&self->audit_filter); in FIXTURE_SETUP() 323 EXPECT_LE(0, self->audit_fd); in FIXTURE_SETUP() 343 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F() 378 EXPECT_EQ(0, matches_log_ptrace(_metadata, self->audit_fd, in TEST_F() 381 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F() 418 EXPECT_EQ(0, matches_log_ptrace(_metadata, self->audit_fd, child)); in TEST_F() 428 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F()
|
| H A D | fs_test.c | 7053 int audit_fd, const char *const blockers, in matches_log_fs_extra() argument 7095 return audit_match_record(audit_fd, AUDIT_LANDLOCK_ACCESS, log_match, in matches_log_fs_extra() 7099 static int matches_log_fs(struct __test_metadata *const _metadata, int audit_fd, in matches_log_fs() argument 7102 return matches_log_fs_extra(_metadata, audit_fd, blockers, path, NULL); in matches_log_fs() 7108 int audit_fd; in FIXTURE() local 7118 self->audit_fd = audit_init_with_exe_filter(&self->audit_filter); in FIXTURE_SETUP() 7119 EXPECT_LE(0, self->audit_fd); in FIXTURE_SETUP() 7147 EXPECT_EQ(0, matches_log_fs(_metadata, self->audit_fd, "fs\\.execute", in TEST_F() 7150 EXPECT_EQ(0, matches_log_fs(_metadata, self->audit_fd, "fs\\.execute", in TEST_F() 7153 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F() [all …]
|
| H A D | net_test.c | 1898 static int matches_log_tcp(const int audit_fd, const char *const blockers, in matches_log_tcp() argument 1918 return audit_match_record(audit_fd, AUDIT_LANDLOCK_ACCESS, log_match, in matches_log_tcp() 1926 int audit_fd; in FIXTURE() local 1961 self->audit_fd = audit_init_with_exe_filter(&self->audit_filter); in FIXTURE_SETUP() 1962 EXPECT_LE(0, self->audit_fd); in FIXTURE_SETUP() 1969 EXPECT_EQ(0, audit_cleanup(self->audit_fd, &self->audit_filter)); in FIXTURE_TEARDOWN() 1991 EXPECT_EQ(0, matches_log_tcp(self->audit_fd, "net\\.bind_tcp", "saddr", in TEST_F() 1994 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F() 2019 EXPECT_EQ(0, matches_log_tcp(self->audit_fd, "net\\.connect_tcp", in TEST_F() 2022 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F()
|
| H A D | scoped_abstract_unix_test.c | 275 int audit_fd; in FIXTURE() local 286 self->audit_fd = audit_init_with_exe_filter(&self->audit_filter); in FIXTURE_SETUP() 287 EXPECT_LE(0, self->audit_fd); in FIXTURE_SETUP() 313 EXPECT_EQ(0, audit_count_records(self->audit_fd, &records)); in TEST_F() 366 self->audit_fd, AUDIT_LANDLOCK_ACCESS, in TEST_F()
|