]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mm/gup_benchmark.c: prevent integer overflow in ioctl
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 30 Oct 2018 22:04:32 +0000 (15:04 -0700)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:17 +0000 (14:21 -0300)
commit15e01792cd4668fd291194fc43039c0e4f840b7e
treeda8c024a81c2b0185a4e903603fd04b6423e7d6f
parent5b43d912415bedcee433a732fa100c55044b3ca8
mm/gup_benchmark.c: prevent integer overflow in ioctl

BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit 4b408c74ee5a0b74fc9265c2fe39b0e7dec7c056 ]

The concern here is that "gup->size" is a u64 and "nr_pages" is unsigned
long.  On 32 bit systems we could trick the kernel into allocating fewer
pages than expected.

Link: http://lkml.kernel.org/r/20181025061546.hnhkv33diogf2uis@kili.mountain
Fixes: 64c349f4ae78 ("mm: add infrastructure for get_user_pages_fast() benchmarking")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>
mm/gup_benchmark.c