Skip to content

Composefs: UKI Digest mismatch after Selinux operations #2704

Backlog

Description

@Johan-Liebert1

See: #2686, #2146 (comment)

I believe the problem is to do with bootc container ukify reading from the final stitched overlay while the other path reads the tar streams. I can see in the final diff that only the mtimes differ. An example below

Command diff <dumpfile inside the container image (created during bootc container ukify)> <final EROFS dumpfile>

Incorrect diff ```diff 53979c53983 < /usr/share/zoneinfo/right/Pacific 0 40755 2 0 0 0 1795676918.680258141 - - - security.selinux=system_u:object_r:locale_t:s0 --- > /usr/share/zoneinfo/right/Pacific 0 40755 2 0 0 0 0.0 - - - security.selinux=system_u:object_r:locale_t:s0 54031c54035 < /usr/share/zoneinfo/right/US 0 40755 2 0 0 0 1795676918.625154851 - - - security.selinux=system_u:object_r:locale_t:s0 --- > /usr/share/zoneinfo/right/US 0 40755 2 0 0 0 0.0 - - - security.selinux=system_u:object_r:locale_t:s0 54052,54053c54056,54057 < /usr/share/zsh 0 40755 3 0 0 0 1795676924.513793600 - - - security.selinux=system_u:object_r:usr_t:s0 < /usr/share/zsh/site-functions 0 40755 2 0 0 0 1795676924.513871356 - - - security.selinux=system_u:object_r:usr_t:s0 --- > /usr/share/zsh 0 40755 3 0 0 0 0.0 - - - security.selinux=system_u:object_r:usr_t:s0 > /usr/share/zsh/site-functions 0 40755 2 0 0 0 0.0 - - - security.selinux=system_u:object_r:usr_t:s0 ```

The diff I'd posted earlier was incorrect as I and run it in a VM that was not built FROM scratch. The following is the actual diff produced by bootc switch ...

5c5
< /etc 0 40755 95 0 0 0 1796120480.217946782 - - - security.selinux=system_u:object_r:etc_t:s0
---
> /etc 0 40755 95 0 0 0 1796113442.0 - - - security.selinux=system_u:object_r:etc_t:s0

Activity

  1. added
    bug
    triaged
    on Nov 30, 2026
  2. Johan-Liebert1 commented on Nov 30, 2026

    @Johan-Liebert1
    MemberAuthor

    We create files in /usr/share in our other tests as well, but they don't throw this error. I wonder what's the difference between that and this selinux stuff

  3. Johan-Liebert1 commented on Nov 30, 2026

    @Johan-Liebert1
    MemberAuthor

    Here is a reproducer

    FROM localhost/bootc as base
    
    RUN echo '(boolean cfs_incoming_change false)' > /tmp/cfs_incoming_change.cil
    RUN semodule -i /tmp/cfs_incoming_change.cil
    
    RUN rm -rf /tmp/cfs_incoming_change.cil
    
    FROM base as kernel
    RUN <<-EOF
    kver=$(bootc container inspect --rootfs / --json | jq -r '.kernel.version')
    bootc internals uki extract /boot/EFI/Linux/$kver.efi /boot
    EOF
    
    FROM base as base-final
    RUN rm -rf /boot/EFI/Linux/*.efi
    
    FROM base as sealed-uki
    RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
    --mount=type=bind,from=base-final,src=/,target=/run/target \
    --mount=type=bind,from=kernel,src=/,target=/run/kernel <<-EOF
    
    kver=$(bootc container inspect --rootfs /run/kernel --json | jq -r '.kernel.version')
     
    
    /var/seal-uki \
    --target /run/target \
    --output /out \
    --secrets /run/secrets  \
    --kernel-dir /run/kernel/boot/${kver} \
    --write-dumpfile-to /out/${kver}.dump \
    --seal-state unsealed
    
    EOF
    
    FROM base-final
    
    # Copy the sealed UKI and finalize the image remove raw kernel, create symlinks
    RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
    --mount=type=bind,from=sealed-uki,src=/,target=/run/sealed-uki \
    --mount=type=bind,from=kernel,src=/,target=/run/kernel \
    /var/finalize-uki /run/sealed-uki/out $(bootc container inspect --rootfs /run/kernel --json | jq -r '.kernel.version')
    
  4. Johan-Liebert1 commented on Dec 1, 2026

    @Johan-Liebert1
    MemberAuthor
  5. Johan-Liebert1 commented on Dec 1, 2026

    @Johan-Liebert1
    MemberAuthor

    Maybe we could have a --normalize-mtime option while computing composefs digest, similar to how we have xattr filters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions