<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gocryptfs/internal/syscallcompat, branch LockSharedStorage_rebase1</title>
<subtitle>Mirror of gocryptfs source code on Github</subtitle>
<id>http://nuetzlich.net/cgit/gocryptfs/atom?h=LockSharedStorage_rebase1</id>
<link rel='self' href='http://nuetzlich.net/cgit/gocryptfs/atom?h=LockSharedStorage_rebase1'/>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/'/>
<updated>2024-12-04T18:53:15+00:00</updated>
<entry>
<title>fusefrontend: sharedstorage: use byte-range lock on file header creation</title>
<updated>2024-12-04T18:53:15+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2023-06-02T12:24:44+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=8f76d1ea0a63f546ad09fa70be1ed7b6a7d29fe6'/>
<id>urn:sha1:8f76d1ea0a63f546ad09fa70be1ed7b6a7d29fe6</id>
<content type='text'>
Multiple host writing to the same empty file at the same time
could have overwritten each other's newly created file header,
leading to data corruption.

Fix the race by placing a byte-range lock on the file when
creating the file header.
</content>
</entry>
<entry>
<title>syscallcompat: Openat: always set O_CLOEXEC</title>
<updated>2024-05-17T20:14:55+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2024-05-17T20:14:55+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=da873087dd7bcc54d96748a1f6e4e8ecf9e265e5'/>
<id>urn:sha1:da873087dd7bcc54d96748a1f6e4e8ecf9e265e5</id>
<content type='text'>
Let's not leak fds to logger.

Before:

	$ lsof -p $(pgrep logger)
	COMMAND    PID  USER   FD   TYPE             DEVICE  SIZE/OFF    NODE NAME
	logger  146410 jakob  cwd    DIR              253,0      4096       2 /
	logger  146410 jakob  rtd    DIR              253,0      4096       2 /
	logger  146410 jakob  txt    REG              253,0     41560 6293858 /usr/bin/logger
	logger  146410 jakob  mem    REG              253,0 229754784 6292695 /usr/lib/locale/locale-archive
	logger  146410 jakob  mem    REG              253,0    186480 6292031 /usr/lib64/libgcc_s-14-20240508.so.1
	logger  146410 jakob  mem    REG              253,0    787128 6294119 /usr/lib64/libzstd.so.1.5.6
	logger  146410 jakob  mem    REG              253,0    211424 6294587 /usr/lib64/liblzma.so.5.4.6
	logger  146410 jakob  mem    REG              253,0    131128 6302636 /usr/lib64/liblz4.so.1.9.4
	logger  146410 jakob  mem    REG              253,0     49184 6302330 /usr/lib64/libcap.so.2.69
	logger  146410 jakob  mem    REG              253,0   2476880 6295299 /usr/lib64/libc.so.6
	logger  146410 jakob  mem    REG              253,0    987256 6292058 /usr/lib64/libsystemd.so.0.38.0
	logger  146410 jakob  mem    REG              253,0    906256 6295295 /usr/lib64/ld-linux-x86-64.so.2
	logger  146410 jakob    0r  FIFO               0,14       0t0  607727 pipe
	logger  146410 jakob    1w   CHR                1,3       0t0       4 /dev/null
	logger  146410 jakob    2w   CHR                1,3       0t0       4 /dev/null
	logger  146410 jakob    3u  unix 0x0000000046d9c96b       0t0  607729 type=DGRAM (CONNECTED)
	logger  146410 jakob   10u   DIR               0,33        80    7758 /tmp/tmp.lbUiEw9P6W/a

