]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mm, gup: add missing refcount overflow checks on s390
authorVlastimil Babka <vbabka@suse.cz>
Fri, 29 Nov 2019 09:03:50 +0000 (10:03 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:42 +0000 (14:21 -0300)
commitd8a9516afb001747fe181cac0231461fb059e4f9
tree7fbd25092fcfec7f2f6ff5669f6f300f9c06e55e
parente7e96f06b8c3c51dcf7528d45b85633a4e96d21b
mm, gup: add missing refcount overflow checks on s390

BugLink: https://bugs.launchpad.net/bugs/1855787
The mainline commit 8fde12ca79af ("mm: prevent get_user_pages() from
overflowing page refcount") was backported to 4.14.y stable as commit
04198de24771. The backport however missed that in 4.14, there are several
arch-specific gup.c versions with fast gup implementations, so these do not
prevent refcount overflow.

This stable-only commit fixes the s390 version, and is based on the backport in
SUSE SLES/openSUSE 4.12-based kernels.

The remaining architectures with own gup.c are sparc, mips, sh. It's unlikely
the known overflow scenario based on FUSE, which needs 140GB of RAM, is a
problem for those architectures, and I don't feel confident enough to patch
them.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/s390/mm/gup.c