[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160508085045.GA27394@yury-N73SV>
Date: Sun, 8 May 2016 12:17:02 +0300
From: Yury Norov <ynorov@...iumnetworks.com>
To: "Luruo, Kuthonuzo" <kuthonuzo.luruo@....com>
CC: "aryabinin@...tuozzo.com" <aryabinin@...tuozzo.com>,
"glider@...gle.com" <glider@...gle.com>,
"dvyukov@...gle.com" <dvyukov@...gle.com>,
"cl@...ux.com" <cl@...ux.com>,
"penberg@...nel.org" <penberg@...nel.org>,
"rientjes@...gle.com" <rientjes@...gle.com>,
"iamjoonsoo.kim@....com" <iamjoonsoo.kim@....com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"kasan-dev@...glegroups.com" <kasan-dev@...glegroups.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"klimov.linux@...il.com" <klimov.linux@...il.com>
Subject: Re: [PATCH v2 1/2] mm, kasan: improve double-free detection
On Sat, May 07, 2016 at 03:15:59PM +0000, Luruo, Kuthonuzo wrote:
> Thank you for the review!
>
> > > + switch (alloc_data.state) {
> > > + case KASAN_STATE_QUARANTINE:
> > > + case KASAN_STATE_FREE:
> > > + kasan_report((unsigned long)object, 0, false,
> > > + (unsigned long)__builtin_return_address(1));
> >
> > __builtin_return_address() is unsafe if argument is non-zero. Use
> > return_address() instead.
>
> hmm, I/cscope can't seem to find an x86 implementation for return_address().
> Will dig further; thanks.
>
It seems there's no generic interface to obtain return address. x86
has working __builtin_return_address() and it's ok with it, others
use their own return_adderss(), and ok as well.
I think unification is needed here.
Powered by blists - more mailing lists