[BUG] Attribute deletion ignores shared and inline value-inode lifetimes #9

Closed
opened 2026-09-29 13:49:26 +02:00 by erikinkinen · 0 comments
Owner

Summary

E2fsd's attribute cleanup frees each value inode referenced by a final external attribute block without reading the value inode's sharing count. It also returns immediately when no external attribute block exists, omitting inline value-inode references. Valid shared attribute values can therefore be disposed while another inode still references them, while inline references can remain allocated after owner deletion.

Reproduction

Use an EA_INODE-enabled image with two owning inodes sharing a value inode, then remove one owner whose external attribute block has its final reference. The current release_inode_xattr path calls free_inode_tree directly for the value inode. Separately, give an owner an inline value-inode reference and no external attribute block, then delete that owner: the current cleanup returns before inspecting the inline reference. These are source-derived deterministic fixture scenarios; no destructive or VM reproduction has been run under the testing waiver.

Expected and actual behavior

Expected: inspect all original inline/external attribute references; preserve unrelated/shared values, decrement the format-defined value reference count, and free storage only when its original final reference retires. Reject an ordinary inode substituted for a valid attribute-value object before mutation.

Actual source behavior: external value references reach unconditional tree disposal, independent of shared ownership, and inline-only references do not reach cleanup. The ordinary-file-kind check alone does not establish the referenced inode's attribute role or original lifetime.

Environment and identity

  • E2fsd revision: d019fc5d14.
  • Integration revision: 28f35ac737ec05567f5a277e0eacf40aece20dd2.
  • Profile/image/VM/toolchain: not executed for this finding.
  • Route: admitted original ext mount and native metadata deletion with EA_INODE attribute storage.
  • Last known working revision: unknown.

Evidence and prior checks

Ext value-inode acquisition and cleanup checkpoint — 29 September 2026: e2fsd 407efa3e, docs 6d5da74b, integration 328c153f.

The original provider now streams complete access ACLs from local and EA-inode storage with exact size/role, original inode checksums, modern CRC32C binding or legacy owner/generation validation. One cached data block and fixed owned scratch admit large ACLs without a new total-size or entry-count cap. Failed or changed evidence clears staged pages and retires the matching original observation. No capability, endpoint or credential authority is added.

Shared and inline cleanup is implemented: both stores are preflighted, repeated references cannot undercount the original value, shared external tables retain their own value references, and only a final value reference disposes storage. Raw hash/count fields are distinct from timestamps, EA-only inodes refuse ordinary file selection, and uncertain nonjournaled writes retain provider fail-stop without replay. Seventeen new media/provider controls are authored and unrun, including actual retained dispatch and ACLs above 64 KiB/8191 entries.

The provider permission pass remains open for ACL-aware persistent mode changes and the remaining operation-specific effects. Native filesystem mediation, both complete EriX guest-build generations and the external Rust/LLVM guest rebuild remain unfinished. Canonical phase completion remains 16.23% weighted, 4.81% whole-item, 20/460 parents and 436/896 sub-items; no new small canonical completion item is added for this checkpoint. Reviews: provider, manual, Integration.

Source review of media/mutation/xattr_cleanup.rs, media/mutation/inode_meta.rs and media/xattr.rs. The official large extended-attribute format describes reference-counted sharing and attribute-only value inodes. Existing cleanup handles the external attribute block's sharing count but not the referenced value inode's count. Tests, builds and CI observation remain deferred; no passing or failing execution is claimed.

Tracking

Correct as part of the complete provider permission-lifetime pass and native permission enforcement. Retain separate positive, shared-owner, inline-only, malformed-role and failure cleanup controls in provider review. Keep phase completion consistent with implemented scope.

