Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1453165
| From | Andrey Ryabinin <ryabinin.a.a@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [4.7+] various memory corruption reports. |
| Date | 2016-08-01 14:10 +0200 |
| Message-ID | <s1kcG-68q-9@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <s0hTz-6qP-11@gated-at.bofh.it> <s0icW-6y2-19@gated-at.bofh.it> <s0jVo-7KZ-17@gated-at.bofh.it> <s0keJ-7S4-5@gated-at.bofh.it> <s0kRs-8pd-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/29/2016 09:39 PM, Dave Jones wrote:
> On Fri, Jul 29, 2016 at 08:56:08PM +0300, Andrey Ryabinin wrote:
>
> > >> > I suspect this is false positives due to changes in KASAN.
> > >> > Bisection probably will point to
> > >> > 80a9201a5965f4715d5c09790862e0df84ce0614 ("mm, kasan: switch SLUB to
> > >> > stackdepot, enable memory quarantine for SLUB)"
> > >>
> > >> good call. reverting that changeset seems to have solved it.
> > > Could you please try with this?
> > Actually, this is not quite right, it should be like this:
>
>
> Seems to have stopped the corruption, but now I get NMi watchdog traces..
>
>
This should help:
---
mm/kasan/kasan.c | 4 ++--
mm/kasan/quarantine.c | 8 ++++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c
index 3019cec..c99ef40 100644
--- a/mm/kasan/kasan.c
+++ b/mm/kasan/kasan.c
@@ -565,7 +565,7 @@ void kasan_kmalloc(struct kmem_cache *cache, const void *object, size_t size,
unsigned long redzone_start;
unsigned long redzone_end;
- if (flags & __GFP_RECLAIM)
+ if (gfpflags_allow_blocking(flags))
quarantine_reduce();
if (unlikely(object == NULL))
@@ -596,7 +596,7 @@ void kasan_kmalloc_large(const void *ptr, size_t size, gfp_t flags)
unsigned long redzone_start;
unsigned long redzone_end;
- if (flags & __GFP_RECLAIM)
+ if (gfpflags_allow_blocking(flags))
quarantine_reduce();
if (unlikely(ptr == NULL))
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
index 65793f1..4852625 100644
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@ -147,10 +147,14 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object);
unsigned long flags;
- local_irq_save(flags);
+ if (IS_ENABLED(CONFIG_SLAB))
+ local_irq_save(flags);
+
alloc_info->state = KASAN_STATE_FREE;
___cache_free(cache, object, _THIS_IP_);
- local_irq_restore(flags);
+
+ if (IS_ENABLED(CONFIG_SLAB))
+ local_irq_restore(flags);
}
static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)
--
2.7.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [4.7+] various memory corruption reports. Dave Jones <davej@codemonkey.org.uk> - 2016-07-29 17:20 +0200
Re: [4.7+] various memory corruption reports. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-07-29 17:30 +0200
Re: [4.7+] various memory corruption reports. Dave Jones <davej@codemonkey.org.uk> - 2016-07-29 17:50 +0200
Re: [4.7+] various memory corruption reports. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-07-29 19:40 +0200
Re: [4.7+] various memory corruption reports. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-07-29 20:00 +0200
Re: [4.7+] various memory corruption reports. Dave Jones <davej@codemonkey.org.uk> - 2016-07-29 20:40 +0200
Re: [4.7+] various memory corruption reports. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-08-01 14:10 +0200
Re: [4.7+] various memory corruption reports. Dave Jones <davej@codemonkey.org.uk> - 2016-08-01 19:30 +0200
csiph-web