aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/tarfs/tarfs_io.c
Commit message (Collapse)AuthorAgeFilesLines
* tarfs: Fix support for large filesDag-Erling Smørgrav2025-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | * 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: Don't use IO_DIRECT when reading from tarball.Dag-Erling Smørgrav2023-06-201-4/+2
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40612
* tarfs: Use a separate debug bit for bounce buffer usage.Dag-Erling Smørgrav2023-02-161-3/+3
| | | | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38588
* tarfs: Fix issues revealed by static analysis and testing.Dag-Erling Smørgrav2023-02-091-1/+1
| | | | | | | | | | | | | | | | | | * 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
* tarfs: Silence warnings when no supported compression is enabled.Dag-Erling Smørgrav2023-02-071-1/+15
| | | | | | | | | Some of the code in sys/fs/tarfs/tarfs_io.c is not specific to zstd, but is still only used when some form of decompression is enabled. Put it behind #ifdef TARFS_ZIO to silence warnings. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38415
* tarfs: Remove unnecessary code.Dag-Erling Smørgrav2023-02-061-2/+0
| | | | | | | | Reported by: kib Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38401
* tarfs: Fix non-ZSTDIO build.Dag-Erling Smørgrav2023-02-021-0/+4
| | | | | Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc.
* Add tarfs, a filesystem backed by tarballs.Dag-Erling Smørgrav2023-02-021-0/+727
Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: pauamma, imp Differential Revision: https://reviews.freebsd.org/D37753