## Summary E2fsd's attribute cleanup frees each value inode referenced by a final external attribute block without reading the value inode's sharing count. It also returns immediately when no external attribute block exists, omitting inline value-inode references. Valid shared attribute values can therefore be disposed while another inode still references them, while inline references can remain allocated after owner deletion. ## Reproduction Use an EA_INODE-enabled image with two owning inodes sharing a value inode, then remove one owner whose external attribute block has its final reference. The current release_inode_xattr path calls free_inode_tree directly for the value inode. Separately, give an owner an inline value-inode reference and no external attribute block, then delete that owner: the current cleanup returns before inspecting the inline reference. These are source-derived deterministic fixture scenarios; no destructive or VM reproduction has been run under the testing waiver. ## Expected and actual behavior Expected: inspect all original inline/external attribute references; preserve unrelated/shared values, decrement the format-defined value reference count, and free storage only when its original final reference retires. Reject an ordinary inode substituted for a valid attribute-value object before mutation. Actual source behavior: external value references reach unconditional tree disposal, independent of shared ownership, and inline-only references do not reach cleanup. The ordinary-file-kind check alone does not establish the referenced inode's attribute role or original lifetime. ## Environment and identity - E2fsd revision: d019fc5d14dbcfcb3a4bcb0fefc55c225a50f7de. - Integration revision: 28f35ac737ec05567f5a277e0eacf40aece20dd2. - Profile/image/VM/toolchain: not executed for this finding. - Route: admitted original ext mount and native metadata deletion with EA_INODE attribute storage. - Last known working revision: unknown. ## Evidence and prior checks Ext value-inode acquisition and cleanup checkpoint — 29 September 2026: [e2fsd `407efa3e`](https://git.erikinkinen.fi/erix/e2fsd/commit/407efa3ea1580a74806d6040e8cd05f2f81d932a), [docs `6d5da74b`](https://git.erikinkinen.fi/erix/docs/commit/6d5da74bc0f99234f650641b248e8156a34b952f), [integration `328c153f`](https://git.erikinkinen.fi/erix/integration/commit/328c153f6420049d75a57230d78c27703ce4bead). The original provider now streams complete access ACLs from local and EA-inode storage with exact size/role, original inode checksums, modern CRC32C binding or legacy owner/generation validation. One cached data block and fixed owned scratch admit large ACLs without a new total-size or entry-count cap. Failed or changed evidence clears staged pages and retires the matching original observation. No capability, endpoint or credential authority is added. [Shared and inline cleanup](https://git.erikinkinen.fi/erix/e2fsd/issues/9) is implemented: both stores are preflighted, repeated references cannot undercount the original value, shared external tables retain their own value references, and only a final value reference disposes storage. Raw hash/count fields are distinct from timestamps, EA-only inodes refuse ordinary file selection, and uncertain nonjournaled writes retain provider fail-stop without replay. Seventeen new media/provider controls are authored and unrun, including actual retained dispatch and ACLs above 64 KiB/8191 entries. The [provider permission pass](https://git.erikinkinen.fi/erix/e2fsd/issues/8) remains open for ACL-aware persistent mode changes and the remaining operation-specific effects. [Native filesystem mediation](https://git.erikinkinen.fi/erix/posixd/issues/10), both complete EriX guest-build generations and the external Rust/LLVM guest rebuild remain unfinished. Canonical phase completion remains **16.23% weighted**, **4.81% whole-item**, **20/460 parents** and **436/896 sub-items**; no new small canonical completion item is added for this checkpoint. Reviews: [provider](https://git.erikinkinen.fi/erix/e2fsd/pulls/3), [manual](https://git.erikinkinen.fi/erix/docs/pulls/4), [Integration](https://git.erikinkinen.fi/erix/integration/pulls/12). Source review of media/mutation/xattr_cleanup.rs, media/mutation/inode_meta.rs and media/xattr.rs. The official [large extended-attribute format](https://www.kernel.org/doc/html/latest/filesystems/ext4/eainode.html) describes reference-counted sharing and attribute-only value inodes. Existing cleanup handles the external attribute block's sharing count but not the referenced value inode's count. Tests, builds and CI observation remain deferred; no passing or failing execution is claimed. ## Tracking Correct as part of the complete provider permission-lifetime pass and [native permission enforcement](https://git.erikinkinen.fi/erix/posixd/issues/10). Retain separate positive, shared-owner, inline-only, malformed-role and failure cleanup controls in [provider review](https://git.erikinkinen.fi/erix/e2fsd/pulls/3). Keep [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65) consistent with implemented scope.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:46 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/e2fsd#9
No description provided.