With the introduction of capabilities and PCuABI being enabled when dealing with the user pointers does expect a capability.
Address the compilation issues below triggered by otherwise implicit conversion that might lead to unexpected behaviour when operating on capabilities.
make[1]: linux/security/keys/keyring.c:93 error: incompatible function pointer types initializing 'long (*)(const struct key *, char *, size_t)' (aka 'long (*)(const struct key *, char *, unsigned long)') with an expression of type 'long (const struct key *, char * __capability, size_t)' (aka 'long (const struct key *, char * __capability, unsigned long)') [-Werror,-Wincompatible-function-pointer-types] .read = keyring_read,
Note: User defined interface is in separate compilation unit.
Signed-off-by: Vincenzo Frascino vincenzo.frascino@arm.com --- security/keys/keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 5e6a90760753..4448758f643a 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring); static void keyring_destroy(struct key *keyring); static void keyring_describe(const struct key *keyring, struct seq_file *m); static long keyring_read(const struct key *keyring, - char __user *buffer, size_t buflen); + char *buffer, size_t buflen);
struct key_type key_type_keyring = { .name = "keyring",