Linux 4.9.34
Greg KH
maintainerI'm announcing the release of the 4.9.34 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/kernel-parameters.txt | 7 + Makefile | 2 arch/arc/mm/mmap.c | 2 arch/arm/mm/mmap.c | 4 arch/frv/mm/elf-fdpic.c | 2 arch/mips/boot/Makefile | 10 - arch/mips/kernel/branch.c | 4 arch/mips/mm/mmap.c | 2 arch/parisc/kernel/sys_parisc.c | 15 +- arch/powerpc/mm/hugetlbpage-radix.c | 2 arch/powerpc/mm/mmap.c | 4 arch/powerpc/mm/slice.c | 2 arch/s390/mm/mmap.c | 4 arch/sh/mm/mmap.c | 4 arch/sparc/kernel/sys_sparc_64.c | 4 arch/sparc/mm/hugetlbpage.c | 2 arch/tile/mm/hugetlbpage.c | 2 arch/x86/kernel/sys_x86_64.c | 4 arch/x86/mm/hugetlbpage.c | 2 arch/x86/mm/numa_32.c | 1 arch/xtensa/kernel/syscall.c | 2 drivers/char/tpm/tpm_ibmvtpm.c | 17 +-- drivers/cpufreq/cpufreq_conservative.c | 4 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 7 - drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 7 - drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 7 - drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 - drivers/gpu/drm/i915/i915_pvinfo.h | 8 - drivers/gpu/drm/i915/i915_vgpu.c | 10 - drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 drivers/gpu/drm/vc4/vc4_bo.c | 8 + drivers/iio/adc/ti_am335x_adc.c | 2 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 39 ++++++- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 3 drivers/iio/pressure/st_pressure_core.c | 10 - drivers/iio/proximity/as3935.c | 6 - drivers/infiniband/hw/mlx5/main.c | 14 +- drivers/media/usb/pvrusb2/pvrusb2-eeprom.c | 13 -- drivers/media/v4l2-core/videobuf2-core.c | 2 drivers/mfd/omap-usb-tll.c | 2 drivers/misc/c2port/c2port-duramar2150.c | 4 drivers/misc/mic/vop/vop_vringh.c | 1 drivers/net/can/usb/gs_usb.c | 2 drivers/net/wireless/ath/ath10k/pci.c | 3 drivers/staging/iio/light/tsl2x7x_core.c | 2 drivers/staging/rtl8188eu/core/rtw_ap.c | 2 drivers/tty/serial/efm32-uart.c | 11 + drivers/tty/serial/sh-sci.c | 4 drivers/usb/core/hcd.c | 1 drivers/usb/core/hub.c | 8 + drivers/usb/dwc3/dwc3-exynos.c | 4 drivers/usb/gadget/composite.c | 2 drivers/usb/gadget/legacy/inode.c | 9 + drivers/usb/gadget/udc/dummy_hcd.c | 19 +-- drivers/usb/gadget/udc/net2280.c | 9 - drivers/usb/gadget/udc/renesas_usb3.c | 43 +++++-- drivers/usb/host/r8a66597-hcd.c | 6 - drivers/usb/host/xhci-mem.c | 7 - drivers/usb/host/xhci-pci.c | 3 drivers/usb/musb/musb_dsps.c | 6 + drivers/usb/usbip/vhci_hcd.c | 11 + fs/btrfs/hash.c | 5 fs/configfs/symlink.c | 3 fs/f2fs/f2fs.h | 5 fs/hugetlbfs/inode.c | 2 fs/proc/task_mmu.c | 4 fs/read_write.c | 2 include/linux/mm.h | 53 ++++----- include/uapi/linux/usb/ch11.h | 3 kernel/irq/manage.c | 4 kernel/sched/core.c | 2 kernel/time/alarmtimer.c | 14 +- lib/libcrc32c.c | 6 - mm/gup.c | 5 mm/memory-failure.c | 5 mm/memory.c | 38 ------ mm/mmap.c | 160 +++++++++++++++++------------ mm/swap_cgroup.c | 3 net/ipv6/ila/ila_xlat.c | 1 net/mac80211/cfg.c | 2 net/mac80211/ibss.c | 6 - net/mac80211/rx.c | 10 + net/mac80211/sta_info.c | 2 net/mac80211/wpa.c | 9 - net/wireless/util.c | 10 + 85 files changed, 447 insertions(+), 313 deletions(-)
Alan Stern (2):
USB: gadget: fix GPF in gadgetfs
USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks
Andy Lutomirski (1):
sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off()
Anton Bondarenko (1):
usb: core: fix potential memory leak in error path during hcd creation
Arnd Bergmann (2):
ila_xlat: add missing hash secret initialization
pvrusb2: reduce stack usage pvr2_eeprom_analyze()
Bin Liu (1):
usb: musb: dsps: keep VBUS on for host-only mode
Chris Brandt (2):
usb: r8a66597-hcd: select a different endpoint on timeout
usb: r8a66597-hcd: decrease timeout
Christoph Hellwig (1):
fs: pass on flags in compat_writev
Christophe JAILLET (3):
vb2: Fix an off by one error in 'vb2_plane_vaddr'
serial: efm32: Fix parity management in 'efm32_uart_console_get_options()'
usb: gadget: composite: Fix function used to free memory
Corentin Labbe (1):
usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk
Dan Carpenter (4):
staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()
iio: adc: ti_am335x_adc: allocating too much in probe
misc: mic: double free on ioctl error path drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR()
David Miller (1):
crypto: Work around deallocated stack frame reference gcc bug on sparc.
Eli Cohen (1):
IB/mlx5: Fix kernel to user leak prevention logic
Emmanuel Grumbach (2):
mac80211: don't look at the PM bit of BAR frames
mac80211: don't send SMPS action frame in AP mode when not needed
Eric Anholt (1):
drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.
Eva Rachel Retuya (1):
staging: iio: tsl2x7x_core: Fix standard deviation calculation
Geert Uytterhoeven (1):
serial: sh-sci: Fix late enablement of AUTORTS
Greg Kroah-Hartman (1):
Linux 4.9.34
Heiner Kallweit (1):
genirq: Release resources in __setup_irq() error path
Helge Deller (1):
Allow stack to grow up to address space limit
Hon Ching \(Vicky) Lo (1):
vTPM: Fix missing NULL check
Hugh Dickins (2):
mm: larger stack guard gap, between vmas
mm: fix new crash in unmapped_area_topdown()
James Morse (1):
mm/memory-failure.c: use compound_head() flags for huge pages
Jason A. Donenfeld (1):
mac80211/wpa: use constant time memory comparison for MACs
Jean-Baptiste Maneyrol (1):
iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500
Johan Hovold (3):
USB: hub: fix SS max number of ports
USB: usbip: fix nonconforming hub descriptor
USB: gadget: dummy_hcd: fix hub-descriptor removable fields
Johannes Berg (3):
mac80211: fix packet statistics for fast-RX
mac80211: fix IBSS presp allocation size
mac80211: fix dropped counter in multiqueue RX
Kalle Valo (1):
ath10k: fix napi crash during rmmod when probe firmware fails
Koen Vandeputte (1):
mac80211: fix CSA in IBSS mode
Laura Abbott (1):
x86/mm/32: Set the '__vmalloc_start_set' flag in initmem_init()
Marc Kleine-Budde (1):
can: gs_usb: fix memory leak in gs_cmd_reset()
Marcin Niestroj (1):
iio: st_pressure: Fix data sign
Mario Kleiner (1):
drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions.
Matt Ranostay (1):
iio: proximity: as3935: recalibrate RCO after resume
Nicholas Bellinger (1):
configfs: Fix race between create_link and configfs_rmdir
Paul Burton (2):
MIPS: Fix bnezc/jialc return address calculation
MIPS: .its targets depend on vmlinux
Rajkumar Manoharan (1):
mac80211: strictly check mesh address extension mode
Shuah Khan (1):
usb: dwc3: exynos fix axius clock error path to do cleanup
Thomas Gleixner (2):
alarmtimer: Prevent overflow of relative timers
alarmtimer: Rate limit periodic intervals
Tomasz Wilczyński (1):
cpufreq: conservative: Allow down_threshold to take values from 1 to 10
Tony Lindgren (1):
mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
YD Tseng (1):
usb: xhci: Fix USB 3.1 supported protocol parsing
YYS (1):
drm/mediatek: fix mtk_hdmi_setup_vendor_specific_infoframe mistake
Yoshihiro Shimoda (3):
usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling
usb: gadget: udc: renesas_usb3: fix deadlock by spinlock
usb: gadget: udc: renesas_usb3: lock for PN_ registers access
Yu Zhao (1):
swap: cond_resched in swap_cgroup_prepare()
Zhenyu Wang (1):
drm/i915: Fix GVT-g PVINFO version compatibility check
Greg KH
maintainerDocumentation/kernel-parameters.txt +7 -0
@@ -3932,6 +3932,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. spia_pedr= spia_peddr= + stack_guard_gap= [MM] + override the default stack gap protection. The value + is in page units and it defines how many pages prior + to (for stacks growing down) resp. after (for stacks + growing up) the main stack are reserved for no other + mapping. Default value is 256 pages. + stacktrace [FTRACE] Enabled the stack tracer on boot up.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 33 +SUBLEVEL = 34 EXTRAVERSION = NAME = Roaring Lionus
arch/arc/mm/mmap.c +1 -1
@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/arm/mm/mmap.c +2 -2
@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/frv/mm/elf-fdpic.c +1 -1
@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi addr =PAGE_ALIGN (addr); vma =find_vma (current->mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma))) goto success; }
arch/mips/boot/Makefile +5 -5
@@ -128,19 +128,19 @@ quiet_cmd_cpp_its_S = ITS $@ -DADDR_BITS=$(ADDR_BITS) \ -DADDR_CELLS=$(itb_addr_cells) -$(obj)/vmlinux.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE +$(obj)/vmlinux.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE $(call if_changed_dep,cpp_its_S,none,vmlinux.bin) -$(obj)/vmlinux.gz.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE +$(obj)/vmlinux.gz.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE $(call if_changed_dep,cpp_its_S,gzip,vmlinux.bin.gz) -$(obj)/vmlinux.bz2.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE +$(obj)/vmlinux.bz2.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE $(call if_changed_dep,cpp_its_S,bzip2,vmlinux.bin.bz2) -$(obj)/vmlinux.lzma.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE +$(obj)/vmlinux.lzma.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE $(call if_changed_dep,cpp_its_S,lzma,vmlinux.bin.lzma) -$(obj)/vmlinux.lzo.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE +$(obj)/vmlinux.lzo.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE $(call if_changed_dep,cpp_its_S,lzo,vmlinux.bin.lzo) quiet_cmd_itb-image = ITB $@
arch/mips/kernel/branch.c +3 -1
@@ -804,8 +804,10 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, break; }/* Compact branch: BNEZC || JIALC */ -if (insn.i_format.rs) +if (!insn.i_format.rs) { +/* JIALC: set $31/ra */ regs->regs[31 ] = epc +4 ; + } regs->cp0_epc +=8 ;break ;#endif
arch/mips/mm/mmap.c +1 -1
@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/parisc/kernel/sys_parisc.c +9 -6
@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct mm_struct *mm = current->mm; -struct vm_area_struct *vma; +struct vm_area_struct *vma, *prev;unsigned long task_size =TASK_SIZE ;int do_color_align, last_mmap;struct vm_unmapped_area_info info;
@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,else addr =PAGE_ALIGN (addr); - vma =find_vma (mm, addr); + vma =find_vma_prev (mm, addr, &prev);if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)) && + (!prev || addr >=vm_end_gap (prev))) goto found_addr; }
@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags) { - struct vm_area_struct *vma; + struct vm_area_struct *vma, *prev;struct mm_struct *mm = current->mm;unsigned long addr = addr0;int do_color_align, last_mmap;
@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr =COLOR_ALIGN (addr, last_mmap, pgoff); else addr =PAGE_ALIGN (addr); - vma =find_vma (mm, addr); + + vma =find_vma_prev (mm, addr, &prev);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)) && + (!prev || addr >=vm_end_gap (prev))) goto found_addr; }
arch/powerpc/mm/hugetlbpage-radix.c +1 -1
@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, addr =ALIGN (addr,huge_page_size (h)); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }/*
arch/powerpc/mm/mmap.c +2 -2
@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/powerpc/mm/slice.c +1 -1
@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,if ((mm->task_size - len) < addr)return 0 ; vma =find_vma (mm, addr); -return (!vma || (addr + len) <= vma->vm_start); +return (!vma || (addr + len) <=vm_start_gap (vma)); }static int slice_low_has_vma (struct mm_struct *mm,unsigned long slice)
arch/s390/mm/mmap.c +2 -2
@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/sh/mm/mmap.c +2 -2
@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/sparc/kernel/sys_sparc_64.c +2 -2
@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi vma =find_vma (mm, addr);if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, vma =find_vma (mm, addr);if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/sparc/mm/hugetlbpage.c +1 -1
@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, addr =ALIGN (addr,HPAGE_SIZE ); vma =find_vma (mm, addr);if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }if (mm->get_unmapped_area == arch_get_unmapped_area)
arch/tile/mm/hugetlbpage.c +1 -1
@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, addr =ALIGN (addr,huge_page_size (h)); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }if (current->mm->get_unmapped_area == arch_get_unmapped_area)
arch/x86/kernel/sys_x86_64.c +2 -2
@@ -140,7 +140,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (end - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr =PAGE_ALIGN (addr); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
arch/x86/mm/hugetlbpage.c +1 -1
@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, addr =ALIGN (addr,huge_page_size (h)); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }if (mm->get_unmapped_area == arch_get_unmapped_area)
arch/x86/mm/numa_32.c +1 -0
@@ -100,5 +100,6 @@ void __init initmem_init(void)printk (KERN_DEBUG "High memory starts at vaddr %08lx\n" , (ulong )pfn_to_kaddr (highstart_pfn)); + __vmalloc_start_set = true;setup_bootmem_allocator (); }
arch/xtensa/kernel/syscall.c +1 -1
@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,/* At this point: (!vmm || addr < vmm->vm_end). */ if (TASK_SIZE - len < addr)return -ENOMEM ; -if (!vmm || addr + len <= vmm->vm_start) +if (!vmm || addr + len <=vm_start_gap (vmm))return addr; addr = vmm->vm_end;if (flags &MAP_SHARED )
drivers/char/tpm/tpm_ibmvtpm.c +11 -6
@@ -295,6 +295,8 @@ static int tpm_ibmvtpm_remove(struct vio_dev *vdev) }kfree (ibmvtpm); +/* For tpm_ibmvtpm_get_desired_dma */ +dev_set_drvdata (&vdev->dev,NULL );return 0 ; }
@@ -309,13 +311,16 @@ static int tpm_ibmvtpm_remove(struct vio_dev *vdev)static unsigned long tpm_ibmvtpm_get_desired_dma (struct vio_dev *vdev) {struct tpm_chip *chip =dev_get_drvdata (&vdev->dev); -struct ibmvtpm_dev *ibmvtpm =dev_get_drvdata (&chip->dev); +struct ibmvtpm_dev *ibmvtpm; -/* ibmvtpm initializes at probe time, so the data we are -* asking for may not be set yet. Estimate that 4K required -* for TCE-mapped buffer in addition to CRQ. -*/ -if (!ibmvtpm) +/* +* ibmvtpm initializes at probe time, so the data we are +* asking for may not be set yet. Estimate that 4K required +* for TCE-mapped buffer in addition to CRQ. +*/ +if (chip) + ibmvtpm =dev_get_drvdata (&chip->dev); +else return CRQ_RES_BUF_SIZE +PAGE_SIZE ;return CRQ_RES_BUF_SIZE + ibmvtpm->rtce_size;
drivers/cpufreq/cpufreq_conservative.c +2 -2
@@ -169,8 +169,8 @@ static ssize_t store_down_threshold(struct gov_attr_set *attr_set,int ret; ret =sscanf (buf,"%u" , &input); -/* cannot be lower than 11 otherwise freq will not fall */ -if (ret !=1 || input <11 || input >100 || +/* cannot be lower than 1 otherwise freq will not fall */ +if (ret !=1 || input <1 || input >100 || input >= dbs_data->up_threshold)return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +5 -2
@@ -1290,8 +1290,11 @@ static void dce_v10_0_program_watermarks(struct amdgpu_device *adev,u32 tmp, wm_mask, lb_vblank_lead_lines =0 ;if (amdgpu_crtc->base.enabled && num_heads && mode) { - active_time =1000000UL * (u32 )mode->crtc_hdisplay / (u32 )mode->clock; - line_time =min ((u32) (1000000UL * (u32 )mode->crtc_htotal / (u32 )mode->clock), (u32 )65535 ); + active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , + (u32 )mode->clock); + line_time = (u32 )div_u64 ((u64 )mode->crtc_htotal *1000000 , + (u32 )mode->clock); + line_time =min (line_time, (u32 )65535 );/* watermark for high clocks */ if (adev->pm.dpm_enabled) {
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +5 -2
@@ -1257,8 +1257,11 @@ static void dce_v11_0_program_watermarks(struct amdgpu_device *adev,u32 tmp, wm_mask, lb_vblank_lead_lines =0 ;if (amdgpu_crtc->base.enabled && num_heads && mode) { - active_time =1000000UL * (u32 )mode->crtc_hdisplay / (u32 )mode->clock; - line_time =min ((u32) (1000000UL * (u32 )mode->crtc_htotal / (u32 )mode->clock), (u32 )65535 ); + active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , + (u32 )mode->clock); + line_time = (u32 )div_u64 ((u64 )mode->crtc_htotal *1000000 , + (u32 )mode->clock); + line_time =min (line_time, (u32 )65535 );/* watermark for high clocks */ if (adev->pm.dpm_enabled) {
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +5 -2
@@ -1054,8 +1054,11 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,fixed20_12 a, b, c;if (amdgpu_crtc->base.enabled && num_heads && mode) { - active_time =1000000UL * (u32 )mode->crtc_hdisplay / (u32 )mode->clock; - line_time =min ((u32) (1000000UL * (u32 )mode->crtc_htotal / (u32 )mode->clock), (u32 )65535 ); + active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , + (u32 )mode->clock); + line_time = (u32 )div_u64 ((u64 )mode->crtc_htotal *1000000 , + (u32 )mode->clock); + line_time =min (line_time, (u32 )65535 ); priority_a_cnt =0 ; priority_b_cnt =0 ;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +5 -2
@@ -1211,8 +1211,11 @@ static void dce_v8_0_program_watermarks(struct amdgpu_device *adev,u32 tmp, wm_mask, lb_vblank_lead_lines =0 ;if (amdgpu_crtc->base.enabled && num_heads && mode) { - active_time =1000000UL * (u32 )mode->crtc_hdisplay / (u32 )mode->clock; - line_time =min ((u32) (1000000UL * (u32 )mode->crtc_htotal / (u32 )mode->clock), (u32 )65535 ); + active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , + (u32 )mode->clock); + line_time = (u32 )div_u64 ((u64 )mode->crtc_htotal *1000000 , + (u32 )mode->clock); + line_time =min (line_time, (u32 )65535 );/* watermark for high clocks */ if (adev->pm.dpm_enabled) {
drivers/gpu/drm/i915/i915_pvinfo.h +2 -6
@@ -36,10 +36,6 @@#define VGT_VERSION_MAJOR 1#define VGT_VERSION_MINOR 0 -#define INTEL_VGT_IF_VERSION_ENCODE (major, minor) ((major) << 16 | (minor)) -#define INTEL_VGT_IF_VERSION \ - INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR) -/* * notifications from guest to vgpu device model */
@@ -55,8 +51,8 @@ enum vgt_g2v_type {struct vgt_if {u64 magic;/* VGT_MAGIC */ -uint16_t version_major; -uint16_t version_minor; +u16 version_major; +u16 version_minor;u32 vgt_id;/* ID of vGT instance */ u32 rsv1[12 ];/* pad to offset 0x40 */ /*
drivers/gpu/drm/i915/i915_vgpu.c +4 -6
@@ -60,8 +60,8 @@*/ void i915_check_vgpu (struct drm_i915_private *dev_priv) { -uint64_t magic; -uint32_t version; +u64 magic; +u16 version_major;BUILD_BUG_ON (sizeof (struct vgt_if ) !=VGT_PVINFO_SIZE );
@@ -69,10 +69,8 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)if (magic !=VGT_MAGIC )return ; - version =INTEL_VGT_IF_VERSION_ENCODE ( -__raw_i915_read16 (dev_priv,vgtif_reg (version_major)), -__raw_i915_read16 (dev_priv,vgtif_reg (version_minor))); -if (version !=INTEL_VGT_IF_VERSION ) { + version_major =__raw_i915_read16 (dev_priv,vgtif_reg (version_major)); +if (version_major <VGT_VERSION_MAJOR ) {DRM_INFO ("VGT interface version mismatch!\n" );return ; }
drivers/gpu/drm/mediatek/mtk_hdmi.c +1 -1
@@ -1061,7 +1061,7 @@ static int mtk_hdmi_setup_vendor_specific_infoframe(struct mtk_hdmi *hdmi, } err =hdmi_vendor_infoframe_pack (&frame, buffer,sizeof (buffer)); -if (err) { +if (err <0 ) {dev_err (hdmi->dev,"Failed to pack vendor infoframe: %zd\n" , err);return err;
drivers/gpu/drm/vc4/vc4_bo.c +8 -0
@@ -313,6 +313,14 @@ void vc4_free_object(struct drm_gem_object *gem_bo) goto out; } +/* If this object was partially constructed but CMA allocation +* had failed, just free it. +*/ +if (!bo->base.vaddr) { +vc4_bo_destroy (bo); + goto out; + } + cache_list =vc4_get_cache_list_for_size (dev, gem_bo->size);if (!cache_list) {vc4_bo_destroy (bo);
drivers/iio/adc/ti_am335x_adc.c +1 -1
@@ -484,7 +484,7 @@ static int tiadc_probe(struct platform_device *pdev)return -EINVAL ; } - indio_dev =devm_iio_device_alloc (&pdev->dev,sizeof (*indio_dev)); + indio_dev =devm_iio_device_alloc (&pdev->dev,sizeof (*adc_dev));if (indio_dev ==NULL ) {dev_err (&pdev->dev,"failed to allocate iio device\n" );return -ENOMEM ;
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +36 -3
@@ -41,6 +41,7 @@ static const int accel_scale[] = {598, 1196, 2392, 4785};static const struct inv_mpu6050_reg_map reg_set_6500 = { .sample_rate_div =INV_MPU6050_REG_SAMPLE_RATE_DIV , .lpf =INV_MPU6050_REG_CONFIG , + .accel_lpf =INV_MPU6500_REG_ACCEL_CONFIG_2 , .user_ctrl =INV_MPU6050_REG_USER_CTRL , .fifo_en =INV_MPU6050_REG_FIFO_EN , .gyro_config =INV_MPU6050_REG_GYRO_CONFIG ,
@@ -205,6 +206,37 @@ int inv_mpu6050_set_power_itg(struct inv_mpu6050_state *st, bool power_on)EXPORT_SYMBOL_GPL (inv_mpu6050_set_power_itg);/** +* inv_mpu6050_set_lpf_regs() - set low pass filter registers, chip dependent +* +* MPU60xx/MPU9150 use only 1 register for accelerometer + gyroscope +* MPU6500 and above have a dedicated register for accelerometer +*/ +static int inv_mpu6050_set_lpf_regs (struct inv_mpu6050_state *st, +enum inv_mpu6050_filter_e val) +{ +int result; + + result =regmap_write (st->map, st->reg->lpf, val); +if (result) +return result; + +switch (st->chip_type) { +case INV_MPU6050 : +case INV_MPU6000 : +case INV_MPU9150 : +/* old chips, nothing to do */ + result =0 ; +break ; +default : +/* set accel lpf */ + result =regmap_write (st->map, st->reg->accel_lpf, val); +break ; + } + +return result; +} + +/** * inv_mpu6050_init_config() - Initialize hardware, disable FIFO. * * Initial configuration:
@@ -227,8 +259,7 @@ static int inv_mpu6050_init_config(struct iio_dev *indio_dev)if (result)return result; - d =INV_MPU6050_FILTER_20HZ ; - result =regmap_write (st->map, st->reg->lpf, d); + result =inv_mpu6050_set_lpf_regs (st,INV_MPU6050_FILTER_20HZ );if (result)return result;
@@ -531,6 +562,8 @@ static int inv_mpu6050_write_raw(struct iio_dev *indio_dev,* would be alising. This function basically search for the * correct low pass parameters based on the fifo rate, e.g, * sampling frequency. +* +* lpf is set automatically when setting sampling rate to avoid any aliases. */ static int inv_mpu6050_set_lpf (struct inv_mpu6050_state *st,int rate) {
@@ -546,7 +579,7 @@ static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate)while ((h < hz[i]) && (i <ARRAY_SIZE (d) -1 )) i++; data = d[i]; - result =regmap_write (st->map, st->reg->lpf, data); + result =inv_mpu6050_set_lpf_regs (st, data);if (result)return result; st->chip_config.lpf = data;
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +3 -0
@@ -28,6 +28,7 @@* struct inv_mpu6050_reg_map - Notable registers. * @sample_rate_div: Divider applied to gyro output rate. * @lpf: Configures internal low pass filter. +* @accel_lpf: Configures accelerometer low pass filter. * @user_ctrl: Enables/resets the FIFO. * @fifo_en: Determines which data will appear in FIFO. * @gyro_config: gyro config register.
@@ -47,6 +48,7 @@struct inv_mpu6050_reg_map {u8 sample_rate_div;u8 lpf; +u8 accel_lpf;u8 user_ctrl;u8 fifo_en;u8 gyro_config;
@@ -187,6 +189,7 @@ struct inv_mpu6050_state {#define INV_MPU6050_FIFO_THRESHOLD 500/* mpu6500 registers */ +#define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D#define INV_MPU6500_REG_ACCEL_OFFSET 0x77/* delay time in milliseconds */
drivers/iio/pressure/st_pressure_core.c +5 -5
@@ -227,7 +227,7 @@ static const struct iio_chan_spec st_press_1_channels[] = { .address = ST_PRESS_1_OUT_XL_ADDR, .scan_index = 0, .scan_type = { - .sign = 'u', + .sign = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_LE,
@@ -240,7 +240,7 @@ static const struct iio_chan_spec st_press_1_channels[] = { .address = ST_TEMP_1_OUT_L_ADDR, .scan_index = 1, .scan_type = { - .sign = 'u', + .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -259,7 +259,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = { .address = ST_PRESS_LPS001WP_OUT_L_ADDR, .scan_index = 0, .scan_type = { - .sign = 'u', + .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -273,7 +273,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = { .address = ST_TEMP_LPS001WP_OUT_L_ADDR, .scan_index = 1, .scan_type = { - .sign = 'u', + .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -291,7 +291,7 @@ static const struct iio_chan_spec st_press_lps22hb_channels[] = { .address = ST_PRESS_1_OUT_XL_ADDR, .scan_index = 0, .scan_type = { - .sign = 'u', + .sign = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_LE,
drivers/iio/proximity/as3935.c +2 -4
@@ -269,8 +269,6 @@ static irqreturn_t as3935_interrupt_handler(int irq, void *private)static void calibrate_as3935 (struct as3935_state *st) { -mutex_lock (&st->lock); -/* mask disturber interrupt bit */ as3935_write (st,AS3935_INT ,BIT (5 ));
@@ -280,8 +278,6 @@ static void calibrate_as3935(struct as3935_state *st)mdelay (2 );as3935_write (st,AS3935_TUNE_CAP , (st->tune_cap /TUNE_CAP_DIV )); - -mutex_unlock (&st->lock); }#ifdef CONFIG_PM_SLEEP
@@ -318,6 +314,8 @@ static int as3935_resume(struct device *dev) val &= ~AS3935_AFE_PWR_BIT ; ret =as3935_write (st,AS3935_AFE_GAIN , val); +calibrate_as3935 (st); + err_resume:mutex_unlock (&st->lock);
drivers/infiniband/hw/mlx5/main.c +7 -7
@@ -1105,13 +1105,13 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,* pretend we don't support reading the HCA's core clock. This is also * forced by mmap function. */ -if (PAGE_SIZE <=4096 && -field_avail (typeof (resp), hca_core_clock_offset, udata->outlen)) { - resp.comp_mask |= -MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET ; - resp.hca_core_clock_offset = - offsetof(struct mlx5_init_seg , internal_timer_h) % -PAGE_SIZE ; +if (field_avail (typeof (resp), hca_core_clock_offset, udata->outlen)) { +if (PAGE_SIZE <=4096 ) { + resp.comp_mask |= +MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET ; + resp.hca_core_clock_offset = + offsetof(struct mlx5_init_seg , internal_timer_h) %PAGE_SIZE ; + } resp.response_length +=sizeof (resp.hca_core_clock_offset) +sizeof (resp.reserved2); }
drivers/media/usb/pvrusb2/pvrusb2-eeprom.c +4 -9
@@ -123,15 +123,10 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw)memset (&tvdata,0 ,sizeof (tvdata)); eeprom =pvr2_eeprom_fetch (hdw); -if (!eeprom)return -EINVAL ; - - { -struct i2c_client fake_client; -/* Newer version expects a useless client interface */ - fake_client.addr = hdw->eeprom_addr; - fake_client.adapter = &hdw->i2c_adap; -tveeprom_hauppauge_analog (&fake_client,&tvdata,eeprom); - } +if (!eeprom) +return -EINVAL ; + +tveeprom_hauppauge_analog (NULL , &tvdata, eeprom);trace_eeprom ("eeprom assumed v4l tveeprom module" );trace_eeprom ("eeprom direct call results:" );
drivers/media/v4l2-core/videobuf2-core.c +1 -1
@@ -868,7 +868,7 @@ EXPORT_SYMBOL_GPL(vb2_core_create_bufs);void *vb2_plane_vaddr (struct vb2_buffer *vb,unsigned int plane_no) { -if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv) +if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)return NULL ;return call_ptr_memop (vb, vaddr, vb->planes[plane_no].mem_priv);
drivers/mfd/omap-usb-tll.c +1 -1
@@ -377,8 +377,8 @@ int omap_tll_init(struct usbhs_omap_platform_data *pdata)* and use SDR Mode */ reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE - |OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF |OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE ); + reg |=OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF ; }else if (pdata->port_mode[i] ==OMAP_EHCI_PORT_MODE_HSIC ) {/*
drivers/misc/c2port/c2port-duramar2150.c +2 -2
@@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void) duramar2150_c2port_dev =c2port_device_register ("uc" , &duramar2150_c2port_ops,NULL ); -if (!duramar2150_c2port_dev) { - ret = -ENODEV ; +if (IS_ERR (duramar2150_c2port_dev)) { + ret =PTR_ERR (duramar2150_c2port_dev); goto free_region; }
drivers/misc/mic/vop/vop_vringh.c +0 -1
@@ -292,7 +292,6 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,if (ret) {dev_err (vop_dev (vdev),"%s %d err %d\n" , __func__, __LINE__, ret); -kfree (vdev);return ret; }
drivers/net/can/usb/gs_usb.c +2 -0
@@ -265,6 +265,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)sizeof (*dm), 1000); +kfree (dm); +return rc; }
drivers/net/wireless/ath/ath10k/pci.c +2 -1
@@ -1647,6 +1647,8 @@ static int ath10k_pci_hif_start(struct ath10k *ar)ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot hif start\n" ); +napi_enable (&ar->napi); +ath10k_pci_irq_enable (ar);ath10k_pci_rx_post (ar);
@@ -2531,7 +2533,6 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)ath10k_err (ar,"could not wake up target CPU: %d\n" , ret); goto err_ce; } -napi_enable (&ar->napi);return 0 ;
drivers/staging/iio/light/tsl2x7x_core.c +1 -1
@@ -854,7 +854,7 @@ void tsl2x7x_prox_calculate(int *data, int length, tmp = data[i] - statP->mean; sample_sum += tmp * tmp; } - statP->stddev =int_sqrt ((long )sample_sum) / length; + statP->stddev =int_sqrt ((long )sample_sum / length); }/**
drivers/staging/rtl8188eu/core/rtw_ap.c +1 -1
@@ -890,7 +890,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)return _FAIL; -if (len >MAX_IE_SZ ) +if (len <0 || len >MAX_IE_SZ )return _FAIL; pbss_network->IELength = len;
drivers/tty/serial/efm32-uart.c +8 -3
@@ -27,6 +27,7 @@#define UARTn_FRAME 0x04#define UARTn_FRAME_DATABITS__MASK 0x000f#define UARTn_FRAME_DATABITS (n) ((n) - 3) +#define UARTn_FRAME_PARITY__MASK 0x0300#define UARTn_FRAME_PARITY_NONE 0x0000#define UARTn_FRAME_PARITY_EVEN 0x0200#define UARTn_FRAME_PARITY_ODD 0x0300
@@ -572,12 +573,16 @@ static void efm32_uart_console_get_options(struct efm32_uart_port *efm_port, 16 * (4 + (clkdiv >> 6))); frame =efm32_uart_read32 (efm_port, UARTn_FRAME); -if (frame & UARTn_FRAME_PARITY_ODD) +switch (frame & UARTn_FRAME_PARITY__MASK) { +case UARTn_FRAME_PARITY_ODD: *parity ='o' ; -else if (frame & UARTn_FRAME_PARITY_EVEN) +break ; +case UARTn_FRAME_PARITY_EVEN: *parity ='e' ; -else +break ; +default : *parity ='n' ; + } *bits = (frame & UARTn_FRAME_DATABITS__MASK) -UARTn_FRAME_DATABITS (4 ) +4 ;
drivers/tty/serial/sh-sci.c +4 -0
@@ -2366,6 +2366,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,*/ udelay (DIV_ROUND_UP (10 *1000000 , baud)); } +if (port->flags &UPF_HARD_FLOW ) { +/* Refresh (Auto) RTS */ +sci_set_mctrl (port, port->mctrl); + }#ifdef CONFIG_SERIAL_SH_SCI_DMA /*
drivers/usb/core/hcd.c +1 -0
@@ -2535,6 +2535,7 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, hcd->bandwidth_mutex =kmalloc (sizeof (*hcd->bandwidth_mutex),GFP_KERNEL );if (!hcd->bandwidth_mutex) { +kfree (hcd->address0_mutex);kfree (hcd);dev_dbg (dev,"hcd bandwidth mutex alloc failed\n" );return NULL ;
drivers/usb/core/hub.c +7 -1
@@ -1334,7 +1334,13 @@ static int hub_configure(struct usb_hub *hub,if (ret <0 ) { message ="can't read hub descriptor" ; goto fail; - }else if (hub->descriptor->bNbrPorts >USB_MAXCHILDREN ) { + } + + maxchild =USB_MAXCHILDREN ; +if (hub_is_superspeed (hdev)) + maxchild =min_t (unsigned, maxchild,USB_SS_MAXPORTS ); + +if (hub->descriptor->bNbrPorts > maxchild) { message ="hub has too many ports!" ; ret = -ENODEV ; goto fail;
drivers/usb/dwc3/dwc3-exynos.c +3 -1
@@ -148,7 +148,8 @@ static int dwc3_exynos_probe(struct platform_device *pdev) exynos->axius_clk =devm_clk_get (dev,"usbdrd30_axius_clk" );if (IS_ERR (exynos->axius_clk)) {dev_err (dev,"no AXI UpScaler clk specified\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto axius_clk_err; }clk_prepare_enable (exynos->axius_clk); }else {
@@ -206,6 +207,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)regulator_disable (exynos->vdd33); err2:clk_disable_unprepare (exynos->axius_clk); +axius_clk_err:clk_disable_unprepare (exynos->susp_clk);clk_disable_unprepare (exynos->clk);return ret;
drivers/usb/gadget/composite.c +1 -1
@@ -2147,7 +2147,7 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev, cdev->os_desc_req->buf =kmalloc (4096 ,GFP_KERNEL );if (!cdev->os_desc_req->buf) { ret = -ENOMEM ; -kfree (cdev->os_desc_req); +usb_ep_free_request (ep0, cdev->os_desc_req); goto end; } cdev->os_desc_req->context = cdev;
drivers/usb/gadget/legacy/inode.c +6 -3
@@ -1183,8 +1183,10 @@ dev_release (struct inode *inode, struct file *fd)/* closing ep0 === shutdown all */ -if (dev->gadget_registered) +if (dev->gadget_registered) {usb_gadget_unregister_driver (&gadgetfs_driver); + dev->gadget_registered = false; + }/* at this point "good" hardware has disconnected the * device from USB; the host won't see it any more.
@@ -1677,9 +1679,10 @@ static void gadgetfs_suspend (struct usb_gadget *gadget) {struct dev_data *dev =get_gadget_data (gadget); +unsigned long flags;INFO (dev,"suspended from state %d\n" , dev->state); -spin_lock (&dev->lock); +spin_lock_irqsave (&dev->lock, flags);switch (dev->state) {case STATE_DEV_SETUP :// VERY odd... host died?? case STATE_DEV_CONNECTED :
@@ -1690,7 +1693,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)default :break ; } -spin_unlock (&dev->lock); +spin_unlock_irqrestore (&dev->lock, flags); }static struct usb_gadget_driver gadgetfs_driver = {
drivers/usb/gadget/udc/dummy_hcd.c +7 -12
@@ -442,23 +442,16 @@ static void set_link_state(struct dummy_hcd *dum_hcd)/* Report reset and disconnect events to the driver */ if (dum->driver && (disconnect || reset)) {stop_activity (dum); -spin_unlock (&dum->lock);if (reset)usb_gadget_udc_reset (&dum->gadget, dum->driver);else dum->driver->disconnect (&dum->gadget); -spin_lock (&dum->lock); } }else if (dum_hcd->active != dum_hcd->old_active) { -if (dum_hcd->old_active && dum->driver->suspend) { -spin_unlock (&dum->lock); +if (dum_hcd->old_active && dum->driver->suspend) dum->driver->suspend (&dum->gadget); -spin_lock (&dum->lock); - }else if (!dum_hcd->old_active && dum->driver->resume) { -spin_unlock (&dum->lock); +else if (!dum_hcd->old_active && dum->driver->resume) dum->driver->resume (&dum->gadget); -spin_lock (&dum->lock); - } } dum_hcd->old_status = dum_hcd->port_status;
@@ -983,7 +976,9 @@ static int dummy_udc_stop(struct usb_gadget *g)struct dummy_hcd *dum_hcd =gadget_to_dummy_hcd (g);struct dummy *dum = dum_hcd->dum; +spin_lock_irq (&dum->lock); dum->driver =NULL ; +spin_unlock_irq (&dum->lock);return 0 ; }
@@ -2009,7 +2004,7 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc) HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =1 ; desc->u.ss.bHubHdrDecLat =0x04 ;/* Worst case: 0.4 micro sec*/ - desc->u.ss.DeviceRemovable =0xffff ; + desc->u.ss.DeviceRemovable =0 ; }static inline void hub_descriptor (struct usb_hub_descriptor *desc)
@@ -2021,8 +2016,8 @@ static inline void hub_descriptor(struct usb_hub_descriptor *desc)HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =1 ; - desc->u.hs.DeviceRemovable[0 ] =0xff ; - desc->u.hs.DeviceRemovable[1 ] =0xff ; + desc->u.hs.DeviceRemovable[0 ] =0 ; + desc->u.hs.DeviceRemovable[1 ] =0xff ;/* PortPwrCtrlMask */ } static int dummy_hub_control(
drivers/usb/gadget/udc/net2280.c +1 -8
@@ -2469,11 +2469,8 @@ static void stop_activity(struct net2280 *dev, struct usb_gadget_driver *driver)nuke (&dev->ep[i]);/* report disconnect; the driver is already quiesced */ -if (driver) { -spin_unlock (&dev->lock); +if (driver) driver->disconnect (&dev->gadget); -spin_lock (&dev->lock); - }usb_reinit (dev); }
@@ -3347,8 +3344,6 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat) BIT(PCI_RETRY_ABORT_INTERRUPT))static void handle_stat1_irqs (struct net2280 *dev,u32 stat) -__releases(dev->lock) -__acquires(dev->lock) {struct net2280_ep *ep;u32 tmp, num, mask, scratch;
@@ -3389,14 +3384,12 @@ __acquires(dev->lock)if (disconnect || reset) {stop_activity (dev, dev->driver);ep0_start (dev); -spin_unlock (&dev->lock);if (reset)usb_gadget_udc_reset (&dev->gadget, dev->driver);else (dev->driver->disconnect) (&dev->gadget); -spin_lock (&dev->lock);return ; } }
drivers/usb/gadget/udc/renesas_usb3.c +31 -12
106 lines not on this page · raw message
drivers/usb/host/r8a66597-hcd.c +4 -2
@@ -1269,7 +1269,7 @@ static void set_td_timer(struct r8a66597 *r8a66597, struct r8a66597_td *td) time =30 ;break ;default : - time =300 ; + time =50 ;break ; }
@@ -1785,6 +1785,7 @@ static void r8a66597_td_timer(unsigned long _r8a66597) pipe = td->pipe;pipe_stop (r8a66597, pipe); +/* Select a different address or endpoint */ new_td = td; do { list_move_tail(&new_td->queue,
@@ -1794,7 +1795,8 @@ static void r8a66597_td_timer(unsigned long _r8a66597) new_td = td;break ; } - }while (td != new_td && td->address == new_td->address); + }while (td != new_td && td->address == new_td->address && + td->pipe->info.epnum == new_td->pipe->info.epnum);start_transfer (r8a66597, new_td);
drivers/usb/host/xhci-mem.c +5 -2
@@ -2123,11 +2123,12 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports, {u32 temp, port_offset, port_count;int i; -u8 major_revision; +u8 major_revision, minor_revision;struct xhci_hub *rhub; temp =readl (addr); major_revision =XHCI_EXT_PORT_MAJOR (temp); + minor_revision =XHCI_EXT_PORT_MINOR (temp);if (major_revision ==0x03 ) { rhub = &xhci->usb3_rhub;
@@ -2141,7 +2142,9 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports,return ; } rhub->maj_rev =XHCI_EXT_PORT_MAJOR (temp); - rhub->min_rev =XHCI_EXT_PORT_MINOR (temp); + +if (rhub->min_rev < minor_revision) + rhub->min_rev = minor_revision;/* Port offset and count in the third dword, see section 7.2 */ temp =readl (addr +2 );
drivers/usb/host/xhci-pci.c +3 -0
@@ -201,6 +201,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)if (pdev->vendor ==PCI_VENDOR_ID_ASMEDIA && pdev->device ==0x1042 ) xhci->quirks |=XHCI_BROKEN_STREAMS ; +if (pdev->vendor ==PCI_VENDOR_ID_ASMEDIA && + pdev->device ==0x1142 ) + xhci->quirks |=XHCI_TRUST_TX_LENGTH ;if (pdev->vendor ==PCI_VENDOR_ID_TI && pdev->device ==0x8241 ) xhci->quirks |=XHCI_LIMIT_ENDPOINT_INTERVAL_7 ;
drivers/usb/musb/musb_dsps.c +6 -0
@@ -213,6 +213,12 @@ static int dsps_check_status(struct musb *musb, void *unused) msecs_to_jiffies(wrp->poll_timeout));break ;case OTG_STATE_A_WAIT_BCON : +/* keep VBUS on for host-only mode */ +if (musb->port_mode ==MUSB_PORT_MODE_HOST ) { +mod_timer (&glue->timer, jiffies + +msecs_to_jiffies (wrp->poll_timeout)); +break ; + }musb_writeb (musb->mregs,MUSB_DEVCTL ,0 ); skip_session =1 ;/* fall */
drivers/usb/usbip/vhci_hcd.c +8 -3
@@ -235,14 +235,19 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *buf)static inline void hub_descriptor (struct usb_hub_descriptor *desc) { +int width; +memset (desc,0 ,sizeof (*desc)); desc->bDescriptorType =USB_DT_HUB ; - desc->bDescLength =9 ; desc->wHubCharacteristics =cpu_to_le16 (HUB_CHAR_INDV_PORT_LPSM |HUB_CHAR_COMMON_OCPM ); + desc->bNbrPorts =VHCI_HC_PORTS ; - desc->u.hs.DeviceRemovable[0 ] =0xff ; - desc->u.hs.DeviceRemovable[1 ] =0xff ; +BUILD_BUG_ON (VHCI_HC_PORTS >USB_MAXCHILDREN ); + width = desc->bNbrPorts /8 +1 ; + desc->bDescLength =USB_DT_HUB_NONVAR_SIZE +2 * width; +memset (&desc->u.hs.DeviceRemovable[0 ],0 , width); +memset (&desc->u.hs.DeviceRemovable[width],0xff , width); } static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
fs/btrfs/hash.c +4 -1
@@ -38,6 +38,7 @@ u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length) {SHASH_DESC_ON_STACK (shash, tfm);u32 *ctx = (u32 *)shash_desc_ctx (shash); +u32 retval;int err; shash->tfm = tfm;
@@ -47,5 +48,7 @@ u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length) err =crypto_shash_update (shash, address, length);BUG_ON (err); -return *ctx; + retval = *ctx; +barrier_data (ctx); +return retval; }
fs/configfs/symlink.c +1 -2
@@ -83,14 +83,13 @@ static int create_link(struct config_item *parent_item, ret = -ENOMEM ; sl =kmalloc (sizeof (struct configfs_symlink ),GFP_KERNEL );if (sl) { - sl->sl_target =config_item_get (item);spin_lock (&configfs_dirent_lock);if (target_sd->s_type &CONFIGFS_USET_DROPPING ) {spin_unlock (&configfs_dirent_lock); -config_item_put (item);kfree (sl);return -ENOENT ; } + sl->sl_target =config_item_get (item);list_add (&sl->sl_list, &target_sd->s_links);spin_unlock (&configfs_dirent_lock); ret = configfs_create_link(sl, parent_item->ci_dentry,
fs/f2fs/f2fs.h +4 -1
@@ -948,6 +948,7 @@ static inline u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address, {SHASH_DESC_ON_STACK (shash, sbi->s_chksum_driver);u32 *ctx = (u32 *)shash_desc_ctx (shash); +u32 retval;int err; shash->tfm = sbi->s_chksum_driver;
@@ -957,7 +958,9 @@ static inline u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address, err =crypto_shash_update (shash, address, length);BUG_ON (err); -return *ctx; + retval = *ctx; +barrier_data (ctx); +return retval; } static inline bool f2fs_crc_valid(struct f2fs_sb_info *sbi, __u32 blk_crc,
fs/hugetlbfs/inode.c +1 -1
@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, addr =ALIGN (addr,huge_page_size (h)); vma =find_vma (mm, addr);if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <=vm_start_gap (vma)))return addr; }
fs/proc/task_mmu.c +0 -4
@@ -299,11 +299,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)/* We don't show the stack guard page in /proc/maps */ start = vma->vm_start; -if (stack_guard_page_start (vma, start)) - start +=PAGE_SIZE ; end = vma->vm_end; -if (stack_guard_page_end (vma, end)) - end -=PAGE_SIZE ;seq_setwidth (m,25 +sizeof (void *) *6 -1 ); seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
fs/read_write.c +1 -1
@@ -1232,7 +1232,7 @@ static size_t compat_writev(struct file *file,if (!(file->f_mode &FMODE_CAN_WRITE )) goto out; - ret =compat_do_readv_writev (WRITE , file, vec, vlen, pos,0 ); + ret =compat_do_readv_writev (WRITE , file, vec, vlen, pos, flags); out:if (ret >0 )
include/linux/mm.h +25 -28
76 lines not on this page · raw message
include/uapi/linux/usb/ch11.h +3 -0
@@ -22,6 +22,9 @@*/ #define USB_MAXCHILDREN 31 +/* See USB 3.1 spec Table 10-5 */ +#define USB_SS_MAXPORTS 15 +/* * Hub request types */
kernel/irq/manage.c +3 -1
@@ -1308,8 +1308,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) ret =__irq_set_trigger (desc, new->flags &IRQF_TRIGGER_MASK ); -if (ret) +if (ret) { +irq_release_resources (desc); goto out_mask; + } } desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
kernel/sched/core.c +1 -1
@@ -5469,7 +5469,7 @@ void idle_task_exit(void)BUG_ON (cpu_online (smp_processor_id ()));if (mm != &init_mm) { -switch_mm_irqs_off (mm, &init_mm, current); +switch_mm (mm, &init_mm, current);finish_arch_post_lock_switch (); }mmdrop (mm);
kernel/time/alarmtimer.c +11 -3
@@ -354,7 +354,7 @@ void alarm_start_relative(struct alarm *alarm, ktime_t start) {struct alarm_base *base = &alarm_bases[alarm->type]; - start =ktime_add (start, base->gettime ()); + start =ktime_add_safe (start, base->gettime ());alarm_start (alarm, start); }EXPORT_SYMBOL_GPL (alarm_start_relative);
@@ -440,7 +440,7 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval) overrun++; } - alarm->node.expires =ktime_add (alarm->node.expires, interval); + alarm->node.expires =ktime_add_safe (alarm->node.expires, interval);return overrun; }EXPORT_SYMBOL_GPL (alarm_forward);
@@ -624,13 +624,21 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,/* start the timer */ timr->it.alarm.interval =timespec_to_ktime (new_setting->it_interval); + +/* +* Rate limit to the tick as a hot fix to prevent DOS. Will be +* mopped up later. +*/ +if (ktime_to_ns (timr->it.alarm.interval) <TICK_NSEC ) + timr->it.alarm.interval =ktime_set (0 ,TICK_NSEC ); + exp =timespec_to_ktime (new_setting->it_value);/* Convert (if necessary) to absolute time */ if (flags !=TIMER_ABSTIME ) {ktime_t now; now = alarm_bases[timr->it.alarm.alarmtimer.type].gettime (); - exp =ktime_add (now, exp); + exp =ktime_add_safe (now, exp); }alarm_start (&timr->it.alarm.alarmtimer, exp);
lib/libcrc32c.c +4 -2
@@ -43,7 +43,7 @@ static struct crypto_shash *tfm;u32 crc32c (u32 crc,const void *address,unsigned int length) {SHASH_DESC_ON_STACK (shash, tfm); -u32 *ctx = (u32 *)shash_desc_ctx (shash); +u32 ret, *ctx = (u32 *)shash_desc_ctx (shash);int err; shash->tfm = tfm;
@@ -53,7 +53,9 @@ u32 crc32c(u32 crc, const void *address, unsigned int length) err =crypto_shash_update (shash, address, length);BUG_ON (err); -return *ctx; + ret = *ctx; +barrier_data (ctx); +return ret; }EXPORT_SYMBOL (crc32c);
mm/gup.c +0 -5
@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,/* mlock all present pages, but do not fault in new pages */ if ((*flags & (FOLL_POPULATE |FOLL_MLOCK )) ==FOLL_MLOCK )return -ENOENT ; -/* For mm_populate(), just skip the stack guard page. */ -if ((*flags &FOLL_POPULATE ) && - (stack_guard_page_start (vma, address) || -stack_guard_page_end (vma, address +PAGE_SIZE ))) -return -ENOENT ;if (*flags &FOLL_WRITE ) fault_flags |=FAULT_FLAG_WRITE ;if (*flags &FOLL_REMOTE )
mm/memory-failure.c +4 -1
@@ -1176,7 +1176,10 @@ int memory_failure(unsigned long pfn, int trapno, int flags)* page_remove_rmap() in try_to_unmap_one(). So to determine page status * correctly, we save a copy of the page flags at this time. */ - page_flags = p->flags; +if (PageHuge (p)) + page_flags = hpage->flags; +else + page_flags = p->flags;/* * unpoison always clear PG_hwpoison inside page lock
mm/memory.c +0 -38
@@ -2699,40 +2699,6 @@ int do_swap_page(struct fault_env *fe, pte_t orig_pte) }/* -* This is like a special single-page "expand_{down|up}wards()", -* except we must first make sure that 'address{-|+}PAGE_SIZE' -* doesn't hit another vma. -*/ -static inline int check_stack_guard_page (struct vm_area_struct *vma,unsigned long address) -{ - address &=PAGE_MASK ; -if ((vma->vm_flags &VM_GROWSDOWN ) && address == vma->vm_start) { -struct vm_area_struct *prev = vma->vm_prev; - -/* -* Is there a mapping abutting this one below? -* -* That's only ok if it's the same stack mapping -* that has gotten split.. -*/ -if (prev && prev->vm_end == address) -return prev->vm_flags &VM_GROWSDOWN ?0 : -ENOMEM ; - -return expand_downwards (vma, address -PAGE_SIZE ); - } -if ((vma->vm_flags &VM_GROWSUP ) && address +PAGE_SIZE == vma->vm_end) { -struct vm_area_struct *next = vma->vm_next; - -/* As VM_GROWSDOWN but s/below/above/ */ -if (next && next->vm_start == address +PAGE_SIZE ) -return next->vm_flags &VM_GROWSUP ?0 : -ENOMEM ; - -return expand_upwards (vma, address +PAGE_SIZE ); - } -return 0 ; -} - -/* * We enter with non-exclusive mmap_sem (to exclude vma changes, * but allow concurrent faults), and pte mapped but not yet locked. * We return with mmap_sem still held, but pte unmapped and unlocked.
@@ -2748,10 +2714,6 @@ static int do_anonymous_page(struct fault_env *fe)if (vma->vm_flags &VM_SHARED )return VM_FAULT_SIGBUS ; -/* Check if we need to add a guard page to the stack */ -if (check_stack_guard_page (vma, fe->address) <0 ) -return VM_FAULT_SIGSEGV ; -/* * Use pte_alloc() instead of pte_alloc_map(). We can't run * pte_offset_map() on pmds where a huge pmd might be created
mm/mmap.c +97 -63
336 lines not on this page · raw message
mm/swap_cgroup.c +3 -0
@@ -48,6 +48,9 @@ static int swap_cgroup_prepare(int type)if (!page) goto not_enough_page; ctrl->map[idx] = page; + +if (!(idx %SWAP_CLUSTER_MAX )) +cond_resched (); }return 0 ; not_enough_page:
net/ipv6/ila/ila_xlat.c +1 -0
@@ -68,6 +68,7 @@ static inline u32 ila_locator_hash(struct ila_locator loc) {u32 *v = (u32 *)loc.v32; +__ila_hash_secret_init ();return jhash_2words (v[0 ], v[1 ], hashrnd); }
net/mac80211/cfg.c +2 -0
@@ -865,6 +865,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,default :return -EINVAL ; } + sdata->u.ap.req_smps = sdata->smps_mode; + sdata->needed_rx_chains = sdata->local->rx_chains;mutex_lock (&local->mtx);
net/mac80211/ibss.c +4 -2
@@ -66,6 +66,8 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,2 + (IEEE80211_MAX_SUPP_RATES -8 ) +2 +sizeof (struct ieee80211_ht_cap ) +2 +sizeof (struct ieee80211_ht_operation ) + +2 +sizeof (struct ieee80211_vht_cap ) + +2 +sizeof (struct ieee80211_vht_operation ) + ifibss->ie_len; presp =kzalloc (sizeof (*presp) + frame_len,GFP_KERNEL );if (!presp)
@@ -487,14 +489,14 @@ int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,struct beacon_data *presp, *old_presp;struct cfg80211_bss *cbss;const struct cfg80211_bss_ies *ies; -u16 capability =0 ; +u16 capability =WLAN_CAPABILITY_IBSS ;u64 tsf;int ret =0 ;sdata_assert_lock (sdata);if (ifibss->privacy) - capability =WLAN_CAPABILITY_PRIVACY ; + capability |=WLAN_CAPABILITY_PRIVACY ; cbss = cfg80211_get_bss(sdata->local->hw.wiphy, ifibss->chandef.chan, ifibss->bssid, ifibss->ssid,
net/mac80211/rx.c +8 -2
@@ -1585,12 +1585,16 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)*/ if (!ieee80211_hw_check (&sta->local->hw,AP_LINK_PS ) && !ieee80211_has_morefrags (hdr->frame_control) && + !ieee80211_is_back_req (hdr->frame_control) && !(status->rx_flags &IEEE80211_RX_DEFERRED_RELEASE ) && (rx->sdata->vif.type ==NL80211_IFTYPE_AP || rx->sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) && -/* PM bit is only checked in frames where it isn't reserved, +/* +* PM bit is only checked in frames where it isn't reserved, * in AP mode it's reserved in non-bufferable management frames * (cf. IEEE 802.11-2012 8.2.4.1.7 Power Management field) +* BAR frames should be ignored as specified in +* IEEE 802.11-2012 10.2.1.2. */ (!ieee80211_is_mgmt (hdr->frame_control) ||ieee80211_is_bufferable_mmpdu (hdr->frame_control))) {
@@ -2467,7 +2471,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)if (is_multicast_ether_addr (hdr->addr1)) { mpp_addr = hdr->addr3; proxied_addr = mesh_hdr->eaddr1; - }else if (mesh_hdr->flags &MESH_FLAGS_AE_A5_A6 ) { + }else if ((mesh_hdr->flags &MESH_FLAGS_AE ) == +MESH_FLAGS_AE_A5_A6 ) {/* has_a4 already checked in ieee80211_rx_mesh_check */ mpp_addr = hdr->addr4; proxied_addr = mesh_hdr->eaddr2;
@@ -3949,6 +3954,7 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, stats->last_rate =sta_stats_encode_rate (status); stats->fragments++; + stats->packets++;if (!(status->flag &RX_FLAG_NO_SIGNAL_VAL )) { stats->last_signal = status->signal;
net/mac80211/sta_info.c +1 -1
@@ -2148,7 +2148,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)struct ieee80211_sta_rx_stats *cpurxs; cpurxs =per_cpu_ptr (sta->pcpu_rx_stats, cpu); - sinfo->rx_packets += cpurxs->dropped; + sinfo->rx_dropped_misc += cpurxs->dropped; } }
net/mac80211/wpa.c +5 -4
@@ -17,6 +17,7 @@#include <asm/unaligned.h> #include <net/mac80211.h> #include <crypto/aes.h> +#include <crypto/algapi.h> #include "ieee80211_i.h" #include "michael.h"
@@ -153,7 +154,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) data_len = skb->len - hdrlen -MICHAEL_MIC_LEN ; key = &rx->key->conf.key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY ];michael_mic (key, hdr, data, data_len, mic); -if (memcmp (mic, data + data_len,MICHAEL_MIC_LEN ) !=0 ) +if (crypto_memneq (mic, data + data_len,MICHAEL_MIC_LEN )) goto mic_fail;/* remove Michael MIC from payload */
@@ -1047,7 +1048,7 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)bip_aad (skb, aad);ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, skb->data +24 , skb->len -24 , mic); -if (memcmp (mic, mmie->mic,sizeof (mmie->mic)) !=0 ) { +if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;return RX_DROP_UNUSABLE ; }
@@ -1097,7 +1098,7 @@ ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx)bip_aad (skb, aad);ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, skb->data +24 , skb->len -24 , mic); -if (memcmp (mic, mmie->mic,sizeof (mmie->mic)) !=0 ) { +if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;return RX_DROP_UNUSABLE ; }
@@ -1201,7 +1202,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx)if (ieee80211_aes_gmac (key->u.aes_gmac.tfm, aad, nonce, skb->data +24 , skb->len -24 , mic) <0 || -memcmp (mic, mmie->mic,sizeof (mmie->mic)) !=0 ) { +crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_gmac.icverrors++;return RX_DROP_UNUSABLE ; }
net/wireless/util.c +6 -4
@@ -454,6 +454,8 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,if (iftype ==NL80211_IFTYPE_MESH_POINT )skb_copy_bits (skb, hdrlen, &mesh_flags,1 ); + mesh_flags &=MESH_FLAGS_AE ; +switch (hdr->frame_control &cpu_to_le16 (IEEE80211_FCTL_TODS |IEEE80211_FCTL_FROMDS )) {case cpu_to_le16 (IEEE80211_FCTL_TODS ):
@@ -469,9 +471,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, iftype != NL80211_IFTYPE_STATION))return -1 ;if (iftype ==NL80211_IFTYPE_MESH_POINT ) { -if (mesh_flags &MESH_FLAGS_AE_A4 ) +if (mesh_flags ==MESH_FLAGS_AE_A4 )return -1 ; -if (mesh_flags &MESH_FLAGS_AE_A5_A6 ) { +if (mesh_flags ==MESH_FLAGS_AE_A5_A6 ) {skb_copy_bits (skb, hdrlen + offsetof(struct ieee80211s_hdr , eaddr1), tmp.h_dest,2 *ETH_ALEN );
@@ -487,9 +489,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, ether_addr_equal(tmp.h_source, addr)))return -1 ;if (iftype ==NL80211_IFTYPE_MESH_POINT ) { -if (mesh_flags &MESH_FLAGS_AE_A5_A6 ) +if (mesh_flags ==MESH_FLAGS_AE_A5_A6 )return -1 ; -if (mesh_flags &MESH_FLAGS_AE_A4 ) +if (mesh_flags ==MESH_FLAGS_AE_A4 )skb_copy_bits (skb, hdrlen + offsetof(struct ieee80211s_hdr , eaddr1), tmp.h_source,ETH_ALEN );