After:

	$ lsof -p $(pgrep logger)
	COMMAND    PID  USER   FD   TYPE             DEVICE  SIZE/OFF    NODE NAME
	logger  147982 jakob  cwd    DIR              253,0      4096       2 /
	logger  147982 jakob  rtd    DIR              253,0      4096       2 /
	logger  147982 jakob  txt    REG              253,0     41560 6293858 /usr/bin/logger
	logger  147982 jakob  mem    REG              253,0 229754784 6292695 /usr/lib/locale/locale-archive
	logger  147982 jakob  mem    REG              253,0    186480 6292031 /usr/lib64/libgcc_s-14-20240508.so.1
	logger  147982 jakob  mem    REG              253,0    787128 6294119 /usr/lib64/libzstd.so.1.5.6
	logger  147982 jakob  mem    REG              253,0    211424 6294587 /usr/lib64/liblzma.so.5.4.6
	logger  147982 jakob  mem    REG              253,0    131128 6302636 /usr/lib64/liblz4.so.1.9.4
	logger  147982 jakob  mem    REG              253,0     49184 6302330 /usr/lib64/libcap.so.2.69
	logger  147982 jakob  mem    REG              253,0   2476880 6295299 /usr/lib64/libc.so.6
	logger  147982 jakob  mem    REG              253,0    987256 6292058 /usr/lib64/libsystemd.so.0.38.0
	logger  147982 jakob  mem    REG              253,0    906256 6295295 /usr/lib64/ld-linux-x86-64.so.2
	logger  147982 jakob    0r  FIFO               0,14       0t0  609636 pipe
	logger  147982 jakob    1w   CHR                1,3       0t0       4 /dev/null
	logger  147982 jakob    2w   CHR                1,3       0t0       4 /dev/null
	logger  147982 jakob    3u  unix 0x00000000bc46d033       0t0  610344 type=DGRAM (CONNECTED)

Fixes https://github.com/rfjakob/gocryptfs/issues/846
</content>
</entry>
<entry>
<title>make format</title>
<updated>2022-08-28T09:11:36+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-08-28T09:11:36+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=003a7fa2e53ac15d2c94a34102ae12b69b23c586'/>
<id>urn:sha1:003a7fa2e53ac15d2c94a34102ae12b69b23c586</id>
<content type='text'>
</content>
</entry>
<entry>
<title>root_test: add TestOverlay ; syscallcompat: add QuirkNoUserXattr</title>
<updated>2022-01-27T14:44:09+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-01-27T14:44:09+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=ba75aa1ab0dcef8ad8c8fbb11e8895413ad26787'/>
<id>urn:sha1:ba75aa1ab0dcef8ad8c8fbb11e8895413ad26787</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fusefrontend: fix "duplicate case" darwin build failure</title>
<updated>2022-01-22T11:44:04+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-01-22T11:40:54+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=b859bc96efa91eff01f7dc0c14d90633b7e4ba92'/>
<id>urn:sha1:b859bc96efa91eff01f7dc0c14d90633b7e4ba92</id>
<content type='text'>
$ ./crossbuild.bash
[...]
+ GOOS=darwin
+ GOARCH=amd64
+ build
+ go build -tags without_openssl -o /dev/null
internal/fusefrontend/node.go:397:2: duplicate case syscallcompat.RENAME_NOREPLACE (value 0) in switch
	previous case at internal/fusefrontend/node.go:397:7
internal/fusefrontend/node.go:397:2: duplicate case syscallcompat.RENAME_EXCHANGE (value 0) in switch
	previous case at internal/fusefrontend/node.go:397:7
internal/fusefrontend/node.go:397:2: duplicate case syscallcompat.RENAME_WHITEOUT (value 0) in switch
	previous case at internal/fusefrontend/node.go:397:7
internal/fusefrontend/node.go:399:38: duplicate case syscallcompat.RENAME_NOREPLACE | syscallcompat.RENAME_WHITEOUT (value 0) in switch
	previous case at internal/fusefrontend/node.go:397:7
</content>
</entry>
<entry>
<title>fusefrontend: support RENAME_WHITEOUT, RENAME_EXCHANGE</title>
<updated>2022-01-22T11:28:27+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2022-01-22T11:28:27+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=b7cac4ffd07733ab6bcd0d33345de3306a8a5a59'/>
<id>urn:sha1:b7cac4ffd07733ab6bcd0d33345de3306a8a5a59</id>
<content type='text'>
Both new internal test and xfstests generic/013 are happy.

https://github.com/rfjakob/gocryptfs/issues/641
</content>
</entry>
<entry>
<title>darwin: use O_NOFOLLOW for xattr opens</title>
<updated>2021-12-09T16:55:05+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-12-09T16:55:05+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=bd1ecf537983ee5207e78f9bcd6a6ae50c1b4c62'/>
<id>urn:sha1:bd1ecf537983ee5207e78f9bcd6a6ae50c1b4c62</id>
<content type='text'>
Running the tests we have lots of these:

Openat: O_NOFOLLOW missing: flags = 0x4
-wpanic turns this warning into a panic: Openat: O_NOFOLLOW missing: flags = 0x4
panic: -wpanic turns this warning into a panic: Openat: O_NOFOLLOW missing: flags = 0x4

