Acked-by: Chengwen Feng <[email protected]>

On 7/23/2025 9:31 PM, David Marchand wrote:
> Caught by UBSan:
> 
> ../lib/eal/x86/include/rte_atomic_64.h:206:21: runtime error:
>       member access within misaligned address 0x7ffd9c67f228 for
>       type 'const rte_int128_t', which requires 16 byte alignment
>       0x7ffd9c67f228: note: pointer points here
>  00 00 00 00  c0 5d 3e 00 01 00 00 00  01 00 00 00 00 00 00 00
>               ^
>  00 00 00 00 00 00 00 00  00 00 00 00
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
>       ../lib/eal/x86/include/rte_atomic_64.h:206:21 in
>       ../lib/eal/x86/include/rte_atomic_64.h:206:21: runtime error:
>       member access within misaligned address 0x7ffd9c67f228 for type
>       'const union rte_int128_t::(anonymous at
>       ../lib/eal/include/generic/rte_atomic.h:1102:2)', which requires
>       16 byte alignment
> 0x7ffd9c67f228: note: pointer points here
>  00 00 00 00  c0 5d 3e 00 01 00 00 00  01 00 00 00 00 00 00 00
>               ^
>  00 00 00 00 00 00 00 00  00 00 00 00
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
>       ../lib/eal/x86/include/rte_atomic_64.h:206:21 in
>       ../lib/eal/x86/include/rte_atomic_64.h:206:16: runtime error:
>       load of misaligned address 0x7ffd9c67f228 for type
>       'const uint64_t' (aka 'const unsigned long'), which requires
>       16 byte alignment
> 0x7ffd9c67f228: note: pointer points here
>  00 00 00 00  c0 5d 3e 00 01 00 00 00  01 00 00 00 00 00 00 00
>               ^
>  00 00 00 00 00 00 00 00  00 00 00 00
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
>       ../lib/eal/x86/include/rte_atomic_64.h:206:21 in
> 
> Rather than explicitly set alignment in callers, mark the structure
> itself with an alignment constraint.
> 
> Fixes: 3340202f5954 ("stack: add lock-free implementation")
> 
> Signed-off-by: David Marchand <[email protected]>
> Acked-by: Bruce Richardson <[email protected]>
> Acked-by: Konstantin Ananyev <[email protected]>

Reply via email to