]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
keys: Remove outdated __user annotations
authorJann Horn <jannh@google.com>
Mon, 23 Nov 2020 23:54:00 +0000 (00:54 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 21 Jan 2021 16:16:08 +0000 (16:16 +0000)
When the semantics of the ->read() handlers were changed such that "buffer"
is a kernel pointer, some __user annotations survived.
Since they're wrong now, get rid of them.

Fixes: d3ec10aa9581 ("KEYS: Don't write out to userspace while holding key semaphore")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Ben Boeckel <mathstuf@gmail.com>
security/keys/keyring.c

index 14abfe765b7e789765474c24070aaa738ca6dc70..977066208387a9fc085b37a2ca78125c08f404c2 100644 (file)
@@ -452,7 +452,7 @@ static void keyring_describe(const struct key *keyring, struct seq_file *m)
 struct keyring_read_iterator_context {
        size_t                  buflen;
        size_t                  count;
-       key_serial_t __user     *buffer;
+       key_serial_t            *buffer;
 };
 
 static int keyring_read_iterator(const void *object, void *data)
@@ -479,7 +479,7 @@ static int keyring_read_iterator(const void *object, void *data)
  * times.
  */
 static long keyring_read(const struct key *keyring,
-                        char __user *buffer, size_t buflen)
+                        char *buffer, size_t buflen)
 {
        struct keyring_read_iterator_context ctx;
        long ret;
@@ -491,7 +491,7 @@ static long keyring_read(const struct key *keyring,
 
        /* Copy as many key IDs as fit into the buffer */
        if (buffer && buflen) {
-               ctx.buffer = (key_serial_t __user *)buffer;
+               ctx.buffer = (key_serial_t *)buffer;
                ctx.buflen = buflen;
                ctx.count = 0;
                ret = assoc_array_iterate(&keyring->keys,