Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329359

Re: [PATCH] arm64: disable kasan when accessing frame->fp in unwind_frame

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From "Shi, Yang" <yang.shi@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] arm64: disable kasan when accessing frame->fp in unwind_frame
Date Mon, 08 Feb 2016 18:20:02 +0100
Message-ID <qZXDI-8ih-27@gated-at.bofh.it> (permalink)
References <qYXZ8-6YG-27@gated-at.bofh.it> <qZPPQ-2QD-15@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=YJLu5X3tSmenr4vB8zkDUg0tbbXbayc25CTQwuKAl/w=; b=CICA3KGishd92BB3FZk7shL7TLkOea57Lpg4Kru2M5pM81dONqfg6vEawZJNmWULbl m87t5bBsdqWRrSU66q3r8IgIxcLmZyxgd0mCz09A0++3BkYuIV76lOmzigUqcFeLrWz5 eq/acLvVzRtuaWy1A63891rLAqOSju7+2n2GI=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=YJLu5X3tSmenr4vB8zkDUg0tbbXbayc25CTQwuKAl/w=; b=YMT+XV6V8s3CFy4+oXEs52n99pwgmHgyf8/Xwk38zQ6awFWUi+Axasz7ji5Xat8s45 iCXyVyRGDmYH3PMKC/AC4spNS/3gIkumkM/WFnfI4Vu8gyuIm8VZQSWPHMiyNWrpX2WF QV3Ey/DhgcAvOqStT1/sDjjQ3jJpv2xL/F8KHlyqdZlQ4de6swgwL0pqIwHd6cLP1Vdk GVxO5ce/VApfMptiMCZAoz5h8bLSid0WjwljiHDOGj6YhxeB8p+xy0LxRXz523p/CawE VtD515g7khof4cu5NqF+/uoyF3n9K5CWJrcE/SskO9BvbLiDSt+rqBrocMC9YkCO4ThS +MZQ==
X-Gm-Message-State AG10YORjCPHScGSKuEZQ+v4y9ssnIozJRZQbI9VXJSMimNkB7Q+AEjlUcX8Xebgcu3+f+ULk
X-Received by 10.182.137.198 with SMTP id qk6mr25818030obb.5.1454951545148; Mon, 08 Feb 2016 09:12:25 -0800 (PST)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 38
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org
X-Original-Date Mon, 8 Feb 2016 09:12:21 -0800
X-Original-Message-ID <56B8CC75.1000508@linaro.org>
X-Original-References <1454713487-5239-1-git-send-email-yang.shi@linaro.org> <56B856F5.5080606@virtuozzo.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1329359

Show key headers only | View raw


On 2/8/2016 12:51 AM, Andrey Ryabinin wrote:
>
>
> On 02/06/2016 02:04 AM, Yang Shi wrote:
>>
>>   #include <asm/irq.h>
>>   #include <asm/stacktrace.h>
>> @@ -64,7 +65,9 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
>>   		return -EINVAL;
>>
>>   	frame->sp = fp + 0x10;
>> +	kasan_disable_current();
>>   	frame->fp = *(unsigned long *)(fp);
>
> It would be better to use READ_ONCE_NOCHECK() here.
> See f7d27c35ddff7 ("x86/mm, kasan: Silence KASAN warnings in get_wchan()") which solves the same problem for x86.

Thanks for the suggestion, I'm going to try it soon.

>
>> +	kasan_enable_current();
>>   	frame->pc = *(unsigned long *)(fp + 8);
>
> Why you left frame->pc out of scope? This line could trigger kasan as well.

Actually, it was not reported as frequently as the first one. In my 
first a couple of boot test, it was not triggered before I came up with 
the patch. The first one is triggered every time.

It will be fixed in v2 too.

Thanks,
Yang

>
>>
>>   #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] arm64: disable kasan when accessing frame->fp in unwind_frame Yang Shi <yang.shi@linaro.org> - 2016-02-06 00:30 +0100
  Re: [PATCH] arm64: disable kasan when accessing frame->fp in  unwind_frame Andrey Ryabinin <aryabinin@virtuozzo.com> - 2016-02-08 10:00 +0100
    Re: [PATCH] arm64: disable kasan when accessing frame->fp in  unwind_frame "Shi, Yang" <yang.shi@linaro.org> - 2016-02-08 18:20 +0100

csiph-web