All of lore.kernel.org
 help / color / mirror / Atom feed
From: "黄吕强 (Lvqiang Huang)" <lvqiang.huang@unisoc.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: "ebiederm@xmission.com" <ebiederm@xmission.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"anshuman.khandual@arm.com" <anshuman.khandual@arm.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"will@kernel.org" <will@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: check __ex_table in do_bad()
Date: Thu, 7 Nov 2019 17:22:45 +0000	[thread overview]
Message-ID: <CE4726AD-630F-44A0-862B-23BC8E6A7E4C@unisoc.com> (raw)
In-Reply-To: <20191107092404.GV25745@shell.armlinux.org.uk>


> 在 2019年11月7日,17:24,Russell King - ARM Linux admin <linux@armlinux.org.uk> 写道:
> 
>> On Thu, Nov 07, 2019 at 03:45:13PM +0800, Lvqiang wrote:
>> 
>> We got many crashs in for_each_frame+0x18 arch/arm/lib/backtrace.S
>>    1003: ldr r2, [sv_pc, #-4]
>> 
>> The backtrace is
>>    dump_backtrace
>>    show_stack
>>    sched_show_task
>>    show_state_filter
>>    sysrq_handle_showstate_blocked
>>    __handle_sysrq
>>    write_sysrq_trigger
>>    proc_reg_write
>>    __vfs_write
>>    vfs_write
>>    sys_write
>> 
>> Related Kernel config
>>    CONFIG_CPU_SW_DOMAIN_PAN=y
>>    # CONFIG_ARM_UNWIND is not set
>>    CONFIG_FRAME_POINTER=y
>> 
>> The task A was dumping the stack of an UN task B. However, the task B
> 
> What is "an UN task B"?

UN means TASK_UNINTERRUPTIBLE. 
(Sorry for the typo in the last reply)

>> scheduled to run on another CPU, which cause it stack content changed.
>> Then, task A may hit a page domain fault and die().
>>    [520.661314] Unhandled fault: page domain fault (0x01b) at 0x32848c02
> 
> So, the backtrace code is trying to access userspace.  It isn't supposed
> to be accessing userspace - there are no guarantees that userspace will
> be using frame pointers.  That is the bug.
> 

There is a race condition when try to get the backtrace of another task,whose frames may totally changed during the execution. 

> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
> According to speedtest.net: 11.9Mbps down 500kbps up


============================================================================
This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions. 
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。

WARNING: multiple messages have this Message-ID (diff)
From: "黄吕强 (Lvqiang Huang)" <lvqiang.huang@unisoc.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: "f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"anshuman.khandual@arm.com" <anshuman.khandual@arm.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ebiederm@xmission.com" <ebiederm@xmission.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"will@kernel.org" <will@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: check __ex_table in do_bad()
Date: Thu, 7 Nov 2019 17:22:45 +0000	[thread overview]
Message-ID: <CE4726AD-630F-44A0-862B-23BC8E6A7E4C@unisoc.com> (raw)
In-Reply-To: <20191107092404.GV25745@shell.armlinux.org.uk>


> 在 2019年11月7日,17:24,Russell King - ARM Linux admin <linux@armlinux.org.uk> 写道:
> 
>> On Thu, Nov 07, 2019 at 03:45:13PM +0800, Lvqiang wrote:
>> 
>> We got many crashs in for_each_frame+0x18 arch/arm/lib/backtrace.S
>>    1003: ldr r2, [sv_pc, #-4]
>> 
>> The backtrace is
>>    dump_backtrace
>>    show_stack
>>    sched_show_task
>>    show_state_filter
>>    sysrq_handle_showstate_blocked
>>    __handle_sysrq
>>    write_sysrq_trigger
>>    proc_reg_write
>>    __vfs_write
>>    vfs_write
>>    sys_write
>> 
>> Related Kernel config
>>    CONFIG_CPU_SW_DOMAIN_PAN=y
>>    # CONFIG_ARM_UNWIND is not set
>>    CONFIG_FRAME_POINTER=y
>> 
>> The task A was dumping the stack of an UN task B. However, the task B
> 
> What is "an UN task B"?

UN means TASK_UNINTERRUPTIBLE. 
(Sorry for the typo in the last reply)

>> scheduled to run on another CPU, which cause it stack content changed.
>> Then, task A may hit a page domain fault and die().
>>    [520.661314] Unhandled fault: page domain fault (0x01b) at 0x32848c02
> 
> So, the backtrace code is trying to access userspace.  It isn't supposed
> to be accessing userspace - there are no guarantees that userspace will
> be using frame pointers.  That is the bug.
> 

There is a race condition when try to get the backtrace of another task,whose frames may totally changed during the execution. 

> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
> According to speedtest.net: 11.9Mbps down 500kbps up


============================================================================
This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions. 
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-11-07 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  7:45 [PATCH] ARM: check __ex_table in do_bad() Lvqiang
2019-11-07  7:45 ` Lvqiang
2019-11-07  9:24 ` Russell King - ARM Linux admin
2019-11-07  9:24   ` Russell King - ARM Linux admin
2019-11-07 15:30   ` 黄吕强 (Lvqiang Huang)
2019-11-07 15:30     ` 黄吕强 (Lvqiang Huang)
2019-11-07 17:22   ` 黄吕强 (Lvqiang Huang) [this message]
2019-11-07 17:22     ` 黄吕强 (Lvqiang Huang)
2019-11-08  2:16     ` 黄吕强 (Lvqiang Huang)
2019-11-08  2:16       ` 黄吕强 (Lvqiang Huang)

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=CE4726AD-630F-44A0-862B-23BC8E6A7E4C@unisoc.com \
    --to=lvqiang.huang@unisoc.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=ebiederm@xmission.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=will@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.