/freebsd/sys/security/mac/ |
H A D | mac_posix_shm.c | 66 mac_posixshm_init(struct shmfd *shmfd) in mac_posixshm_init() argument 70 shmfd->shm_label = mac_posixshm_label_alloc(); in mac_posixshm_init() 72 shmfd->shm_label = NULL; in mac_posixshm_init() 84 mac_posixshm_destroy(struct shmfd *shmfd) in mac_posixshm_destroy() argument 87 if (shmfd->shm_label != NULL) { in mac_posixshm_destroy() 88 mac_posixshm_label_free(shmfd->shm_label); in mac_posixshm_destroy() 89 shmfd->shm_label = NULL; in mac_posixshm_destroy() 94 mac_posixshm_create(struct ucred *cred, struct shmfd *shmfd) in mac_posixshm_create() argument 97 MAC_POLICY_PERFORM_NOSLEEP(posixshm_create, cred, shmfd, in mac_posixshm_create() 98 shmfd->shm_label); in mac_posixshm_create() [all …]
|
H A D | mac_framework.h | 78 struct shmfd; 328 int mac_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, 330 int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, 333 struct ucred *file_cred, struct shmfd *shmfd); 334 int mac_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, 336 int mac_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, 339 struct ucred *file_cred, struct shmfd *shmfd); 341 struct ucred *file_cred, struct shmfd *shmfd); 342 int mac_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd); 344 struct ucred *file_cred, struct shmfd *shmfd); [all …]
|
H A D | mac_policy.h | 94 struct shmfd; 380 struct shmfd *shmfd, struct label *shmlabel, int prot, 383 struct shmfd *shmfd, struct label *shmlabel, 386 struct ucred *file_cred, struct shmfd *shmfd, 389 struct shmfd *shmfd, struct label *shmlabel, 392 struct shmfd *shmfd, struct label *shmlabel, 395 struct ucred *file_cred, struct shmfd *shmfd, 398 struct ucred *file_cred, struct shmfd *shmfd, 401 struct shmfd *shmfd, struct label *shmlabel); 403 struct ucred *file_cred, struct shmfd *shmfd, [all …]
|
/freebsd/sys/kern/ |
H A D | uipc_shm.c | 108 struct shmfd *sm_shmfd; 123 static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd); 124 static struct shmfd *shm_lookup(char *path, Fnv32_t fnv); 127 static int shm_dotruncate_cookie(struct shmfd *shmfd, off_t length, 129 static int shm_dotruncate_locked(struct shmfd *shmfd, off_t length, 133 static int shm_deallocate(struct shmfd *shmfd, off_t *offset, 186 #define shm_rangelock_unlock(shmfd, cookie) \ argument 187 rangelock_unlock(&(shmfd)->shm_rl, (cookie)) 188 #define shm_rangelock_rlock(shmfd, start, end) \ argument 189 rangelock_rlock(&(shmfd)->shm_rl, (start), (end)) [all …]
|
H A D | kern_sendfile.c | 564 struct vnode **vp_res, struct shmfd **shmfd_res, off_t *obj_size, in sendfile_getobj() 569 struct shmfd *shmfd; in sendfile_getobj() local 575 shmfd = *shmfd_res = NULL; in sendfile_getobj() 611 shmfd = fp->f_data; in sendfile_getobj() 612 obj = shmfd->shm_object; in sendfile_getobj() 614 *obj_size = shmfd->shm_size; in sendfile_getobj() 635 *shmfd_res = shmfd; in sendfile_getobj() 685 struct shmfd *shmfd; in vn_sendfile() local 706 error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize); in vn_sendfile()
|
H A D | kern_umtx.c | 4303 struct shmfd *ushm_obj; 4491 struct shmfd *shm; in umtx_shm_create_reg()
|
/freebsd/sys/sys/ |
H A D | mman.h | 265 struct shmfd { struct 306 int shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags); argument 307 struct shmfd *shm_alloc(struct ucred *ucred, mode_t mode, bool largepage); 308 struct shmfd *shm_hold(struct shmfd *shmfd); 309 void shm_drop(struct shmfd *shmfd); 310 int shm_dotruncate(struct shmfd *shmfd, off_t length); 311 bool shm_largepage(struct shmfd *shmfd);
|
/freebsd/tools/test/stress2/misc/ |
H A D | sendfile_shm.sh | 88 load(int infd, int shmfd, off_t size) 99 write(shmfd, buf, r); 104 sendfd(int s, int shmfd, off_t size) 109 error = sendfile(shmfd, s, 0, size, NULL, &sbytes, 0); 111 err(1, "sendfile(%d, %d, %jd)", s, shmfd, size); 147 int s[2], infd, outfd, shmfd, error; 171 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); 172 if (shmfd == -1) 174 error = ftruncate(shmfd, st.st_size); 177 load(infd, shmfd, st.st_size); [all …]
|
H A D | shm3.sh | 30 int error, shmfd; 33 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); 34 if (shmfd == -1) 36 error = ftruncate(shmfd, SZ); 41 error = write(shmfd, buf, sizeof(buf)); 48 shmfd, 0); 53 close(shmfd);
|
H A D | shm_super.sh | 53 int error, shmfd; 55 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); 56 if (shmfd == -1) 58 error = ftruncate(shmfd, SZ); 63 error = write(shmfd, buf, sizeof(buf)); 70 MAP_ALIGNED_SUPER, shmfd, 0);
|
/freebsd/tests/sys/vm/ |
H A D | mlock_test.c | 186 int count, error, shmfd; in ATF_TC_BODY() local 203 shmfd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); in ATF_TC_BODY() 204 ATF_REQUIRE_MSG(shmfd >= 0, "shm_open: %s", strerror(errno)); in ATF_TC_BODY() 205 error = ftruncate(shmfd, len); in ATF_TC_BODY() 209 MAP_SHARED | MAP_ALIGNED_SUPER, shmfd, 0); in ATF_TC_BODY() 214 MAP_SHARED | MAP_ALIGNED_SUPER, shmfd, 0); in ATF_TC_BODY() 235 error = ftruncate(shmfd, len - pagesizes[0]); in ATF_TC_BODY() 241 error = ftruncate(shmfd, len); in ATF_TC_BODY() 274 ATF_REQUIRE(close(shmfd) == 0); in ATF_TC_BODY()
|
H A D | mmap_test.c | 136 int devstatfd, pagesize, shmfd, zerofd; in ATF_TC_BODY() local 140 ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); in ATF_TC_BODY() 141 ATF_REQUIRE(ftruncate(shmfd, pagesize) == 0); in ATF_TC_BODY() 147 checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, 0, in ATF_TC_BODY() 149 checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, shmfd, 0, in ATF_TC_BODY() 161 checked_mmap(0xffff, MAP_SHARED, shmfd, EINVAL, in ATF_TC_BODY() 171 checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_SHARED, shmfd, in ATF_TC_BODY() 175 checked_mmap(PROT_READ | PROT_WRITE, 0, shmfd, EINVAL, in ATF_TC_BODY() 200 close(shmfd); in ATF_TC_BODY()
|
/freebsd/tools/tools/syscall_timing/ |
H A D | syscall_timing.c | 696 int shmfd; in test_shmfd() local 698 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd() 699 if (shmfd < 0) in test_shmfd() 701 close(shmfd); in test_shmfd() 704 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd() 705 if (shmfd < 0) in test_shmfd() 707 close(shmfd); in test_shmfd() 717 int fd, shmfd; in test_shmfd_dup() local 719 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd_dup() 720 if (shmfd < 0) in test_shmfd_dup() [all …]
|
/freebsd/sys/security/mac_stub/ |
H A D | mac_stub.c | 777 stub_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_mmap() argument 785 stub_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_open() argument 794 struct shmfd *shm, struct label *shmlabel) in stub_posixshm_check_read() 801 stub_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_setmode() argument 809 stub_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_setowner() argument 818 struct shmfd *shmfd, struct label *shmlabel) in stub_posixshm_check_stat() argument 826 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in stub_posixshm_check_truncate() argument 833 stub_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_unlink() argument 842 struct shmfd *shm, struct label *shmlabel) in stub_posixshm_check_write() 849 stub_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_create() argument
|
/freebsd/sys/security/mac_mls/ |
H A D | mac_mls.c | 1589 mls_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_mmap() argument 1613 mls_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_open() argument 1638 struct shmfd *shm, struct label *shmlabel) in mls_posixshm_check_read() 1655 mls_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_setmode() argument 1673 mls_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_setowner() argument 1692 struct shmfd *shmfd, struct label *shmlabel) in mls_posixshm_check_stat() argument 1710 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in mls_posixshm_check_truncate() argument 1727 mls_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_unlink() argument 1746 struct shmfd *shm, struct label *shmlabel) in mls_posixshm_check_write() 1763 mls_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_create() argument
|
/freebsd/sys/security/mac_test/ |
H A D | mac_test.c | 1451 test_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_mmap() argument 1463 test_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_open() argument 1476 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) in test_posixshm_check_read() 1490 test_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_setmode() argument 1502 test_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_setowner() argument 1515 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel) in test_posixshm_check_stat() argument 1528 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel) in test_posixshm_check_truncate() argument 1540 test_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_unlink() argument 1553 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) in test_posixshm_check_write() 1567 test_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_create() argument
|
/freebsd/sys/security/mac_biba/ |
H A D | mac_biba.c | 1694 biba_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_mmap() argument 1718 biba_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_open() argument 1743 struct shmfd *vp, struct label *shmlabel) in biba_posixshm_check_read() 1760 biba_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_setmode() argument 1778 biba_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_setowner() argument 1797 struct shmfd *shmfd, struct label *shmlabel) in biba_posixshm_check_stat() argument 1815 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in biba_posixshm_check_truncate() argument 1832 biba_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_unlink() argument 1851 struct shmfd *vp, struct label *shmlabel) in biba_posixshm_check_write() 1868 biba_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_create() argument
|
/freebsd/lib/libprocstat/ |
H A D | libprocstat.c | 1181 struct shmfd shmfd; in procstat_get_shm_info_kvm() local 1193 if (!kvm_read_all(kd, (unsigned long)shmfdp, &shmfd, in procstat_get_shm_info_kvm() 1194 sizeof(struct shmfd))) { in procstat_get_shm_info_kvm() 1198 shm->mode = S_IFREG | shmfd.shm_mode; in procstat_get_shm_info_kvm() 1199 shm->size = shmfd.shm_size; in procstat_get_shm_info_kvm() 1200 if (fst->fs_path == NULL && shmfd.shm_path != NULL) { in procstat_get_shm_info_kvm() 1203 if (!kvm_read_all(kd, (unsigned long)shmfd.shm_path + i, in procstat_get_shm_info_kvm()
|