Repository navigation
fix(fs): drop cached pages when COW blocks are freed (#753) - #754
Merged
Merged
Conversation
Reclaiming a replaced extent returned its blocks to the free list but left their page-cache entries in place. A *dirty* entry for a freed block could then be written back after the free list had handed that block to another file, overwriting its data; a clean one could seed a later write with the previous file's bytes. The content of a freed block no longer matters, so invalidating is always correct. The window explains a boot-to-boot flake in the guest: downloading a 1391-byte DER and using it as `--ca` worked in one boot and failed with `malformed DER` in the next, while the download sizes were always right (#753). Tests: `neofs_v2_reused_blocks_do_not_leak_old_data` (write, delete, recreate, flush, read) and `neofs_v2_chunked_writes_many_files` (8 files, 1024 + 367 bytes each).
When a `--ca` file cannot be parsed the client now prints how many bytes it handed to `libtls` and the first four in hex, so a truncated or shifted file is distinguishable from a wrong certificate at a glance: ``` neocurl: TLS failure neocurl: certificate chain: malformed DER neocurl: ca 1391 bytes [01000000] ``` Refs #748, #753
alexis900
added a commit
that referenced
this pull request
Nov 17, 2026
* feat(tls): load the system trust store (D8) HTTPS needed an explicit `--ca FILE`: the image carried no roots, so every real connection was a fixture exercise. - `libtls::der::split_certificates` splits a concatenated DER bundle using the X.690 lengths (no PEM/base64 parser on the target), with tests. - `libnet::http_transport::system_roots()` reads `\NeoDOS\System\config\roots.der` through `ReadContent` and returns the anchors; a missing or unreadable bundle yields an empty list so TLS fails closed. - `neocurl` uses the system store when `--ca` is absent (`--ca` still overrides), and refuses to start when there are no anchors at all. - NeoDev (external, NeoDOS-Project/NeoDev#47) packs the bundle from the host's CA store; `NEODOS_TRUST_BUNDLE` overrides the source. Docs: D8 marked resolved in `libtls-https-design.md` (§3.6) and the userland guide; `CHANGELOG.md` gains an Unreleased section with this and the filesystem fixes from #750/#751/#754. * fix(usermode): raise the binary slot to 512 KiB and refuse oversized images `MAX_BIN_SIZE` capped a user binary at 192 KiB and the loader *silently truncated* anything larger, so the ELF parser failed far from the cause. When `neocurl.nxe` (crypto + TLS + trust store) crossed 192 KiB the shell reported "Comando o nombre de archivo incorrecto" and the binary simply never ran. - `MAX_BIN_SIZE` is now 512 KiB (slot 576 KiB → 56 slots in the 32 MB user window, still ample). - `create_process_from_ob_path` refuses a binary bigger than the cap with `NoMemory` and logs the size, instead of loading a truncated image. - The design note for large NXEs records the new limit. Refs #755
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continúa #751. Al reclamar un extent reemplazado, los bloques volvían a la free list pero sus páginas seguían en la caché. Una entrada sucia de un bloque liberado puede volcarse después —cuando la free list ya se lo ha dado a otro fichero— y sobrescribir sus datos; una limpia puede sembrar una escritura posterior con los bytes del fichero anterior. El contenido de un bloque liberado ya no importa, así que invalidar siempre es correcto.
Cambios
reclaim_cow_garbageinvalida el rango de caché de cada extent liberado.neofs_v2_reused_blocks_do_not_leak_old_data(escribir, borrar, recrear, leer) yneofs_v2_chunked_writes_many_files(8 ficheros, 1024+367 B cada uno).neocurlimprime, al fallar TLS con--ca, cuántos bytes ha entregado alibtlsy los 4 primeros en hex: distingue fichero truncado/desplazado de certificado equivocado.Estado
El tamaño es correcto pero el contenido no es el DER (
30 82 05 6b), y los bytes 2-3 se incrementan por fichero: parece que la lectura devuelve una estructura del propio filesystem (nodo/dirent) en lugar del bloque de datos, es decir que el extent del fichero apunta a un bloque de metadatos — un problema de free list (un bloque en uso entregado como libre) que no se reproduce aún en los tests.Refs #748, #753