From: Jing Xiangfeng <jingxiangfeng@huawei.com> To: Russell King - ARM Linux admin <linux@armlinux.org.uk> Cc: <ebiederm@xmission.com>, <kstewart@linuxfoundation.org>, <gregkh@linuxfoundation.org>, <gustavo@embeddedor.com>, <bhelgaas@google.com>, <tglx@linutronix.de>, <sakari.ailus@linux.intel.com>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org> Subject: Re: [PATCH] arm: fix page faults in do_alignment Date: Sat, 31 Aug 2019 17:16:28 +0800 [thread overview] Message-ID: <5D6A3AEC.7030709@huawei.com> (raw) In-Reply-To: <20190831075524.GI13294@shell.armlinux.org.uk> On 2019/8/31 15:55, Russell King - ARM Linux admin wrote: > On Sat, Aug 31, 2019 at 09:49:45AM +0800, Jing Xiangfeng wrote: >> On 2019/8/30 21:35, Russell King - ARM Linux admin wrote: >>> On Fri, Aug 30, 2019 at 09:31:17PM +0800, Jing Xiangfeng wrote: >>>> The function do_alignment can handle misaligned address for user and >>>> kernel space. If it is a userspace access, do_alignment may fail on >>>> a low-memory situation, because page faults are disabled in >>>> probe_kernel_address. >>>> >>>> Fix this by using __copy_from_user stead of probe_kernel_address. >>>> >>>> Fixes: b255188 ("ARM: fix scheduling while atomic warning in alignment handling code") >>>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> >>> >>> NAK. >>> >>> The "scheduling while atomic warning in alignment handling code" is >>> caused by fixing up the page fault while trying to handle the >>> mis-alignment fault generated from an instruction in atomic context. >> >> __might_sleep is called in the function __get_user which lead to that bug. >> And that bug is triggered in a kernel space. Page fault can not be generated. >> Right? > > Your email is now fixed? Yeah, I just checked the mailbox, it is normal now. > > All of get_user(), __get_user(), copy_from_user() and __copy_from_user() > _can_ cause a page fault, which might need to fetch the page from disk. > All these four functions are equivalent as far as that goes - and indeed > as are their versions that write as well. > > If the page needs to come from disk, all of these functions _will_ > sleep. If they are called from an atomic context, and the page fault > handler needs to fetch data from disk, they will attempt to sleep, > which will issue a warning. > I understand. Thanks
WARNING: multiple messages have this Message-ID (diff)
From: Jing Xiangfeng <jingxiangfeng@huawei.com> To: Russell King - ARM Linux admin <linux@armlinux.org.uk> Cc: kstewart@linuxfoundation.org, gustavo@embeddedor.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ebiederm@xmission.com, sakari.ailus@linux.intel.com, bhelgaas@google.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm: fix page faults in do_alignment Date: Sat, 31 Aug 2019 17:16:28 +0800 [thread overview] Message-ID: <5D6A3AEC.7030709@huawei.com> (raw) In-Reply-To: <20190831075524.GI13294@shell.armlinux.org.uk> On 2019/8/31 15:55, Russell King - ARM Linux admin wrote: > On Sat, Aug 31, 2019 at 09:49:45AM +0800, Jing Xiangfeng wrote: >> On 2019/8/30 21:35, Russell King - ARM Linux admin wrote: >>> On Fri, Aug 30, 2019 at 09:31:17PM +0800, Jing Xiangfeng wrote: >>>> The function do_alignment can handle misaligned address for user and >>>> kernel space. If it is a userspace access, do_alignment may fail on >>>> a low-memory situation, because page faults are disabled in >>>> probe_kernel_address. >>>> >>>> Fix this by using __copy_from_user stead of probe_kernel_address. >>>> >>>> Fixes: b255188 ("ARM: fix scheduling while atomic warning in alignment handling code") >>>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> >>> >>> NAK. >>> >>> The "scheduling while atomic warning in alignment handling code" is >>> caused by fixing up the page fault while trying to handle the >>> mis-alignment fault generated from an instruction in atomic context. >> >> __might_sleep is called in the function __get_user which lead to that bug. >> And that bug is triggered in a kernel space. Page fault can not be generated. >> Right? > > Your email is now fixed? Yeah, I just checked the mailbox, it is normal now. > > All of get_user(), __get_user(), copy_from_user() and __copy_from_user() > _can_ cause a page fault, which might need to fetch the page from disk. > All these four functions are equivalent as far as that goes - and indeed > as are their versions that write as well. > > If the page needs to come from disk, all of these functions _will_ > sleep. If they are called from an atomic context, and the page fault > handler needs to fetch data from disk, they will attempt to sleep, > which will issue a warning. > I understand. Thanks _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-31 9:16 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-30 13:31 [PATCH] arm: fix page faults in do_alignment Jing Xiangfeng 2019-08-30 13:31 ` Jing Xiangfeng 2019-08-30 13:35 ` Russell King - ARM Linux admin 2019-08-30 13:35 ` Russell King - ARM Linux admin 2019-08-30 13:48 ` Russell King - ARM Linux admin 2019-08-30 13:48 ` Russell King - ARM Linux admin 2019-08-30 19:45 ` Eric W. Biederman 2019-08-30 19:45 ` Eric W. Biederman 2019-08-30 19:45 ` Eric W. Biederman 2019-08-30 20:30 ` Russell King - ARM Linux admin 2019-08-30 20:30 ` Russell King - ARM Linux admin 2019-08-30 21:02 ` Eric W. Biederman 2019-08-30 21:02 ` Eric W. Biederman 2019-08-30 21:02 ` Eric W. Biederman 2019-08-30 22:29 ` Russell King - ARM Linux admin 2019-08-30 22:29 ` Russell King - ARM Linux admin 2019-09-02 17:36 ` Eric W. Biederman 2019-09-02 17:36 ` Eric W. Biederman 2019-09-02 17:36 ` Eric W. Biederman 2019-09-04 2:17 ` Jing Xiangfeng 2019-09-04 2:17 ` Jing Xiangfeng 2019-09-06 15:17 ` Russell King - ARM Linux admin 2019-09-06 15:17 ` Russell King - ARM Linux admin 2019-09-15 18:34 ` Russell King - ARM Linux admin 2019-09-15 18:34 ` Russell King - ARM Linux admin 2019-09-16 14:31 ` Eric W. Biederman 2019-09-16 14:31 ` Eric W. Biederman 2019-09-16 14:31 ` Eric W. Biederman 2019-08-31 1:49 ` Jing Xiangfeng 2019-08-31 1:49 ` Jing Xiangfeng 2019-08-31 7:55 ` Russell King - ARM Linux admin 2019-08-31 7:55 ` Russell King - ARM Linux admin 2019-08-31 9:16 ` Jing Xiangfeng [this message] 2019-08-31 9:16 ` Jing Xiangfeng 2019-08-31 12:48 ` kbuild test robot
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=5D6A3AEC.7030709@huawei.com \ --to=jingxiangfeng@huawei.com \ --cc=bhelgaas@google.com \ --cc=ebiederm@xmission.com \ --cc=gregkh@linuxfoundation.org \ --cc=gustavo@embeddedor.com \ --cc=kstewart@linuxfoundation.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=linux@armlinux.org.uk \ --cc=sakari.ailus@linux.intel.com \ --cc=tglx@linutronix.de \ /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: linkBe 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.