From: Kees Cook <keescook@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Qian Cai <cai@lca.pw>
Subject: [PATCH] usercopy: Improve comments after reorder
Date: Thu, 3 Jan 2019 08:51:51 -0800 [thread overview]
Message-ID: <20190103165151.GA32845@beast> (raw)
This updates the comments to better reflect the order and purpose of
the checks.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
mm/usercopy.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/usercopy.c b/mm/usercopy.c
index e9e9325f7638..726e570c9b9e 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -243,7 +243,8 @@ static inline void check_heap_object(const void *ptr, unsigned long n,
/*
* Validates that the given object is:
* - not bogus address
- * - known-safe heap or stack object
+ * - fully contained by stack (or stack frame, when available)
+ * - fully within SLAB object (or object whitelist area, when available)
* - not in kernel text
*/
void __check_object_size(const void *ptr, unsigned long n, bool to_user)
--
Kees Cook
reply other threads:[~2019-01-03 16:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190103165151.GA32845@beast \
--to=keescook@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=cai@lca.pw \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.