Commit Graph

6 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
af0435e16b tarfs: Fix deadlock between descent and ascent in tarfs_lookup().
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D38486
2023-02-10 17:19:45 +00:00
Dag-Erling Smørgrav
ce6a0c776b tarfs: Fix issues revealed by static analysis and testing.
* 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
2023-02-09 17:35:47 +00:00
Dag-Erling Smørgrav
a8fc2fe3af tarfs: Remove unnecessary code.
Reported by:	kib
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D38401
2023-02-06 17:24:32 +01:00
Dag-Erling Smørgrav
c9ff56ce2d tarfs: Terminate dirents before copying them out.
Reported by:	markj
Sponsored by:	Juniper Networks, Inc.
Sponsored bu:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D38400
2023-02-06 17:24:27 +01:00
Dag-Erling Smørgrav
fb53e7adaf tarfs: Fix 32-bit build.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
2023-02-02 21:39:10 +01:00
Dag-Erling Smørgrav
69d94f4c76 Add tarfs, a filesystem backed by tarballs.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma, imp
Differential Revision:	https://reviews.freebsd.org/D37753
2023-02-02 18:19:29 +01:00