android_kernel_samsung_a7y1.../include
Linus Torvalds 28f068a17b mm: prevent get_user_pages() from overflowing page refcount
commit 8fde12ca79aff9b5ba951fce1a2641901b8d8e64 upstream.

If the page refcount wraps around past zero, it will be freed while
there are still four billion references to it.  One of the possible
avenues for an attacker to try to make this happen is by doing direct IO
on a page multiple times.  This patch makes get_user_pages() refuse to
take a new page reference if there are already more than two billion
references to the page.

Reported-by: Jann Horn <jannh@google.com>
Acked-by: Matthew Wilcox <willy@infradead.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ 4.4.y backport notes:
  Ajay:     - Added local variable 'err' with-in follow_hugetlb_page()
              from 2be7cfed995e, to resolve compilation error
            - Added page_ref_count()
            - Added missing refcount overflow checks on x86 and s390
              (Vlastimil, thanks for this change)
  Srivatsa: - Replaced call to get_page_foll() with try_get_page_foll() ]
Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Signed-off-by: Ajay Kaher <akaher@vmware.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:08:50 +02:00
..
acpi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
asm-generic rtc: cmos: ignore bogus century byte 2020-04-07 13:40:13 +02:00
clocksource A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
drm drm: mst: Fix query_payload ack reply struct 2020-04-07 13:20:02 +02:00
dt-bindings A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
keys A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kvm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
linux mm: prevent get_user_pages() from overflowing page refcount 2020-04-07 14:08:50 +02:00
math-emu math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning 2020-04-07 12:44:41 +02:00
media media: davinci/vpbe: array underflow in vpbe_enum_outputs() 2020-04-07 13:41:48 +02:00
memory A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
misc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net net: sched: correct flower port blocking 2020-04-07 14:04:39 +02:00
pcmcia A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ras A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rdma A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rxrpc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsi scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session" 2020-04-07 14:03:54 +02:00
sdp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
soc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sound ALSA: rawmidi: Avoid bit fields for state flags 2020-04-07 14:03:58 +02:00
target A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
trace tracing: xen: Ordered comparison of function pointers 2020-04-07 13:45:00 +02:00
uapi netfilter: uapi: Avoid undefined left-shift in xt_sctp.h 2020-04-07 13:28:41 +02:00
video fbdev: Remove unused SH-Mobile HDMI driver 2020-04-07 12:31:27 +02:00
xen A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kbuild A750FXXU4CTBC 2020-03-27 21:51:54 +05:30