goroutine 114 [running]:
log.(*Logger).Panic(0x14000118280, {0x14000313ca8, 0x1, 0x1})
	log/log.go:224 +0x90
github.com/rfjakob/gocryptfs/v2/internal/tlog.(*toggledLogger).Printf(0x14000076780, {0x1009dc2e8, 0x27}, {0x14000313d18, 0x1, 0x1})
	github.com/rfjakob/gocryptfs/v2/internal/tlog/log.go:78 +0x168
github.com/rfjakob/gocryptfs/v2/internal/syscallcompat.Openat(0x9, {0x1009d0747, 0x1}, 0x4, 0x0)
	github.com/rfjakob/gocryptfs/v2/internal/syscallcompat/sys_common.go:59 +0xf0
github.com/rfjakob/gocryptfs/v2/internal/fusefrontend.(*Node).getXAttr(0x14000142000, {0x1400001c140, 0x3a})
	github.com/rfjakob/gocryptfs/v2/internal/fusefrontend/node_xattr_darwin.go:30 +0x8c
github.com/rfjakob/gocryptfs/v2/internal/fusefrontend.(*Node).Getxattr(0x14000142000, {0x100a7eba0, 0x1400000c2e8}, {0x14000016348, 0x14}, {0x14000326000, 0x20, 0x4000})
	github.com/rfjakob/gocryptfs/v2/internal/fusefrontend/node_xattr.go:65 +0x1ac
github.com/hanwen/go-fuse/v2/fs.(*rawBridge).GetXAttr(0x1400008e140, 0x140001901e0, 0x140001133c0, {0x14000016348, 0x14}, {0x14000326000, 0x20, 0x4000})
	github.com/hanwen/go-fuse/v2@v2.1.1-0.20210825171523-3ab5d95a30ae/fs/bridge.go:685 +0x114
github.com/hanwen/go-fuse/v2/fuse.doGetXAttr(0x14000144000, 0x14000113200)
	github.com/hanwen/go-fuse/v2@v2.1.1-0.20210825171523-3ab5d95a30ae/fuse/opcode.go:270 +0x224
github.com/hanwen/go-fuse/v2/fuse.(*Server).handleRequest(0x14000144000, 0x14000113200)
	github.com/hanwen/go-fuse/v2@v2.1.1-0.20210825171523-3ab5d95a30ae/fuse/server.go:499 +0x214
created by github.com/hanwen/go-fuse/v2/fuse.(*Server).loop
	github.com/hanwen/go-fuse/v2@v2.1.1-0.20210825171523-3ab5d95a30ae/fuse/server.go:470 +0xac

https://github.com/rfjakob/gocryptfs/issues/625
</content>
</entry>
<entry>
<title>Unbreak hyperlinks broken by go mod v2 conversion</title>
<updated>2021-08-30T09:31:01+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-30T09:31:01+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=34d8a498c4899b1493f7bea16c22486d6725c9b1'/>
<id>urn:sha1:34d8a498c4899b1493f7bea16c22486d6725c9b1</id>
<content type='text'>
Commit

  69d88505fd7f4cb0d9e4f1918de296342fe05858 go mod: declare module version v2

translated all instances of "github.com/rfjakob/gocryptfs/" to
"github.com/rfjakob/gocryptfs/v2/".

Unfortunately, this included hyperlinks.

Unbreak the hyperlinks like this:

  find . -name \*.go | xargs sed -i s%https://github.com/rfjakob/gocryptfs/v2/%https://github.com/rfjakob/gocryptfs/v2/%
</content>
</entry>
<entry>
<title>go mod: declare module version v2</title>
<updated>2021-08-23T13:05:15+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-23T13:05:15+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=69d88505fd7f4cb0d9e4f1918de296342fe05858'/>
<id>urn:sha1:69d88505fd7f4cb0d9e4f1918de296342fe05858</id>
<content type='text'>
Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
</content>
</entry>
<entry>
<title>syscallcompat: use early return in asUser()</title>
<updated>2021-08-19T07:01:58+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-19T07:01:58+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=02c91d73ce2c63f999f2c29cf61d55caef19c67b'/>
<id>urn:sha1:02c91d73ce2c63f999f2c29cf61d55caef19c67b</id>
<content type='text'>
</content>
</entry>
</feed>
