Skip to content

Commit

Permalink
keys: fix missing __user in KEYCTL_PKEY_QUERY
Browse files Browse the repository at this point in the history
The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on
it as it is a user pointer. This clears the following sparse warning
for this:

security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces)
security/keys/keyctl.c:1755:43:    expected struct keyctl_pkey_query [noderef] <asn:1>*<noident>
security/keys/keyctl.c:1755:43:    got struct keyctl_pkey_query *<noident>

Signed-off-by: Ben Dooks <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
bjdooks-ct authored and James Morris committed Mar 4, 2019
1 parent b102c11 commit 468e91c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
return -EINVAL;
return keyctl_pkey_query((key_serial_t)arg2,
(const char __user *)arg4,
(struct keyctl_pkey_query *)arg5);
(struct keyctl_pkey_query __user *)arg5);

case KEYCTL_PKEY_ENCRYPT:
case KEYCTL_PKEY_DECRYPT:
Expand Down

0 comments on commit 468e91c

Please sign in to comment.