[LTP] [PATCH] keyctl: Fix struct keyctl_dh_params build on Bionic
Petr Vorel
pvorel@suse.cz
Tue Oct 13 18:04:15 CEST 2026
Hi all,
> Hi Wake Liu, Cyril,
> > Bionic generates its copy of the UAPI headers with the C++ keyword
> Ah, we forget on the most used C++ libc when we prepared 71353a6c009b.
> > 'private' renamed to '__linux_private', so its struct keyctl_dh_params
> > only provides the 'priv' alias added in kernel 4.20. Since keyctl25-28
> > were switched to 'private', they fail to build on Android:
> > error: no member named 'private' in 'struct keyctl_dh_params'
> > Detect the 'private' member in configure and access the member via a
> > new KEYCTL_DH_PRIVATE() macro, which falls back to 'priv' when
> > 'private' is not available, similar to FSID_VAL_MEMBER() in
> > lapi/fanotify.h.
> > Checking for 'private' rather than 'priv' leaves every build whose UAPI
> > headers provide 'private' unchanged, including headers older than 4.20
> > which lack 'priv'. It also makes 'priv' the default when configure is
> > not run, as in the Android build, which uses a hand-maintained
> > config.h. The LTP fallback definition provides both members.
> > Fixes: 71353a6c009b ("keyctl: Use struct keyctl_dh_params 'private' instead of 'priv'")
> > Signed-off-by: Wake Liu <wakel@google.com>
> Looks like we cannot avoid struct keyctl_dh_params.private. Make sense.
> Cc Cyril just in case he has some different idea.
Thank you. Indeed this autotools fix is the safest way. I verified the it did
not break the original fix in 71353a6c009b (SLE12-SP5) and merged as
6262a5fc31 ("keyctl: Fix struct keyctl_dh_params build on Bionic")
I'm also going to send a follow up to simplify struct keyctl_dh_params again.
(Probably union is not needed any more.)
Kind regards,
Petr
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Kind regards,
> Petr
More information about the ltp
mailing list