Lines Matching full:fd

49 static ssize_t fd2name(int fd, char *buf, size_t bufsize)  in fd2name()  argument
55 size = snprintf(buf1, PATH_MAX, "/proc/self/fd/%d", fd); in fd2name()
57 printf("snprintf(%d) failed on %m\n", fd); in fd2name()
75 int r, fd; in mfd_assert_new() local
77 fd = sys_memfd_create(name, flags); in mfd_assert_new()
78 if (fd < 0) { in mfd_assert_new()
84 r = ftruncate(fd, sz); in mfd_assert_new()
90 return fd; in mfd_assert_new()
95 int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); in sysctl_assert_write() local
97 if (fd < 0) { in sysctl_assert_write()
102 if (write(fd, val, strlen(val)) < 0) { in sysctl_assert_write()
110 int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); in sysctl_fail_write() local
112 if (fd < 0) { in sysctl_fail_write()
117 if (write(fd, val, strlen(val)) >= 0) { in sysctl_fail_write()
127 int fd = open("/proc/sys/vm/memfd_noexec", O_RDONLY | O_CLOEXEC); in sysctl_assert_equal() local
129 if (fd < 0) { in sysctl_assert_equal()
134 if (read(fd, buf, sizeof(buf)) < 0) { in sysctl_assert_equal()
153 int fd; in mfd_assert_reopen_fd() local
156 sprintf(path, "/proc/self/fd/%d", fd_in); in mfd_assert_reopen_fd()
158 fd = open(path, O_RDWR); in mfd_assert_reopen_fd()
159 if (fd < 0) { in mfd_assert_reopen_fd()
160 printf("re-open of existing fd %d failed\n", fd_in); in mfd_assert_reopen_fd()
164 return fd; in mfd_assert_reopen_fd()
180 static unsigned int mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument
184 r = fcntl(fd, F_GET_SEALS); in mfd_assert_get_seals()
186 printf("GET_SEALS(%d) failed: %m\n", fd); in mfd_assert_get_seals()
193 static void mfd_assert_has_seals(int fd, unsigned int seals) in mfd_assert_has_seals() argument
197 fd2name(fd, buf, PATH_MAX); in mfd_assert_has_seals()
199 s = mfd_assert_get_seals(fd); in mfd_assert_has_seals()
206 static void mfd_assert_add_seals(int fd, unsigned int seals) in mfd_assert_add_seals() argument
211 s = mfd_assert_get_seals(fd); in mfd_assert_add_seals()
212 r = fcntl(fd, F_ADD_SEALS, seals); in mfd_assert_add_seals()
214 printf("ADD_SEALS(%d, %u -> %u) failed: %m\n", fd, s, seals); in mfd_assert_add_seals()
219 static void mfd_fail_add_seals(int fd, unsigned int seals) in mfd_fail_add_seals() argument
224 r = fcntl(fd, F_GET_SEALS); in mfd_fail_add_seals()
230 r = fcntl(fd, F_ADD_SEALS, seals); in mfd_fail_add_seals()
233 fd, s, seals); in mfd_fail_add_seals()
238 static void mfd_assert_size(int fd, size_t size) in mfd_assert_size() argument
243 r = fstat(fd, &st); in mfd_assert_size()
245 printf("fstat(%d) failed: %m\n", fd); in mfd_assert_size()
254 static int mfd_assert_dup(int fd) in mfd_assert_dup() argument
258 r = dup(fd); in mfd_assert_dup()
260 printf("dup(%d) failed: %m\n", fd); in mfd_assert_dup()
267 static void *mfd_assert_mmap_shared(int fd) in mfd_assert_mmap_shared() argument
275 fd, in mfd_assert_mmap_shared()
285 static void *mfd_assert_mmap_read_shared(int fd) in mfd_assert_mmap_read_shared() argument
293 fd, in mfd_assert_mmap_read_shared()
303 static void *mfd_assert_mmap_private(int fd) in mfd_assert_mmap_private() argument
311 fd, in mfd_assert_mmap_private()
321 static int mfd_assert_open(int fd, int flags, mode_t mode) in mfd_assert_open() argument
326 sprintf(buf, "/proc/self/fd/%d", fd); in mfd_assert_open()
336 static void mfd_fail_open(int fd, int flags, mode_t mode) in mfd_fail_open() argument
341 sprintf(buf, "/proc/self/fd/%d", fd); in mfd_fail_open()
349 static void mfd_assert_read(int fd) in mfd_assert_read() argument
355 l = read(fd, buf, sizeof(buf)); in mfd_assert_read()
366 fd, in mfd_assert_read()
379 fd, in mfd_assert_read()
389 static void mfd_assert_read_shared(int fd) in mfd_assert_read_shared() argument
398 fd, in mfd_assert_read_shared()
407 static void mfd_assert_fork_private_write(int fd) in mfd_assert_fork_private_write() argument
416 fd, in mfd_assert_fork_private_write()
441 static void mfd_assert_write(int fd) in mfd_assert_write() argument
453 l = write(fd, "\0\0\0\0", 4); in mfd_assert_write()
465 fd, in mfd_assert_write()
479 fd, in mfd_assert_write()
494 fd, in mfd_assert_write()
511 r = fallocate(fd, in mfd_assert_write()
521 static void mfd_fail_write(int fd) in mfd_fail_write() argument
528 l = write(fd, "data", 4); in mfd_fail_write()
539 fd, in mfd_fail_write()
551 fd, in mfd_fail_write()
564 fd, in mfd_fail_write()
576 r = fallocate(fd, in mfd_fail_write()
586 static void mfd_assert_shrink(int fd) in mfd_assert_shrink() argument
590 r = ftruncate(fd, mfd_def_size / 2); in mfd_assert_shrink()
596 mfd_assert_size(fd, mfd_def_size / 2); in mfd_assert_shrink()
598 fd2 = mfd_assert_open(fd, in mfd_assert_shrink()
603 mfd_assert_size(fd, 0); in mfd_assert_shrink()
606 static void mfd_fail_shrink(int fd) in mfd_fail_shrink() argument
610 r = ftruncate(fd, mfd_def_size / 2); in mfd_fail_shrink()
616 mfd_fail_open(fd, in mfd_fail_shrink()
621 static void mfd_assert_grow(int fd) in mfd_assert_grow() argument
625 r = ftruncate(fd, mfd_def_size * 2); in mfd_assert_grow()
631 mfd_assert_size(fd, mfd_def_size * 2); in mfd_assert_grow()
633 r = fallocate(fd, in mfd_assert_grow()
642 mfd_assert_size(fd, mfd_def_size * 4); in mfd_assert_grow()
645 static void mfd_fail_grow(int fd) in mfd_fail_grow() argument
649 r = ftruncate(fd, mfd_def_size * 2); in mfd_fail_grow()
655 r = fallocate(fd, in mfd_fail_grow()
665 static void mfd_assert_grow_write(int fd) in mfd_assert_grow_write() argument
680 l = pwrite(fd, buf, mfd_def_size * 8, 0); in mfd_assert_grow_write()
686 mfd_assert_size(fd, mfd_def_size * 8); in mfd_assert_grow_write()
689 static void mfd_fail_grow_write(int fd) in mfd_fail_grow_write() argument
704 l = pwrite(fd, buf, mfd_def_size * 8, 0); in mfd_fail_grow_write()
711 static void mfd_assert_mode(int fd, int mode) in mfd_assert_mode() argument
716 fd2name(fd, buf, PATH_MAX); in mfd_assert_mode()
718 if (fstat(fd, &st) < 0) { in mfd_assert_mode()
730 static void mfd_assert_chmod(int fd, int mode) in mfd_assert_chmod() argument
734 fd2name(fd, buf, PATH_MAX); in mfd_assert_chmod()
736 if (fchmod(fd, mode) < 0) { in mfd_assert_chmod()
741 mfd_assert_mode(fd, mode); in mfd_assert_chmod()
744 static void mfd_fail_chmod(int fd, int mode) in mfd_fail_chmod() argument
749 fd2name(fd, buf, PATH_MAX); in mfd_fail_chmod()
751 if (fstat(fd, &st) < 0) { in mfd_fail_chmod()
756 if (fchmod(fd, mode) == 0) { in mfd_fail_chmod()
763 mfd_assert_mode(fd, st.st_mode & 07777); in mfd_fail_chmod()
840 int fd; in test_create() local
857 fd = mfd_assert_new("", 0, 0); in test_create()
858 close(fd); in test_create()
871 fd = mfd_assert_new("", 0, MFD_CLOEXEC); in test_create()
872 close(fd); in test_create()
875 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING); in test_create()
876 close(fd); in test_create()
879 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING | MFD_CLOEXEC); in test_create()
880 close(fd); in test_create()
889 int fd; in test_basic() local
893 fd = mfd_assert_new("kern_memfd_basic", in test_basic()
898 mfd_assert_has_seals(fd, 0); in test_basic()
899 mfd_assert_add_seals(fd, F_SEAL_SHRINK | in test_basic()
901 mfd_assert_has_seals(fd, F_SEAL_SHRINK | in test_basic()
905 mfd_assert_add_seals(fd, F_SEAL_SHRINK | in test_basic()
907 mfd_assert_has_seals(fd, F_SEAL_SHRINK | in test_basic()
911 mfd_assert_add_seals(fd, F_SEAL_GROW | F_SEAL_SEAL); in test_basic()
912 mfd_assert_has_seals(fd, F_SEAL_SHRINK | in test_basic()
918 mfd_fail_add_seals(fd, F_SEAL_GROW); in test_basic()
919 mfd_fail_add_seals(fd, 0); in test_basic()
921 close(fd); in test_basic()
924 fd = mfd_assert_new("kern_memfd_basic", in test_basic()
927 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_basic()
928 mfd_fail_add_seals(fd, F_SEAL_SHRINK | in test_basic()
931 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_basic()
932 close(fd); in test_basic()
941 int fd; in test_seal_write() local
945 fd = mfd_assert_new("kern_memfd_seal_write", in test_seal_write()
948 mfd_assert_has_seals(fd, 0); in test_seal_write()
949 mfd_assert_add_seals(fd, F_SEAL_WRITE); in test_seal_write()
950 mfd_assert_has_seals(fd, F_SEAL_WRITE); in test_seal_write()
952 mfd_assert_read(fd); in test_seal_write()
953 mfd_fail_write(fd); in test_seal_write()
954 mfd_assert_shrink(fd); in test_seal_write()
955 mfd_assert_grow(fd); in test_seal_write()
956 mfd_fail_grow_write(fd); in test_seal_write()
958 close(fd); in test_seal_write()
967 int fd, fd2; in test_seal_future_write() local
972 fd = mfd_assert_new("kern_memfd_seal_future_write", in test_seal_future_write()
976 p = mfd_assert_mmap_shared(fd); in test_seal_future_write()
978 mfd_assert_has_seals(fd, 0); in test_seal_future_write()
980 mfd_assert_add_seals(fd, F_SEAL_FUTURE_WRITE); in test_seal_future_write()
981 mfd_assert_has_seals(fd, F_SEAL_FUTURE_WRITE); in test_seal_future_write()
984 mfd_assert_read(fd); in test_seal_future_write()
985 mfd_assert_read_shared(fd); in test_seal_future_write()
986 mfd_fail_write(fd); in test_seal_future_write()
988 fd2 = mfd_assert_reopen_fd(fd); in test_seal_future_write()
994 mfd_assert_fork_private_write(fd); in test_seal_future_write()
998 close(fd); in test_seal_future_write()
1003 int fd; in test_seal_write_map_read_shared() local
1008 fd = mfd_assert_new("kern_memfd_seal_write_map_read", in test_seal_write_map_read_shared()
1012 mfd_assert_add_seals(fd, F_SEAL_WRITE); in test_seal_write_map_read_shared()
1013 mfd_assert_has_seals(fd, F_SEAL_WRITE); in test_seal_write_map_read_shared()
1015 p = mfd_assert_mmap_read_shared(fd); in test_seal_write_map_read_shared()
1017 mfd_assert_read(fd); in test_seal_write_map_read_shared()
1018 mfd_assert_read_shared(fd); in test_seal_write_map_read_shared()
1019 mfd_fail_write(fd); in test_seal_write_map_read_shared()
1022 close(fd); in test_seal_write_map_read_shared()
1031 int fd; in test_seal_shrink() local
1035 fd = mfd_assert_new("kern_memfd_seal_shrink", in test_seal_shrink()
1038 mfd_assert_has_seals(fd, 0); in test_seal_shrink()
1039 mfd_assert_add_seals(fd, F_SEAL_SHRINK); in test_seal_shrink()
1040 mfd_assert_has_seals(fd, F_SEAL_SHRINK); in test_seal_shrink()
1042 mfd_assert_read(fd); in test_seal_shrink()
1043 mfd_assert_write(fd); in test_seal_shrink()
1044 mfd_fail_shrink(fd); in test_seal_shrink()
1045 mfd_assert_grow(fd); in test_seal_shrink()
1046 mfd_assert_grow_write(fd); in test_seal_shrink()
1048 close(fd); in test_seal_shrink()
1057 int fd; in test_seal_grow() local
1061 fd = mfd_assert_new("kern_memfd_seal_grow", in test_seal_grow()
1064 mfd_assert_has_seals(fd, 0); in test_seal_grow()
1065 mfd_assert_add_seals(fd, F_SEAL_GROW); in test_seal_grow()
1066 mfd_assert_has_seals(fd, F_SEAL_GROW); in test_seal_grow()
1068 mfd_assert_read(fd); in test_seal_grow()
1069 mfd_assert_write(fd); in test_seal_grow()
1070 mfd_assert_shrink(fd); in test_seal_grow()
1071 mfd_fail_grow(fd); in test_seal_grow()
1072 mfd_fail_grow_write(fd); in test_seal_grow()
1074 close(fd); in test_seal_grow()
1083 int fd; in test_seal_resize() local
1087 fd = mfd_assert_new("kern_memfd_seal_resize", in test_seal_resize()
1090 mfd_assert_has_seals(fd, 0); in test_seal_resize()
1091 mfd_assert_add_seals(fd, F_SEAL_SHRINK | F_SEAL_GROW); in test_seal_resize()
1092 mfd_assert_has_seals(fd, F_SEAL_SHRINK | F_SEAL_GROW); in test_seal_resize()
1094 mfd_assert_read(fd); in test_seal_resize()
1095 mfd_assert_write(fd); in test_seal_resize()
1096 mfd_fail_shrink(fd); in test_seal_resize()
1097 mfd_fail_grow(fd); in test_seal_resize()
1098 mfd_fail_grow_write(fd); in test_seal_resize()
1100 close(fd); in test_seal_resize()
1105 * Test fd is created with exec and allow sealing.
1110 int fd; in test_exec_seal() local
1115 fd = mfd_assert_new("kern_memfd_seal_exec", in test_exec_seal()
1119 mfd_assert_mode(fd, 0777); in test_exec_seal()
1120 mfd_assert_chmod(fd, 0644); in test_exec_seal()
1122 mfd_assert_has_seals(fd, 0); in test_exec_seal()
1123 mfd_assert_add_seals(fd, F_SEAL_EXEC); in test_exec_seal()
1124 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_exec_seal()
1126 mfd_assert_chmod(fd, 0600); in test_exec_seal()
1127 mfd_fail_chmod(fd, 0777); in test_exec_seal()
1128 mfd_fail_chmod(fd, 0670); in test_exec_seal()
1129 mfd_fail_chmod(fd, 0605); in test_exec_seal()
1130 mfd_fail_chmod(fd, 0700); in test_exec_seal()
1131 mfd_fail_chmod(fd, 0100); in test_exec_seal()
1132 mfd_assert_chmod(fd, 0666); in test_exec_seal()
1133 mfd_assert_write(fd); in test_exec_seal()
1134 close(fd); in test_exec_seal()
1137 fd = mfd_assert_new("kern_memfd_seal_exec", in test_exec_seal()
1141 mfd_assert_mode(fd, 0777); in test_exec_seal()
1142 mfd_assert_chmod(fd, 0700); in test_exec_seal()
1144 mfd_assert_has_seals(fd, 0); in test_exec_seal()
1145 mfd_assert_add_seals(fd, F_SEAL_EXEC); in test_exec_seal()
1146 mfd_assert_has_seals(fd, F_WX_SEALS); in test_exec_seal()
1148 mfd_fail_chmod(fd, 0711); in test_exec_seal()
1149 mfd_fail_chmod(fd, 0600); in test_exec_seal()
1150 mfd_fail_write(fd); in test_exec_seal()
1151 close(fd); in test_exec_seal()
1156 * Test fd is created with exec and not allow sealing.
1160 int fd; in test_exec_no_seal() local
1165 fd = mfd_assert_new("kern_memfd_exec_no_sealing", in test_exec_no_seal()
1168 mfd_assert_mode(fd, 0777); in test_exec_no_seal()
1169 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_exec_no_seal()
1170 mfd_assert_chmod(fd, 0666); in test_exec_no_seal()
1171 close(fd); in test_exec_no_seal()
1179 int fd; in test_noexec_seal() local
1184 fd = mfd_assert_new("kern_memfd_noexec", in test_noexec_seal()
1187 mfd_assert_mode(fd, 0666); in test_noexec_seal()
1188 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_noexec_seal()
1189 mfd_fail_chmod(fd, 0777); in test_noexec_seal()
1190 close(fd); in test_noexec_seal()
1193 fd = mfd_assert_new("kern_memfd_noexec", in test_noexec_seal()
1196 mfd_assert_mode(fd, 0666); in test_noexec_seal()
1197 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_noexec_seal()
1198 mfd_fail_chmod(fd, 0777); in test_noexec_seal()
1199 close(fd); in test_noexec_seal()
1204 int fd; in test_sysctl_sysctl0() local
1208 fd = mfd_assert_new("kern_memfd_sysctl_0_dfl", in test_sysctl_sysctl0()
1211 mfd_assert_mode(fd, 0777); in test_sysctl_sysctl0()
1212 mfd_assert_has_seals(fd, 0); in test_sysctl_sysctl0()
1213 mfd_assert_chmod(fd, 0644); in test_sysctl_sysctl0()
1214 close(fd); in test_sysctl_sysctl0()
1225 int fd; in test_sysctl_sysctl1() local
1229 fd = mfd_assert_new("kern_memfd_sysctl_1_dfl", in test_sysctl_sysctl1()
1232 mfd_assert_mode(fd, 0666); in test_sysctl_sysctl1()
1233 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_sysctl_sysctl1()
1234 mfd_fail_chmod(fd, 0777); in test_sysctl_sysctl1()
1235 close(fd); in test_sysctl_sysctl1()
1237 fd = mfd_assert_new("kern_memfd_sysctl_1_exec", in test_sysctl_sysctl1()
1240 mfd_assert_mode(fd, 0777); in test_sysctl_sysctl1()
1241 mfd_assert_has_seals(fd, 0); in test_sysctl_sysctl1()
1242 mfd_assert_chmod(fd, 0644); in test_sysctl_sysctl1()
1243 close(fd); in test_sysctl_sysctl1()
1245 fd = mfd_assert_new("kern_memfd_sysctl_1_noexec", in test_sysctl_sysctl1()
1248 mfd_assert_mode(fd, 0666); in test_sysctl_sysctl1()
1249 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_sysctl_sysctl1()
1250 mfd_fail_chmod(fd, 0777); in test_sysctl_sysctl1()
1251 close(fd); in test_sysctl_sysctl1()
1262 int fd; in test_sysctl_sysctl2() local
1266 fd = mfd_assert_new("kern_memfd_sysctl_2_dfl", in test_sysctl_sysctl2()
1269 mfd_assert_mode(fd, 0666); in test_sysctl_sysctl2()
1270 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_sysctl_sysctl2()
1271 mfd_fail_chmod(fd, 0777); in test_sysctl_sysctl2()
1272 close(fd); in test_sysctl_sysctl2()
1277 fd = mfd_assert_new("kern_memfd_sysctl_2_noexec", in test_sysctl_sysctl2()
1280 mfd_assert_mode(fd, 0666); in test_sysctl_sysctl2()
1281 mfd_assert_has_seals(fd, F_SEAL_EXEC); in test_sysctl_sysctl2()
1282 mfd_fail_chmod(fd, 0777); in test_sysctl_sysctl2()
1283 close(fd); in test_sysctl_sysctl2()
1460 int fd, fd2; in test_share_dup() local
1464 fd = mfd_assert_new("kern_memfd_share_dup", in test_share_dup()
1467 mfd_assert_has_seals(fd, 0); in test_share_dup()
1469 fd2 = mfd_assert_dup(fd); in test_share_dup()
1472 mfd_assert_add_seals(fd, F_SEAL_WRITE); in test_share_dup()
1473 mfd_assert_has_seals(fd, F_SEAL_WRITE); in test_share_dup()
1477 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK); in test_share_dup()
1480 mfd_assert_add_seals(fd, F_SEAL_SEAL); in test_share_dup()
1481 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK | F_SEAL_SEAL); in test_share_dup()
1484 mfd_fail_add_seals(fd, F_SEAL_GROW); in test_share_dup()
1486 mfd_fail_add_seals(fd, F_SEAL_SEAL); in test_share_dup()
1491 mfd_fail_add_seals(fd, F_SEAL_GROW); in test_share_dup()
1492 close(fd); in test_share_dup()
1501 int fd; in test_share_mmap() local
1506 fd = mfd_assert_new("kern_memfd_share_mmap", in test_share_mmap()
1509 mfd_assert_has_seals(fd, 0); in test_share_mmap()
1512 p = mfd_assert_mmap_shared(fd); in test_share_mmap()
1513 mfd_fail_add_seals(fd, F_SEAL_WRITE); in test_share_mmap()
1514 mfd_assert_has_seals(fd, 0); in test_share_mmap()
1515 mfd_assert_add_seals(fd, F_SEAL_SHRINK); in test_share_mmap()
1516 mfd_assert_has_seals(fd, F_SEAL_SHRINK); in test_share_mmap()
1520 p = mfd_assert_mmap_private(fd); in test_share_mmap()
1521 mfd_assert_add_seals(fd, F_SEAL_WRITE); in test_share_mmap()
1522 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK); in test_share_mmap()
1525 close(fd); in test_share_mmap()
1529 * Test sealing with open(/proc/self/fd/%d)
1536 int fd, fd2; in test_share_open() local
1540 fd = mfd_assert_new("kern_memfd_share_open", in test_share_open()
1543 mfd_assert_has_seals(fd, 0); in test_share_open()
1545 fd2 = mfd_assert_open(fd, O_RDWR, 0); in test_share_open()
1546 mfd_assert_add_seals(fd, F_SEAL_WRITE); in test_share_open()
1547 mfd_assert_has_seals(fd, F_SEAL_WRITE); in test_share_open()
1551 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK); in test_share_open()
1554 close(fd); in test_share_open()
1555 fd = mfd_assert_open(fd2, O_RDONLY, 0); in test_share_open()
1557 mfd_fail_add_seals(fd, F_SEAL_SEAL); in test_share_open()
1558 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK); in test_share_open()
1562 fd2 = mfd_assert_open(fd, O_RDWR, 0); in test_share_open()
1565 mfd_assert_has_seals(fd, F_SEAL_WRITE | F_SEAL_SHRINK | F_SEAL_SEAL); in test_share_open()
1569 close(fd); in test_share_open()
1578 int fd; in test_share_fork() local
1583 fd = mfd_assert_new("kern_memfd_share_fork", in test_share_fork()
1586 mfd_assert_has_seals(fd, 0); in test_share_fork()
1589 mfd_assert_add_seals(fd, F_SEAL_SEAL); in test_share_fork()
1590 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_share_fork()
1592 mfd_fail_add_seals(fd, F_SEAL_WRITE); in test_share_fork()
1593 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_share_fork()
1597 mfd_fail_add_seals(fd, F_SEAL_WRITE); in test_share_fork()
1598 mfd_assert_has_seals(fd, F_SEAL_SEAL); in test_share_fork()
1600 close(fd); in test_share_fork()