Merge 4.9.57 into android-4.9
Changes in 4.9.57
ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets
CIFS: Reconnect expired SMB sessions
nl80211: Define policy for packet pattern attributes
rcu: Allow for page faults in NMI handlers
USB: dummy-hcd: Fix deadlock caused by disconnect detection
MIPS: math-emu: Remove pr_err() calls from fpu_emu()
dmaengine: edma: Align the memcpy acnt array size with the transfer
dmaengine: ti-dma-crossbar: Fix possible race condition with dma_inuse
HID: usbhid: fix out-of-bounds bug
crypto: shash - Fix zero-length shash ahash digest crash
KVM: MMU: always terminate page walks at level 1
KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
pinctrl/amd: Fix build dependency on pinmux code
iommu/amd: Finish TLB flush in amd_iommu_unmap()
device property: Track owner device of device property
fs/mpage.c: fix mpage_writepage() for pages with buffers
ALSA: usb-audio: Kill stray URB at exiting
ALSA: seq: Fix use-after-free at creating a port
ALSA: seq: Fix copy_from_user() call inside lock
ALSA: caiaq: Fix stray URB at probe error path
ALSA: line6: Fix missing initialization before error path
ALSA: line6: Fix leftover URB at error-path during probe
drm/i915/edp: Get the Panel Power Off timestamp after panel is off
drm/i915: Read timings from the correct transcoder in intel_crtc_mode_get()
drm/i915/bios: parse DDI ports also for CHV for HDMI DDC pin and DP AUX channel
usb: gadget: configfs: Fix memory leak of interface directory data
usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
direct-io: Prevent NULL pointer access in submit_page_section
fix unbalanced page refcounting in bio_map_user_iov
more bio_map_user_iov() leak fixes
bio_copy_user_iov(): don't ignore ->iov_offset
USB: serial: ftdi_sio: add id for Cypress WICED dev board
USB: serial: cp210x: add support for ELV TFD500
USB: serial: option: add support for TP-Link LTE module
USB: serial: qcserial: add Dell DW5818, DW5819
USB: serial: console: fix use-after-free after failed setup
x86/alternatives: Fix alt_max_short macro to really be a max()
KVM: nVMX: update last_nonleaf_level when initializing nested EPT
Linux 4.9.57
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
+19
-7
@@ -1171,8 +1171,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
|
||||
*/
|
||||
bmd->is_our_pages = map_data ? 0 : 1;
|
||||
memcpy(bmd->iov, iter->iov, sizeof(struct iovec) * iter->nr_segs);
|
||||
iov_iter_init(&bmd->iter, iter->type, bmd->iov,
|
||||
iter->nr_segs, iter->count);
|
||||
bmd->iter = *iter;
|
||||
bmd->iter.iov = bmd->iov;
|
||||
|
||||
ret = -ENOMEM;
|
||||
bio = bio_kmalloc(gfp_mask, nr_pages);
|
||||
@@ -1266,6 +1266,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
|
||||
int ret, offset;
|
||||
struct iov_iter i;
|
||||
struct iovec iov;
|
||||
struct bio_vec *bvec;
|
||||
|
||||
iov_for_each(iov, i, *iter) {
|
||||
unsigned long uaddr = (unsigned long) iov.iov_base;
|
||||
@@ -1310,7 +1311,12 @@ struct bio *bio_map_user_iov(struct request_queue *q,
|
||||
ret = get_user_pages_fast(uaddr, local_nr_pages,
|
||||
(iter->type & WRITE) != WRITE,
|
||||
&pages[cur_page]);
|
||||
if (ret < local_nr_pages) {
|
||||
if (unlikely(ret < local_nr_pages)) {
|
||||
for (j = cur_page; j < page_limit; j++) {
|
||||
if (!pages[j])
|
||||
break;
|
||||
put_page(pages[j]);
|
||||
}
|
||||
ret = -EFAULT;
|
||||
goto out_unmap;
|
||||
}
|
||||
@@ -1318,6 +1324,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
|
||||
offset = offset_in_page(uaddr);
|
||||
for (j = cur_page; j < page_limit; j++) {
|
||||
unsigned int bytes = PAGE_SIZE - offset;
|
||||
unsigned short prev_bi_vcnt = bio->bi_vcnt;
|
||||
|
||||
if (len <= 0)
|
||||
break;
|
||||
@@ -1332,6 +1339,13 @@ struct bio *bio_map_user_iov(struct request_queue *q,
|
||||
bytes)
|
||||
break;
|
||||
|
||||
/*
|
||||
* check if vector was merged with previous
|
||||
* drop page reference if needed
|
||||
*/
|
||||
if (bio->bi_vcnt == prev_bi_vcnt)
|
||||
put_page(pages[j]);
|
||||
|
||||
len -= bytes;
|
||||
offset = 0;
|
||||
}
|
||||
@@ -1364,10 +1378,8 @@ struct bio *bio_map_user_iov(struct request_queue *q,
|
||||
return bio;
|
||||
|
||||
out_unmap:
|
||||
for (j = 0; j < nr_pages; j++) {
|
||||
if (!pages[j])
|
||||
break;
|
||||
put_page(pages[j]);
|
||||
bio_for_each_segment_all(bvec, bio, j) {
|
||||
put_page(bvec->bv_page);
|
||||
}
|
||||
out:
|
||||
kfree(pages);
|
||||
|
||||
Reference in New Issue
Block a user