aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/fs/tarfs
Commit message (Collapse)AuthorAgeFilesLines
* tarfs: tests: Increase timeout (again 2)Jose Luis Duran2026-01-171-1/+1
| | | | | | | | | | Bump the timeout value (for the third time), to avoid cutoff on emulated architectures on ci.freebsd.org. One of the runners will take considerably more time to complete this test. Reported by: Jenkins Fixes: a551b0524953 ("tarfs: tests: Increase timeout (again)") MFC after: 3 days
* tarfs: tests: Increase timeout (again)Jose Luis Duran2026-01-121-1/+1
| | | | | | | | | Bump the timeout value (a little more), to avoid cutoff on emulated architectures on ci.freebsd.org. Reported by: Jenkins Fixes: 47015e454661 ("tests: Increase timeout") MFC after: 3 days
* tests: Increase timeoutJose Luis Duran2026-01-071-1/+1
| | | | | | | | | | Bump the timeout value, to avoid cutoff on emulated architectures on ci.freebsd.org. Reported by: Jenkins Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54550
* tarfs: Fix support for large filesDag-Erling Smørgrav2025-11-121-0/+27
| | | | | | | | | | | | | | | | | | | | * When fast-forwarding through a zstd frame, we incorrectly used the min() inline function instead of the MIN() macro. The function truncates the result to unsigned int, resulting in a decompression error when trying to seek more than 4 GB into the frame. * POSIX states that a size extended header record overrides the size field in the header if present, and that one must be included if the size of the file exceeds 8 GB (the size field maxes out at 64 GB). * Reduce repetition in the exthdr parser by deduplicating the syntax error handler. MFC after: 1 week Sponsored by: Klara, Inc. Fixes: 69d94f4c7608 ("Add tarfs, a filesystem backed by tarballs.") Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D53718
* tarfs: Simplify sameness checksDag-Erling Smørgrav2025-10-071-3/+3
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D52928
* atf, kyua: Implement require.kmods.Dag-Erling Smørgrav2025-05-311-1/+17
| | | | | | | | | | This adds a metadata variable, require.kmods, and corresponding functions or methods in C, C++, and shell, which allow a test to specify that it requires particular kernel modules to run. If the kernel modules are not present, the test is skipped. One might want to consider a kyua option which makes it attempt to load the modules instead. Differential Revision: https://reviews.freebsd.org/D47470
* tarfs: Ignore global extended headers.Dag-Erling Smørgrav2024-04-031-0/+24
| | | | | | | | | | | | | | Previously, we would error out if we encountered a global extended header, because we don't know what it means. This doesn't really matter though, and traditionally, tar implementations have either ignored them or treated them as plain files, so just ignore them. This allows tarfs to mount tar files created by `git archive`. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44600
* tarfs: Support paths that spill into exthdrs.Dag-Erling Smørgrav2024-04-031-0/+50
| | | | | | | | MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44599
* tarfs: Factor out common test code.Dag-Erling Smørgrav2024-03-061-26/+26
| | | | | | | | MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44227
* tarfs: Fix checksum calculation.Dag-Erling Smørgrav2024-03-061-0/+22
| | | | | | | | | | | | | | The checksum code assumed that struct ustar_header filled an entire block and calculcated the checksum based on the size of the structure. The header is in fact only 500 bytes long while the checksum covers the entire block (“logical record” in POSIX terms). Add padding and an assertion, and clean up the checksum code. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44226
* tarfs: Fix two input validation issues.Dag-Erling Smørgrav2024-03-063-2/+196
| | | | | | | | | | | | | | | | | | | | | | | * Reject hard or soft links with an empty target path. Currently, a debugging kernel will hit an assertion in tarfs_lookup_path() while a non-debugging kernel will happily create a link to the mount root. * Use a temporary variable to store the result of the link target path, and copy it to tnp->other only once we have found it to be valid. Otherwise we error out after creating a reference to the target but before incrementing the target's reference count, which results in a use-after-free situation in the cleanup code. * Correctly return ENOENT from tarfs_lookup_path() if the requested path was not found and create_dirs is false. Luckily, existing callers did not rely solely on the return value. MFC after: 3 days PR: 277360 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44161
* makefs: add missing break for 'g' case in tarfs testEd Maste2023-03-231-0/+1
| | | | | | | Reported by: Coverity Scan CID: 1506954 Fixes: 6cb78fa479c7 ("tarfs: Repeat tests using GNU tar if available.") Sponsored by: The FreeBSD Foundation
* tarfs: Fix backtracking during node creation.Dag-Erling Smørgrav2023-03-162-13/+9
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39082
* tarfs: Support tar files which include file modes with permissions.Dag-Erling Smørgrav2023-03-161-0/+1
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39020
* tarfs: Correctly track link count.Dag-Erling Smørgrav2023-03-161-0/+2
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39019
* tarfs: Repeat tests using GNU tar if available.Dag-Erling Smørgrav2023-03-162-13/+104
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: ngie, asomers Differential Revision: https://reviews.freebsd.org/D39018
* tarfs: Set mountedfrom correctly.Dag-Erling Smørgrav2023-03-071-2/+4
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: sjg, kib Differential Revision: https://reviews.freebsd.org/D38930
* testing: skip tarfs tests if module is not loadable.Olivier Cochard2023-03-011-1/+6
| | | | | | Approved by: asomers Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D38828
* tarfs: Really prevent descending into a non-directory.Dag-Erling Smørgrav2023-02-201-12/+75
| | | | | | | | | | | The previous fix was incorrect: we need to verify that the current node, if it exists, is not a directory, but we were checking the parent node instead. Address this, add more tests, and fix the test cleanup routines. PR: 269519, 269561 Fixes: ae6cff89738b Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38645
* tarfs: Don't panic if the parent of a new node is not a directory.Dag-Erling Smørgrav2023-02-151-4/+26
| | | | | | | | PR: 269519 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38587
* tarfs: Fix issues revealed by static analysis and testing.Dag-Erling Smørgrav2023-02-091-3/+40
| | | | | | | | | | | | | | | | | | * tarfs_alloc_mount(): Remove an unnecessary null check (CID 1504505) and an unused variable. * tarfs_alloc_one(): Verify that the file size is not negative (CID 1504506). While there, also validate the mode, owner and group. * tarfs_vget(), tarfs_zio_init(): Explicitly ignore return value from getnewvnode(), which cannot fail (CID 1504508) * tarfs_lookup_path(): Fix a case where a specially-crafted tarball could trigger a null pointer dereference by first descending into, and then backing out of, a previously unknown directory. (CID 1504515) * mktar: Construct a tarball that triggers the aforementioned null pointer dereference. Reported by: Coverity Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D38463
* Add tarfs, a filesystem backed by tarballs.Dag-Erling Smørgrav2023-02-023-0/+302
Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: pauamma, imp Differential Revision: https://reviews.freebsd.org/D37753