[BUG] Preserve empty-suffix attributes through ext lookup and rewrite #6

Closed
opened 2026-09-29 09:39:47 +02:00 by erikinkinen · 0 comments
Owner

Summary

The ext attribute parser treats a zero-length name suffix as the table terminator. Complete-name namespace entries, including access/default ACL keys, legitimately have empty suffixes. Validation, lookup, value-inode traversal and inline-data rewriting can consequently stop before those attributes and later entries. This violates the existing opaque-attribute preservation contract.

Reproduction

Source-audited finding; no test execution or guest reproduction is claimed. Construct an original ext inode-body table containing namespace index 2 with an empty suffix, a local value and a following ordinary key, then replace system.data through the existing inline-data rewrite. The old parser returns end-of-list at the first entry. The new authored media::xattr::contract_tests controls include preservation, selected-key lookup across both tables and malformed-input refusal. A control in read_snapshot_tests exercises the actual file-read boundary before data copy.

Expected and actual behavior

Expected: only the four-zero-byte terminator ends the list. Empty-suffix keys and subsequent attributes remain visible. Complete table bounds and terminator storage are validated. Exact shared values remain valid and need no duplicate storage during rewrite. A selected inline match cannot hide external corruption or a duplicate selected key; refused lookup staging is cleared.

Before the fix: the name-length byte alone ends traversal; selected inline lookup returns early; body detection treats the extra_isize hint as an absence predicate. These shortcuts can omit legitimate metadata. Parsing and preservation remain separate from ACL policy and native authority.

Environment and identity

Evidence and prior checks

Implemented in signed E2fsd d586bf51 and selected by signed Integration a0e6a61a. Closing as fixed under the user's testing waiver. All thirteen new controls are authored but unrun; closure is not test/CI pass evidence. Complete ACL decoding and native permission enforcement remain separately unfinished.

Original code and fixtures are derived from the ext4 attribute layout, ext2 attribute tables, and e2fsprogs filesystem manual. No external implementation is copied or translated.

Thirteen new controls are authored but unrun. The change splits format rules and fixtures into documented modules, shares inode-body geometry, validates before rewrite publication, and retains shared values. Tests, builds, lint checks, VM/manual/profiler runs and CI observation remain deferred by user instruction. No passing result, warning-free build, full ACL decoding or native permission-enforcement acceptance is claimed.

Tracking

## Summary The ext attribute parser treats a zero-length name suffix as the table terminator. Complete-name namespace entries, including access/default ACL keys, legitimately have empty suffixes. Validation, lookup, value-inode traversal and inline-data rewriting can consequently stop before those attributes and later entries. This violates the existing opaque-attribute preservation contract. ## Reproduction Source-audited finding; no test execution or guest reproduction is claimed. Construct an original ext inode-body table containing namespace index 2 with an empty suffix, a local value and a following ordinary key, then replace `system.data` through the existing inline-data rewrite. The old parser returns end-of-list at the first entry. The new authored `media::xattr::contract_tests` controls include preservation, selected-key lookup across both tables and malformed-input refusal. A control in `read_snapshot_tests` exercises the actual file-read boundary before data copy. ## Expected and actual behavior Expected: only the four-zero-byte terminator ends the list. Empty-suffix keys and subsequent attributes remain visible. Complete table bounds and terminator storage are validated. Exact shared values remain valid and need no duplicate storage during rewrite. A selected inline match cannot hide external corruption or a duplicate selected key; refused lookup staging is cleared. Before the fix: the name-length byte alone ends traversal; selected inline lookup returns early; body detection treats the `extra_isize` hint as an absence predicate. These shortcuts can omit legitimate metadata. Parsing and preservation remain separate from ACL policy and native authority. ## Environment and identity - Component: [E2fsd `4fe6cc68f087d4d71ce0eb82c66c5c75f81a8cb4`](https://git.erikinkinen.fi/erix/e2fsd/commit/4fe6cc68f087d4d71ce0eb82c66c5c75f81a8cb4), `feature/posix-compat`. - Source graph: [Integration `c010965a9126073a2eda15fb2e79fabc97db2346`](https://git.erikinkinen.fi/erix/integration/commit/c010965a9126073a2eda15fb2e79fabc97db2346). - Image/VM/hardware/firmware/toolchain: not exercised; source inspection and original fixture authoring only. - Route: existing private provider operations on the already selected mounted device; no new capabilities or public endpoint. - Last known working revision: unknown. ## Evidence and prior checks Implemented in signed [E2fsd d586bf51](https://git.erikinkinen.fi/erix/e2fsd/commit/d586bf51393af68ea416f4e453018e6760ff44fa) and selected by signed [Integration a0e6a61a](https://git.erikinkinen.fi/erix/integration/commit/a0e6a61a6ce82f5aa4807cc132038093a57656a8). Closing as fixed under the user's testing waiver. All thirteen new controls are authored but unrun; closure is not test/CI pass evidence. Complete ACL decoding and native permission enforcement remain separately unfinished. Original code and fixtures are derived from the [ext4 attribute layout](https://kernel.org/doc/html/next/filesystems/ext4/attributes.html), [ext2 attribute tables](https://www.nongnu.org/ext2-doc/ext2.html), and [e2fsprogs filesystem manual](https://man7.org/linux/man-pages/man5/ext4.5.html). No external implementation is copied or translated. Thirteen new controls are authored but unrun. The change splits format rules and fixtures into documented modules, shares inode-body geometry, validates before rewrite publication, and retains shared values. Tests, builds, lint checks, VM/manual/profiler runs and CI observation remain deferred by user instruction. No passing result, warning-free build, full ACL decoding or native permission-enforcement acceptance is claimed. ## Tracking - [E2fsd implementation review](https://git.erikinkinen.fi/erix/e2fsd/pulls/3) and [repository audit](https://git.erikinkinen.fi/erix/e2fsd/issues/1). - [Permission feature](https://git.erikinkinen.fi/erix/posixd/issues/10), [Integration review](https://git.erikinkinen.fi/erix/integration/pulls/12), [manual review](https://git.erikinkinen.fi/erix/docs/pulls/4). - [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65).
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#6
No description provided.