Re: [PATCH] selftests/clone3: Fix capability dropping by using standard libcap API
From: Shuah Khan
Date: Tue Mar 31 2026 - 16:10:17 EST
On 3/9/26 21:14, Yi Lai wrote:
The clone3_cap_checkpoint_restore.c selftest defined its own 'struct
libcap' to manually cast and manipulate the internal memory layout of
the opaque 'cap_t' type.
Starting with libcap v2.60 (commit aca076443591 "Make cap_t operations
thread safe"), a '__u8 mutex' was added to the beginning of the internal
'struct _cap_struct'. This structural shift breaks the selftest's custom
struct layout assumptions, causing capability corruption and leading to
failures during test execution.
Fix this by removing the custom struct definition and use the standard
cap_set_flag() API.
What king of failures are you seeing? Can you send the failures from
the run?
Fixes: 1d27a0be16d6 ("selftests: add clone3() CAP_CHECKPOINT_RESTORE test")
Signed-off-by: Yi Lai <yi1.lai@xxxxxxxxx>
---
thanks,
-- Shuah