Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1302292 > unrolled thread
| Started by | Kees Cook <keescook@chromium.org> |
|---|---|
| First post | 2016-01-06 01:30 +0100 |
| Last post | 2016-01-06 03:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [kernel-hardening] [RFC][PATCH 6/7] mm: Add Kconfig option for slab sanitization Kees Cook <keescook@chromium.org> - 2016-01-06 01:30 +0100
Re: [kernel-hardening] [RFC][PATCH 6/7] mm: Add Kconfig option for slab sanitization Laura Abbott <laura@labbott.name> - 2016-01-06 03:50 +0100
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2016-01-06 01:30 +0100 |
| Subject | Re: [kernel-hardening] [RFC][PATCH 6/7] mm: Add Kconfig option for slab sanitization |
| Message-ID | <qNK9c-1YP-11@gated-at.bofh.it> |
On Tue, Dec 22, 2015 at 11:13 AM, Laura Abbott <laura@labbott.name> wrote: > On 12/22/15 10:19 AM, Dave Hansen wrote: >> >> On 12/22/2015 10:08 AM, Christoph Lameter wrote: >>> >>> On Tue, 22 Dec 2015, Dave Hansen wrote: >>>>> >>>>> Why would you use zeros? The point is just to clear the information >>>>> right? >>>>> The regular poisoning does that. >>>> >>>> >>>> It then allows you to avoid the zeroing at allocation time. >>> >>> >>> Well much of the code is expecting a zeroed object from the allocator and >>> its zeroed at that time. Zeroing makes the object cache hot which is an >>> important performance aspect. >> >> >> Yes, modifying this behavior has a performance impact. It absolutely >> needs to be evaluated, and I wouldn't want to speculate too much on how >> good or bad any of the choices are. >> >> Just to reiterate, I think we have 3 real choices here: >> >> 1. Zero at alloc, only when __GFP_ZERO >> (behavior today) >> 2. Poison at free, also Zero at alloc (when __GFP_ZERO) >> (this patch's proposed behavior, also what current poisoning does, >> doubles writes) >> 3. Zero at free, *don't* Zero at alloc (when __GFP_ZERO) >> (what I'm suggesting, possibly less perf impact vs. #2) >> >> > > poisoning with non-zero memory makes it easier to determine that the error > came from accessing the sanitized memory vs. some other case. I don't think > the feature would be as strong if the memory was only zeroed vs. some other > data value. I would tend to agree. If there are significant perf improvements for "3" above, that should be easy to add on later as another choice. -Kees -- Kees Cook Chrome OS & Brillo Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Laura Abbott <laura@labbott.name> |
|---|---|
| Date | 2016-01-06 03:50 +0100 |
| Message-ID | <qNMkF-3kl-1@gated-at.bofh.it> |
| In reply to | #1302292 |
On 1/5/16 4:29 PM, Kees Cook wrote: > On Tue, Dec 22, 2015 at 11:13 AM, Laura Abbott <laura@labbott.name> wrote: >> On 12/22/15 10:19 AM, Dave Hansen wrote: >>> >>> On 12/22/2015 10:08 AM, Christoph Lameter wrote: >>>> >>>> On Tue, 22 Dec 2015, Dave Hansen wrote: >>>>>> >>>>>> Why would you use zeros? The point is just to clear the information >>>>>> right? >>>>>> The regular poisoning does that. >>>>> >>>>> >>>>> It then allows you to avoid the zeroing at allocation time. >>>> >>>> >>>> Well much of the code is expecting a zeroed object from the allocator and >>>> its zeroed at that time. Zeroing makes the object cache hot which is an >>>> important performance aspect. >>> >>> >>> Yes, modifying this behavior has a performance impact. It absolutely >>> needs to be evaluated, and I wouldn't want to speculate too much on how >>> good or bad any of the choices are. >>> >>> Just to reiterate, I think we have 3 real choices here: >>> >>> 1. Zero at alloc, only when __GFP_ZERO >>> (behavior today) >>> 2. Poison at free, also Zero at alloc (when __GFP_ZERO) >>> (this patch's proposed behavior, also what current poisoning does, >>> doubles writes) >>> 3. Zero at free, *don't* Zero at alloc (when __GFP_ZERO) >>> (what I'm suggesting, possibly less perf impact vs. #2) >>> >>> >> >> poisoning with non-zero memory makes it easier to determine that the error >> came from accessing the sanitized memory vs. some other case. I don't think >> the feature would be as strong if the memory was only zeroed vs. some other >> data value. > > I would tend to agree. If there are significant perf improvements for > "3" above, that should be easy to add on later as another choice. > I was looking at the sanitization for the buddy allocator that exists in grsecurity and that does option #3 (zero at free, skip __GFP_ZERO). I'm going to look into adding that as an option for the slab allocator and see what the performance numbers show. Thanks, Laura -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web