| 40d59ee3 | 07-May-2026 |
Alex Richardson <arichardson@FreeBSD.org> |
p9fs: Fix creating files with restrictive permissions
When a file is created via p9fs with restrictive permissions (like 000), the 9P TCREATE request successfully creates and natively opens the file
p9fs: Fix creating files with restrictive permissions
When a file is created via p9fs with restrictive permissions (like 000), the 9P TCREATE request successfully creates and natively opens the file, returning an open, writable file descriptor. Previously, p9fs would attempt a subsequent TOPEN. That TOPEN would fail with EACCES due to the restrictive mode, leaving a 0-byte file and causing operations like 'mv' to abort.
We now preserve the writable descriptor returned by TCREATE so that the subsequent VOP_OPEN can use it directly, avoiding the failing TOPEN. Additionally, p9fs_compatible_mode now appropriately isolates the base access intent when matching fids, preventing extended flags from breaking the match.
A test case for this behavior has been submitted to pjdfstest: https://github.com/pjd/pjdfstest/pull/87
Resolves: https://github.com/CTSRD-CHERI/cheribsd/issues/2617
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56494
show more ...
|
| 96b2f4a9 | 07-May-2026 |
Alex Richardson <arichardson@FreeBSD.org> |
p9fs: implement basic pathconf support
This is needed for various pjdfstest tests which fail with syntax errors if pathconf _PC_NAME_MAX/_PC_PATH_MAX return -1. For NAME_MAX we can use the 9P2000.L
p9fs: implement basic pathconf support
This is needed for various pjdfstest tests which fail with syntax errors if pathconf _PC_NAME_MAX/_PC_PATH_MAX return -1. For NAME_MAX we can use the 9P2000.L Tstatfs call to get namelen from the host. While this could theoretically be different for nested filesystems in the shared mount it is a much better guess than just returning 255. There does not seem to be a way to get the host PATH_MAX, so we just return the conservative kernel default.
Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.
Reviewed by: markj, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56493
show more ...
|
| c2012c7f | 08-Mar-2026 |
Konstantin Belousov <kib@FreeBSD.org> |
p9fs: use atomics for updating node->flags
This should prevent seeing inconsistent flags values when updating it under the shared vnode lock.
Noted and reviewed by: markj Sponsored by: The FreeBSD
p9fs: use atomics for updating node->flags
This should prevent seeing inconsistent flags values when updating it under the shared vnode lock.
Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55665
show more ...
|