From: Mark Rutland <mark.rutland@arm.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Will Deacon <will.deacon@arm.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
kasan-dev <kasan-dev@googlegroups.com>,
LKML <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 7/8] asm-generic: add KASAN instrumentation to atomic operations
Date: Wed, 29 Mar 2017 16:56:32 +0100 [thread overview]
Message-ID: <20170329155631.GA26135@leverpostej> (raw)
In-Reply-To: <CACT4Y+ay7J4kdLG1i2Czop6H3pDKxpcRVxM0xoNiZ2pJ0emHQw@mail.gmail.com>
On Wed, Mar 29, 2017 at 05:52:43PM +0200, Dmitry Vyukov wrote:
> On Wed, Mar 29, 2017 at 4:00 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> > On Tue, Mar 28, 2017 at 06:15:44PM +0200, Dmitry Vyukov wrote:
> >> KASAN uses compiler instrumentation to intercept all memory accesses.
> >> But it does not see memory accesses done in assembly code.
> >> One notable user of assembly code is atomic operations. Frequently,
> >> for example, an atomic reference decrement is the last access to an
> >> object and a good candidate for a racy use-after-free.
> >>
> >> Add manual KASAN checks to atomic operations.
> >>
> >> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> >> Cc: Mark Rutland <mark.rutland@arm.com>
> >> Cc: Peter Zijlstra <peterz@infradead.org>
> >> Cc: Will Deacon <will.deacon@arm.com>,
> >> Cc: Andrew Morton <akpm@linux-foundation.org>,
> >> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>,
> >> Cc: Ingo Molnar <mingo@redhat.com>,
> >> Cc: kasan-dev@googlegroups.com
> >> Cc: linux-mm@kvack.org
> >> Cc: linux-kernel@vger.kernel.org
> >> Cc: x86@kernel.org
> >
> > FWIW, I think that structuring the file this way will make it easier to
> > add the {acquire,release,relaxed} variants (as arm64 will need),
> > so this looks good to me.
> >
> > As a heads-up, I wanted to have a go at that, but I wasn't able to apply
> > patch two onwards on v4.11-rc{3,4} or next-20170329. I was not able to
> > cleanly revert the instrumentation patches currently in next-20170329,
> > since other patches built atop of them.
>
> I based it on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
> locking/core
Ah; I should have guessed. ;)
Thanks for the pointer! I'll give that a go shortly.
Thanks,
Mark.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Will Deacon <will.deacon@arm.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
kasan-dev <kasan-dev@googlegroups.com>,
LKML <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 7/8] asm-generic: add KASAN instrumentation to atomic operations
Date: Wed, 29 Mar 2017 16:56:32 +0100 [thread overview]
Message-ID: <20170329155631.GA26135@leverpostej> (raw)
In-Reply-To: <CACT4Y+ay7J4kdLG1i2Czop6H3pDKxpcRVxM0xoNiZ2pJ0emHQw@mail.gmail.com>
On Wed, Mar 29, 2017 at 05:52:43PM +0200, Dmitry Vyukov wrote:
> On Wed, Mar 29, 2017 at 4:00 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> > On Tue, Mar 28, 2017 at 06:15:44PM +0200, Dmitry Vyukov wrote:
> >> KASAN uses compiler instrumentation to intercept all memory accesses.
> >> But it does not see memory accesses done in assembly code.
> >> One notable user of assembly code is atomic operations. Frequently,
> >> for example, an atomic reference decrement is the last access to an
> >> object and a good candidate for a racy use-after-free.
> >>
> >> Add manual KASAN checks to atomic operations.
> >>
> >> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> >> Cc: Mark Rutland <mark.rutland@arm.com>
> >> Cc: Peter Zijlstra <peterz@infradead.org>
> >> Cc: Will Deacon <will.deacon@arm.com>,
> >> Cc: Andrew Morton <akpm@linux-foundation.org>,
> >> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>,
> >> Cc: Ingo Molnar <mingo@redhat.com>,
> >> Cc: kasan-dev@googlegroups.com
> >> Cc: linux-mm@kvack.org
> >> Cc: linux-kernel@vger.kernel.org
> >> Cc: x86@kernel.org
> >
> > FWIW, I think that structuring the file this way will make it easier to
> > add the {acquire,release,relaxed} variants (as arm64 will need),
> > so this looks good to me.
> >
> > As a heads-up, I wanted to have a go at that, but I wasn't able to apply
> > patch two onwards on v4.11-rc{3,4} or next-20170329. I was not able to
> > cleanly revert the instrumentation patches currently in next-20170329,
> > since other patches built atop of them.
>
> I based it on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
> locking/core
Ah; I should have guessed. ;)
Thanks for the pointer! I'll give that a go shortly.
Thanks,
Mark.
next prev parent reply other threads:[~2017-03-29 15:57 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-28 16:15 [PATCH 0/8] x86, kasan: add KASAN checks to atomic operations Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 1/8] x86: remove unused atomic_inc_short() Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 2/8] x86: un-macro-ify atomic ops implementation Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 3/8] x86: use long long for 64-bit atomic ops Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-28 21:32 ` Matthew Wilcox
2017-03-28 21:32 ` Matthew Wilcox
2017-05-26 19:29 ` Dmitry Vyukov
2017-05-26 19:29 ` Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 4/8] asm-generic: add atomic-instrumented.h Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-28 21:35 ` Matthew Wilcox
2017-03-28 21:35 ` Matthew Wilcox
2017-03-29 8:21 ` Dmitry Vyukov
2017-03-29 8:21 ` Dmitry Vyukov
2017-03-29 13:27 ` Mark Rutland
2017-03-29 13:27 ` Mark Rutland
2017-03-29 17:15 ` Mark Rutland
2017-03-29 17:15 ` Mark Rutland
2017-03-30 6:43 ` Ingo Molnar
2017-03-30 6:43 ` Ingo Molnar
2017-03-30 10:40 ` Mark Rutland
2017-03-30 10:40 ` Mark Rutland
2017-03-28 16:15 ` [PATCH 5/8] x86: switch atomic.h to use atomic-instrumented.h Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-28 16:25 ` Dmitry Vyukov
2017-03-28 16:25 ` Dmitry Vyukov
2017-03-29 13:37 ` Mark Rutland
2017-03-29 13:37 ` Mark Rutland
2017-05-26 19:28 ` Dmitry Vyukov
2017-05-26 19:28 ` Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 6/8] kasan: allow kasan_check_read/write() to accept pointers to volatiles Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-28 16:15 ` [PATCH 7/8] asm-generic: add KASAN instrumentation to atomic operations Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-29 14:00 ` Mark Rutland
2017-03-29 14:00 ` Mark Rutland
2017-03-29 15:52 ` Dmitry Vyukov
2017-03-29 15:52 ` Dmitry Vyukov
2017-03-29 15:56 ` Mark Rutland [this message]
2017-03-29 15:56 ` Mark Rutland
2017-03-28 16:15 ` [PATCH 8/8] asm-generic, x86: add comments for atomic instrumentation Dmitry Vyukov
2017-03-28 16:15 ` Dmitry Vyukov
2017-03-28 16:26 ` [PATCH 0/8] x86, kasan: add KASAN checks to atomic operations Dmitry Vyukov
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=20170329155631.GA26135@leverpostej \
--to=mark.rutland@arm.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=dvyukov@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
--cc=x86@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.