From: David Howells <dhowells@redhat.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jann Horn <jannh@google.com>,
dhowells@redhat.com, keyrings@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/9] keys: Remove outdated __user annotations
Date: Fri, 27 Nov 2020 16:45:40 +0000 [thread overview]
Message-ID: <160649554087.2744658.17033829730920396113.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <160649552401.2744658.15096366594785577090.stgit@warthog.procyon.org.uk>
From: Jann Horn <jannh@google.com>
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>
---
security/keys/keyring.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 14abfe765b7e..977066208387 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -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,
next prev parent reply other threads:[~2020-11-27 16:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 16:45 [PATCH 0/9] keys: Miscellaneous fixes David Howells
2020-11-27 16:45 ` [PATCH 1/9] security: keys: Fix fall-through warnings for Clang David Howells
2020-11-27 16:45 ` David Howells [this message]
2020-11-27 16:45 ` [PATCH 3/9] watch_queue: Drop references to /dev/watch_queue David Howells
2020-11-27 16:45 ` [PATCH 4/9] security/keys: use kvfree_sensitive() David Howells
2020-11-27 16:46 ` [PATCH 5/9] KEYS: asymmetric: Fix kerneldoc David Howells
2020-11-27 16:46 ` [PATCH 6/9] security: keys: delete repeated words in comments David Howells
2020-11-27 16:46 ` [PATCH 7/9] KEYS: remove redundant memset David Howells
2020-11-27 16:46 ` [PATCH 8/9] crypto: asymmetric_keys: fix some comments in pkcs7_parser.h David Howells
2020-11-27 16:46 ` [PATCH 9/9] encrypted-keys: Replace HTTP links with HTTPS ones David Howells
2020-11-29 3:38 ` [PATCH 0/9] keys: Miscellaneous fixes Jarkko Sakkinen
2020-11-30 9:21 ` David Howells
2020-12-02 16:43 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160649554087.2744658.17033829730920396113.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=jannh@google.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).