Skip to content

[Bug]: ELF incorrect note alignment value for ABI-tag. #366

@gdahlm

Description

@gdahlm

Note: This does not relate to NVIDIA Container Toolkit as their ELF binaries have the correct offset.

Describe the bug
.note.ABI-tag in distributed ELF64 binaries on Ubuntu e.g. /usr/lib/x86_64-linux-gnu/libnvidia-container.so.1 have an alignment of 32 when it should be 4 (or 8). This results in an unreadable note and an error on tools like readelf and verification of installed objects/binaries with various tools.

To Reproduce

Try to read the note with readelf (will work with any ELF file):

$ readelf -j .note.ABI-tag /usr/lib/x86_64-linux-gnu/libnvidia-container.so.1

Displaying notes found in: .note.ABI-tag
readelf: Warning: Corrupt note: alignment 32, expecting 4 or 8

View the problem by looking at headers:

$ readelf -S /usr/lib/x86_64-linux-gnu/libnvidia-container.so.1
There are 29 section headers, starting at offset 0x305d0:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  <snip>
  [26] .note.ABI-tag     NOTE             0000000000630480  00030480
       0000000000000020  0000000000000000   A       0     0     32
  <snip>

Expected behavior

It should return the ABI-tag note without error like nvidia-ctk:

$ readelf  -j .note.ABI-tag /usr/bin/nvidia-ctk

Displaying notes found in: .note.ABI-tag
  Owner                Data size 	Description
  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 3.2.0

Correct Headers:

$ readelf -S /usr/lib/x86_64-linux-gnu/libnvidia-container.so.1
There are 29 section headers, starting at offset 0x305d0:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
<snip>
  [26] .note.ABI-tag     NOTE             0000000000630480  00030480
       0000000000000020  0000000000000000   A       0     0     4
<snip>

Environment (please provide the following information):

  • Version: 1.19.0-1
  • OS / Distribution: Ubuntu 26.04
  • Kernel Version: amd 7.0.0-15-generic
  • Container Runtime Version: all

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue/PR to expose/discuss/fix a bugneeds-triageissue or PR has not been assigned a priority-px label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions