]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/fscr: Enable interrupts earlier before calling get_user()
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Thu, 29 Mar 2018 06:23:37 +0000 (11:53 +0530)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit7376e153a4d5fd5a5ff3c2c56314a4209bfe95e5
treefdb995e4f3913cfd58e4717264dcb28cacdb3368
parent237dbb2ffc6c103c05731dc3f26a5e8b797e059c
powerpc/fscr: Enable interrupts earlier before calling get_user()

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 709b973c844c0b4d115ac3a227a2e5a68722c912 ]

The function get_user() can sleep while trying to fetch instruction
from user address space and causes the following warning from the
scheduler.

BUG: sleeping function called from invalid context

Though interrupts get enabled back but it happens bit later after
get_user() is called. This change moves enabling these interrupts
earlier covering the function get_user(). While at this, lets check
for kernel mode and crash as this interrupt should not have been
triggered from the kernel context.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/powerpc/kernel/traps.c