-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent "Operation not permitted" errors when rsync'ing to a gocryptfs mount #892
Comments
After some further testing it appears that this issue occurs when:
The non-root user is the owner of the encrypted folder, the mount point, and the source folder/files. I cannot repro this issue if either the rsync is run by root (regardless of who mounts the directory) or if the mount is performed by the non-root user (with or without the |
Hi, thanks for the report! What backing filesystems are in use at source and target? |
The encrypted target folder is on an EXT4 filesystem. The FS is on an LVM partition that is LUKS encrypted on a Linux MD array (RAID6). The issue occurs both when the source filesystem is the same as that of the encrypted target folder and when the source filesystem is remote (APFS on a Mac). |
FWIW, this seemed like a race to me when I was playing around with it. That makes me think it's worth mentioning a couple things:
|
Noticed the discussion in #893 so wanted to add that in my case the system running gocryptfs is an Intel Xeon w7-3465x (Sapphire Rapids). |
So, golang/sys@d0df966 broke it, and the Debian x/sys/unix package https://packages.debian.org/source/bookworm/golang-golang-x-sys is new enough to have this commit. If you build gocryptfs v2.3.0 from source the problem should disappear. Can you confirm? |
Oh great, thanks for finding the root cause. Building v2.4.0 from source eliminates the problem so I'm inclined to go with that unless there's a specific reason to prefer v2.3.0 over v2.4.0. |
I suggest using v2.5.1, released just now. |
Built v2.5.1 from source and it seems to be working as expected. |
Hello So far the only one that works without issues on my mac is the 2.3.1 from MacPorts Would be awesome to use the latest version on my mac :) gocryptfs v2.5.1-1-g5169c47 without_openssl; go-fuse v2.5.0; 2025-01-25 go1.23.5 darwin/arm64 debug output cli args: ["gocryptfs" "-fg" "-notifypid=8638" "--debug" "crypt" "mount"] Password: Decrypting master key cryptocore.New: key=32 bytes, aeadType=AES-GCM-256-Go, IVBitLen=128, useHKDF=true contentenc.New: plainBS=4096 CryptoCore.Wipe: Only nil'ing stdlib refs cryptocore.New: key=32 bytes, aeadType=XChaCha20-Poly1305-Go, IVBitLen=192, useHKDF=true contentenc.New: plainBS=4096 nametransform.New: longNameMax=0, raw64=true, badname=[] frontendArgs: { "Cipherdir": "/Users/alain/Desktop/crypt", "PlaintextNames": false, "LongNames": true, "PreserveOwner": false, "ForceOwner": null, "ConfigCustom": false, "NoPrealloc": false, "Exclude": null, "ExcludeWildcard": null, "ExcludeFrom": null, "Suid": false, "KernelCache": false, "SharedStorage": false, "OneFileSystem": false, "DeterministicNames": false } DetectQuirks: Fstypename="apfs" OpenDir ".": invalid entry ".DS_Store": illegal base64 data at input byte 0 decryptName "zero": decoded length 3 is not a multiple of 16 OpenDir ".": invalid entry "zero": bad message ino81414905: FUSE Read: offset=0 length=6148 doRead: off=0 len=6148 -> off=18 len=8272 skip=0 ReadAt offset=18 bytes (0 blocks), want=8272, got=6228 ino81414905: Read: errno=0, returning 6148 bytes ino81414905: FUSE Read: offset=0 length=6148 doRead: off=0 len=6148 -> off=18 len=8272 skip=0 ReadAt offset=18 bytes (0 blocks), want=8272, got=6228 ino81414905: Read: errno=0, returning 6148 bytes ino81414905: FUSE Read: offset=0 length=6148 doRead: off=0 len=6148 -> off=18 len=8272 skip=0 ReadAt offset=18 bytes (0 blocks), want=8272, got=6228 ino81414905: Read: errno=0, returning 6148 bytes ino81414905: FUSE Read: offset=0 length=6148 doRead: off=0 len=6148 -> off=18 len=8272 skip=0 ReadAt offset=18 bytes (0 blocks), want=8272, got=6228 ino81414905: Read: errno=0, returning 6148 bytes Filesystem mounted and ready. System Version: macOS 14.7.2 (23H311) Kernel Version: Darwin 23.6.0 Underlying FS: APFS |
I have a target directory mounted with gocryptfs and I'm using rsync to copy files from an (unencrypted) source directory to it. I'm getting intermittent errors from rsync when it uses mkstemp and mkdir to create temporary files and directories during the sync process. For example:
These issues happen seemingly at random and to different sets of files/directories each time I run the copy (same set of source files, always to an empty directory).
FWIW, I don't see these issues with cp, nor do I see the issues using rsync writing to an encfs mount.
I'm using:
6.11.10+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.10-1~bpo12+1 (2024-12-19)
)gocryptfs 2.3; go-fuse 2.1.0+git20220822.58a7e14; 2023-04-09 go1.19.8 linux/amd64
)This also repros with a local build of the latest gocryptfs source (commit 1464f9d).
The text was updated successfully, but these errors were encountered: