diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2018-07-31 05:11:07 +0300 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2018-07-31 05:11:07 +0300 |
commit | 22b9f99b87fa1ff991180cabf02dd04d1bddce2b (patch) | |
tree | 4675ce75a330278a46b34522f99d9e5ca6b9e8d3 /target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch | |
parent | c89195eb25a4dfd093f9d0d3b3adac896bb471ad (diff) | |
download | upstream-22b9f99b87fa1ff991180cabf02dd04d1bddce2b.tar.gz upstream-22b9f99b87fa1ff991180cabf02dd04d1bddce2b.tar.bz2 upstream-22b9f99b87fa1ff991180cabf02dd04d1bddce2b.zip |
kernel: bump 4.14 to 4.14.59
Drop patch that was superseded upstream:
ramips/0036-mtd-fix-cfi-cmdset-0002-erase-status-check.patch
Drop upstreamed patches:
- apm821xx/020-0001-crypto-crypto4xx-remove-bad-list_del.patch
- apm821xx/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch
- ath79/0011-MIPS-ath79-fix-register-address-in-ath79_ddr_wb_flus.patch
- brcm63xx/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch
- brcm63xx/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch
- generic/backport/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch
- generic/pending/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch
- generic/pending/900-gen_stats-fix-netlink-stats-padding.patch
In 4.14.55, a patch was introduced that breaks ext4 images in some
cases. The newly introduced patch
backport-4.14/500-ext4-fix-check-to-prevent-initializing-reserved-inod.patch
addresses this breakage.
Fixes the following CVEs:
- CVE-2018-10876
- CVE-2018-10877
- CVE-2018-10879
- CVE-2018-10880
- CVE-2018-10881
- CVE-2018-10882
- CVE-2018-10883
Compile-tested: ath79, octeon, x86/64
Runtime-tested: ath79, octeon, x86/64
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch')
-rw-r--r-- | target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch b/target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch deleted file mode 100644 index 49b33d514f..0000000000 --- a/target/linux/generic/pending-4.14/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 028c9191bdf88f120f65626920a6a679170fcc3e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= <a.seppala@gmail.com> -Date: Thu, 5 Jul 2018 11:37:03 +0300 -Subject: [PATCH 1/2] usb: dwc2: Fix DMA alignment to start at allocated - boundary -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The commit 3bc04e28a030 ("usb: dwc2: host: Get aligned DMA in a more -supported way") introduced a common way to align DMA allocations. -The code in the commit aligns the struct dma_aligned_buffer but the -actual DMA address pointed by data[0] gets aligned to an offset from -the allocated boundary by the kmalloc_ptr and the old_xfer_buffer -pointers. - -This is against the recommendation in Documentation/DMA-API.txt which -states: - - Therefore, it is recommended that driver writers who don't take - special care to determine the cache line size at run time only map - virtual regions that begin and end on page boundaries (which are - guaranteed also to be cache line boundaries). - -The effect of this is that architectures with non-coherent DMA caches -may run into memory corruption or kernel crashes with Unhandled -kernel unaligned accesses exceptions. - -Fix the alignment by positioning the DMA area in front of the allocation -and use memory at the end of the area for storing the orginal -transfer_buffer pointer. This may have the added benefit of increased -performance as the DMA area is now fully aligned on all architectures. - -Tested with Lantiq xRX200 (MIPS) and RPi Model B Rev 2 (ARM). - -Fixes: 3bc04e28a030 ("usb: dwc2: host: Get aligned DMA in a more -supported way") - -Signed-off-by: Antti Seppälä <a.seppala@gmail.com> ---- - drivers/usb/dwc2/hcd.c | 44 +++++++++++++++++++++++--------------------- - 1 file changed, 23 insertions(+), 21 deletions(-) - ---- a/drivers/usb/dwc2/hcd.c -+++ b/drivers/usb/dwc2/hcd.c -@@ -2628,34 +2628,29 @@ static void dwc2_hc_init_xfer(struct dwc - - #define DWC2_USB_DMA_ALIGN 4 - --struct dma_aligned_buffer { -- void *kmalloc_ptr; -- void *old_xfer_buffer; -- u8 data[0]; --}; -- - static void dwc2_free_dma_aligned_buffer(struct urb *urb) - { -- struct dma_aligned_buffer *temp; -+ void *stored_xfer_buffer; - - if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER)) - return; - -- temp = container_of(urb->transfer_buffer, -- struct dma_aligned_buffer, data); -+ /* Restore urb->transfer_buffer from the end of the allocated area */ -+ memcpy(&stored_xfer_buffer, urb->transfer_buffer + -+ urb->transfer_buffer_length, sizeof(urb->transfer_buffer)); - - if (usb_urb_dir_in(urb)) -- memcpy(temp->old_xfer_buffer, temp->data, -+ memcpy(stored_xfer_buffer, urb->transfer_buffer, - urb->transfer_buffer_length); -- urb->transfer_buffer = temp->old_xfer_buffer; -- kfree(temp->kmalloc_ptr); -+ kfree(urb->transfer_buffer); -+ urb->transfer_buffer = stored_xfer_buffer; - - urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER; - } - - static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) - { -- struct dma_aligned_buffer *temp, *kmalloc_ptr; -+ void *kmalloc_ptr; - size_t kmalloc_size; - - if (urb->num_sgs || urb->sg || -@@ -2663,22 +2658,29 @@ static int dwc2_alloc_dma_aligned_buffer - !((uintptr_t)urb->transfer_buffer & (DWC2_USB_DMA_ALIGN - 1))) - return 0; - -- /* Allocate a buffer with enough padding for alignment */ -+ /* -+ * Allocate a buffer with enough padding for original transfer_buffer -+ * pointer. This allocation is guaranteed to be aligned properly for -+ * DMA -+ */ - kmalloc_size = urb->transfer_buffer_length + -- sizeof(struct dma_aligned_buffer) + DWC2_USB_DMA_ALIGN - 1; -+ sizeof(urb->transfer_buffer); - - kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); - if (!kmalloc_ptr) - return -ENOMEM; - -- /* Position our struct dma_aligned_buffer such that data is aligned */ -- temp = PTR_ALIGN(kmalloc_ptr + 1, DWC2_USB_DMA_ALIGN) - 1; -- temp->kmalloc_ptr = kmalloc_ptr; -- temp->old_xfer_buffer = urb->transfer_buffer; -+ /* -+ * Position value of original urb->transfer_buffer pointer to the end -+ * of allocation for later referencing -+ */ -+ memcpy(kmalloc_ptr + urb->transfer_buffer_length, -+ &urb->transfer_buffer, sizeof(urb->transfer_buffer)); -+ - if (usb_urb_dir_out(urb)) -- memcpy(temp->data, urb->transfer_buffer, -+ memcpy(kmalloc_ptr, urb->transfer_buffer, - urb->transfer_buffer_length); -- urb->transfer_buffer = temp->data; -+ urb->transfer_buffer = kmalloc_ptr; - - urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER; - |