Commit 90bd49ab6649269cd10d0edc86d0e0f62864726a

Authored by James Morris
1 parent 6a94cb7306

keys: fix sparse warning by adding __user annotation to cast

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

security/keys/keyctl.c
... ... @@ -1294,7 +1294,7 @@
1294 1294  
1295 1295 case KEYCTL_GET_SECURITY:
1296 1296 return keyctl_get_security((key_serial_t) arg2,
1297   - (char *) arg3,
  1297 + (char __user *) arg3,
1298 1298 (size_t) arg4);
1299 1299  
1300 1300 default: