Skip to content

Commit

Permalink
keys: fix sparse warning by adding __user annotation to cast
Browse files Browse the repository at this point in the history
Fix the following sparse warning:

      CC      security/keys/key.o
    security/keys/keyctl.c:1297:10: warning: incorrect type in argument 2 (different address spaces)
    security/keys/keyctl.c:1297:10:    expected char [noderef] <asn:1>*buffer
    security/keys/keyctl.c:1297:10:    got char *<noident>

which appears to be caused by lack of __user annotation to the cast of
a syscall argument.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: David Howells <dhowells@redhat.com>
  • Loading branch information
James Morris committed Dec 31, 2008
1 parent 6a94cb7 commit 90bd49a
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 @@ -1294,7 +1294,7 @@ asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3,

case KEYCTL_GET_SECURITY:
return keyctl_get_security((key_serial_t) arg2,
(char *) arg3,
(char __user *) arg3,
(size_t) arg4);

default:
Expand Down

0 comments on commit 90bd49a

Please sign in to comment.