Closed foresto closed 2 months ago
My flatpak bug report includes a sequence of events discovered with strace, revealing different behavior on cifs vs. etx4 with respect to temp files and memory mapping. I'm starting to think that behavior comes from libostree. Maintainers here might want to read the report.
I ended up tracing the corruption to a set of cifs regressions that made it into all the stable and mainline kernel releases.
Regardless of whether the memory mapping done here is a good idea, the corruption seems to be gone, so I'm closing this.
Glad you were able to track that. I agree what we're doing here is really silly, there are some abstractions that interact in unnecessary ways. But indeed it looks like other things broke too.
When the repo is on a cifs filesystem, ostree writes gpg signatures full of null bytes, rather than writing the correct signature data. This causes signature validation to fail, completely breaking flatpak repository updates.
Reproducer:
I discovered this while exporting and updating a flatpak repo: flatpak/flatpak#5911
Reproduced on Debian Stable with a current kernel and ostree 2022.7-2, and on Debian Testing with ostree 2024.7-1.
$ uname -a Linux ink 6.10.6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.6-1 (2024-08-19) x86_64 GNU/Linux