Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1304569
| From | Christoph Lameter <cl@linux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX |
| Date | 2016-01-08 15:10 +0100 |
| Message-ID | <qOFTR-7OQ-15@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <qIBpV-8vR-27@gated-at.bofh.it> <qNJPQ-1OH-7@gated-at.bofh.it> <qNMNI-3T4-9@gated-at.bofh.it> <qOlBN-29Y-27@gated-at.bofh.it> <qOu2n-7SE-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 7 Jan 2016, Laura Abbott wrote:
> The slub_debug=P not only poisons it enables other consistency checks on the
> slab as well, assuming my understanding of what check_object does is correct.
> My hope was to have the poison part only and none of the consistency checks in
> an attempt to mitigate performance issues. I misunderstood when the checks
> actually run and how SLUB_DEBUG was used.
Ok I see that there pointer check is done without checking the
corresponding debug flag. Patch attached thar fixes it.
> Another option would be to have a flag like SLAB_NO_SANITY_CHECK.
> sanitization enablement would just be that and SLAB_POISON
> in the debug options. The disadvantage to this approach would be losing
> the sanitization for ->ctor caches (the grsecurity version works around this
> by re-initializing with ->ctor, I haven't heard any feedback if this actually
> acceptable) and not having some of the fast paths enabled
> (assuming I'm understanding the code path correctly.) which would also
> be a performance penalty
I think we simply need to fix the missing check there. There is already a
flag SLAB_DEBUG_FREE for the pointer checks.
Subject: slub: Only perform pointer checks in check_object when SLAB_DEBUG_FREE is set
Seems that check_object() always checks for pointer issues currently.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c
+++ linux/mm/slub.c
@@ -848,6 +848,9 @@ static int check_object(struct kmem_cach
*/
return 1;
+ if (!(s->flags & SLAB_DEBUG_FREE))
+ return 1;
+
/* Check free pointer validity */
if (!check_valid_pointer(s, page, get_freepointer(s, p))) {
object_err(s, page, p, "Freepointer corrupt");
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Kees Cook <keescook@chromium.org> - 2016-01-06 01:10 +0100
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Laura Abbott <laura@labbott.name> - 2016-01-06 04:20 +0100
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Christoph Lameter <cl@linux.com> - 2016-01-07 17:30 +0100
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Laura Abbott <laura@labbott.name> - 2016-01-08 02:30 +0100
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Christoph Lameter <cl@linux.com> - 2016-01-08 15:10 +0100
Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX Laura Abbott <laura@labbott.name> - 2016-01-14 05:00 +0100
csiph-web