Merge remote-tracking branch 'common/android-4.9-q' into lineage-18.1-caf-sdm845

# By Eric Dumazet (9) and others
# Via Greg Kroah-Hartman
* common/android-4.9-q:
  Linux 4.9.287
  perf/x86: Reset destroy callback on event init failure
  scsi: virtio_scsi: Fix spelling mistake "Unsupport" -> "Unsupported"
  scsi: ses: Fix unsigned comparison with less than zero
  mac80211: Drop frames from invalid MAC address in ad-hoc mode
  netfilter: ip6_tables: zero-initialize fragment offset
  HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS
  gup: document and work around "COW can break either way" issue
  i40e: fix endless loop under rtnl
  rtnetlink: fix if_nlmsg_stats_size() under estimation
  drm/nouveau/debugfs: fix file release memory leak
  netlink: annotate data races around nlk->bound
  net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size()
  ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence
  ptp_pch: Load module automatically if ID matches
  powerpc/fsl/dts: Fix phy-connection-type for fm1mac3
  net_sched: fix NULL deref in fifo_set_limit()
  phy: mdio: fix memory leak
  bpf: Fix integer overflow in prealloc_elems_and_freelist()
  xtensa: call irqchip_init only when CONFIG_USE_OF is selected
  ARM: dts: omap3430-sdp: Fix NAND device node
  nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero
  ovl: fix missing negative dentry check in ovl_rename()
  USB: cdc-acm: fix break reporting
  USB: cdc-acm: fix racy tty buffer accesses
  Partially revert "usb: Kconfig: using select for USB_COMMON dependency"
  Linux 4.9.286
  libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD.
  usb: testusb: Fix for showing the connection speed
  scsi: sd: Free scsi_disk device via put_device()
  ext2: fix sleeping in atomic bugs on error
  sparc64: fix pci_iounmap() when CONFIG_PCI is not set
  xen-netback: correct success/error reporting for the SKB-with-fraglist case
  net: mdio: introduce a shutdown method to mdio device drivers
  af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
  Linux 4.9.285
  cred: allow get_cred() and put_cred() to be given NULL.
  HID: usbhid: free raw_report buffers in usbhid_stop
  netfilter: ipset: Fix oversized kvmalloc() calls
  HID: betop: fix slab-out-of-bounds Write in betop_probe
  arm64: Extend workaround for erratum 1024718 to all versions of Cortex-A55
  ARM: 9098/1: ftrace: MODULE_PLT: Fix build problem without DYNAMIC_FTRACE
  ARM: 9079/1: ftrace: Add MODULE_PLTS support
  ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link()
  ARM: 9077/1: PLT: Move struct plt_entries definition to header
  EDAC/synopsys: Fix wrong value type assignment for edac_mode
  net: udp: annotate data race around udp_sk(sk)->corkflag
  ext4: fix potential infinite loop in ext4_dx_readdir()
  ipack: ipoctal: fix module reference leak
  ipack: ipoctal: fix missing allocation-failure check
  ipack: ipoctal: fix tty-registration error handling
  ipack: ipoctal: fix tty registration race
  ipack: ipoctal: fix stack information leak
  e100: fix buffer overrun in e100_get_regs
  e100: fix length calculation in e100_get_regs_len
  hwmon: (tmp421) fix rounding for negative values
  mac80211: limit injected vht mcs/nss in ieee80211_parse_tx_radiotap
  ipvs: check that ip_vs_conn_tab_bits is between 8 and 20
  mac80211: fix use-after-free in CCMP/GCMP RX
  cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory
  cpufreq: schedutil: Use kobject release() method to free sugov_tunables
  tty: Fix out-of-bound vmalloc access in imageblit
  qnx4: work around gcc false positive warning bug
  arm64: dts: marvell: armada-37xx: Extend PCIe MEM space
  spi: Fix tegra20 build with CONFIG_PM=n
  net: 6pack: Fix tx timeout and slot time
  alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile
  arm64: Mark __stack_chk_guard as __ro_after_init
  parisc: Use absolute_pointer() to define PAGE0
  qnx4: avoid stringop-overread errors
  sparc: avoid stringop-overread errors
  net: i825xx: Use absolute_pointer for memcpy from fixed memory location
  compiler.h: Introduce absolute_pointer macro
  m68k: Double cast io functions to unsigned long
  net: stmmac: allow CSR clock of 300MHz
  blktrace: Fix uaf in blk_trace access after removing by sysfs
  scsi: iscsi: Adjust iface sysfs attr detection
  net/mlx4_en: Don't allow aRFS for encapsulated packets
  net: hso: fix muxed tty registration
  serial: mvebu-uart: fix driver's tx_empty callback
  mcb: fix error handling in mcb_alloc_bus()
  USB: serial: option: add device id for Foxconn T99W265
  USB: serial: option: remove duplicate USB device ID
  USB: serial: option: add Telit LN920 compositions
  USB: serial: mos7840: remove duplicated 0xac24 device ID
  staging: greybus: uart: fix tty use after free
  USB: serial: cp210x: add ID for GW Instek GDM-834x Digital Multimeter
  usb-storage: Add quirk for ScanLogic SL11R-IDE older than 2.6c
  xen/x86: fix PV trap handling on secondary processors
  cifs: fix incorrect check for null pointer in header_assemble
  usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned()
  usb: gadget: r8a66597: fix a loop in set_feature()
  ocfs2: drop acl cache for directories too
  BACKPORT: loop: Set correct device size when using LOOP_CONFIGURE
  Linux 4.9.284
  sctp: validate from_addr_param return
  drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV
  blk-throttle: fix UAF by deleteing timer in blk_throtl_exit()
  nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group
  nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group
  nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group
  nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group
  nilfs2: fix NULL pointer in nilfs_##name##_attr_release
  nilfs2: fix memory leak in nilfs_sysfs_create_device_group
  ceph: lockdep annotations for try_nonblocking_invalidate
  dmaengine: xilinx_dma: Set DMA mask for coherent APIs
  dmaengine: ioat: depends on !UML
  parisc: Move pci_dev_is_behind_card_dino to where it is used
  pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered
  profiling: fix shift-out-of-bounds bugs
  prctl: allow to setup brk for et_dyn executables
  9p/trans_virtio: Remove sysfs file on probe failure
  thermal/drivers/exynos: Fix an error code in exynos_tmu_probe()
  dmaengine: acpi: Avoid comparison GSI with Linux vIRQ
  sctp: add param size validation for SCTP_PARAM_SET_PRIMARY
  sctp: validate chunk size in __rcv_asconf_lookup
  staging: android: ion: fix page is NULL
  crypto: talitos - fix max key size for sha384 and sha512
  PM / wakeirq: Fix unbalanced IRQ enable for wakeirq
  s390/bpf: Fix optimizing out zero-extensions
  Linux 4.9.283
  s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant
  net: renesas: sh_eth: Fix freeing wrong tx descriptor
  qlcnic: Remove redundant unlock in qlcnic_pinit_from_rom
  net: dsa: b53: Fix calculating number of switch ports
  ARC: export clear_user_page() for modules
  mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()'
  PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n
  ethtool: Fix an error code in cxgb2.c
  net: usb: cdc_mbim: avoid altsetting toggling for Telit LN920
  mfd: Don't use irq_create_mapping() to resolve a mapping
  dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation
  x86/mm: Fix kern_addr_valid() to cope with existing but not present entries
  tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()
  net/af_unix: fix a data-race in unix_dgram_poll
  events: Reuse value read using READ_ONCE instead of re-reading it
  tipc: increase timeout in tipc_sk_enqueue()
  r6040: Restore MDIO clock frequency after MAC reset
  net/l2tp: Fix reference count leak in l2tp_udp_recv_core
  dccp: don't duplicate ccid when cloning dccp sock
  ptp: dp83640: don't define PAGE0
  net-caif: avoid user-triggerable WARN_ON(1)
  bnx2x: Fix enabling network interfaces without VFs
  xen: reset legacy rtc flag for PV domU
  platform/chrome: cros_ec_proto: Send command again when timeout occurs
  memcg: enable accounting for pids in nested pid namespaces
  mm/hugetlb: initialize hugetlb_usage in mm_init
  scsi: BusLogic: Fix missing pr_cont() use
  parisc: fix crash with signals and alloca
  net: w5100: check return value after calling platform_get_resource()
  net: fix NULL pointer reference in cipso_v4_doi_free
  ath9k: fix sleeping in atomic context
  ath9k: fix OOB read ar9300_eeprom_restore_internal
  parport: remove non-zero check on count
  usbip: give back URBs for unsent unlink requests during cleanup
  Revert "USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set"
  cifs: fix wrong release in sess_alloc_buffer() failed path
  mmc: rtsx_pci: Fix long reads when clock is prescaled
  gfs2: Don't call dlm after protocol is unmounted
  rpc: fix gss_svc_init cleanup on failure
  ARM: tegra: tamonten: Fix UART pad setting
  gpu: drm: amd: amdgpu: amdgpu_i2c: fix possible uninitialized-variable access in amdgpu_i2c_router_select_ddc_port()
  Bluetooth: avoid circular locks in sco_sock_connect
  net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe()
  ASoC: Intel: bytcr_rt5640: Move "Platform Clock" routes to the maps for the matching in-/output
  Bluetooth: skip invalid hci_sync_conn_complete_evt
  ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init()
  staging: ks7010: Fix the initialization of the 'sleep_status' structure
  serial: 8250_pci: make setup_port() parameters explicitly unsigned
  hvsi: don't panic on tty_register_driver failure
  xtensa: ISS: don't panic in rs_init
  serial: 8250: Define RX trigger levels for OxSemi 950 devices
  s390/jump_label: print real address in a case of a jump label bug
  flow_dissector: Fix out-of-bounds warnings
  ipv4: ip_output.c: Fix out-of-bounds warning in ip_copy_addrs()
  video: fbdev: riva: Error out if 'pixclock' equals zero
  video: fbdev: kyro: Error out if 'pixclock' equals zero
  video: fbdev: asiliantfb: Error out if 'pixclock' equals zero
  bpf/tests: Do not PASS tests without actually testing the result
  bpf/tests: Fix copy-and-paste error in double word test
  tty: serial: jsm: hold port lock when reporting modem line changes
  staging: board: Fix uninitialized spinlock when attaching genpd
  usb: gadget: composite: Allow bMaxPower=0 if self-powered
  usb: gadget: u_ether: fix a potential null pointer dereference
  usb: host: fotg210: fix the actual_length of an iso packet
  usb: host: fotg210: fix the endpoint's transactional opportunities calculation
  Smack: Fix wrong semantics in smk_access_entry()
  netlink: Deal with ESRCH error in nlmsg_notify()
  video: fbdev: kyro: fix a DoS bug by restricting user input
  iio: dac: ad5624r: Fix incorrect handling of an optional regulator.
  PCI: Use pci_update_current_state() in pci_enable_device_flags()
  crypto: mxs-dcp - Use sg_mapping_iter to copy data
  MIPS: Malta: fix alignment of the devicetree buffer
  pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry()
  openrisc: don't printk() unconditionally
  vfio: Use config not menuconfig for VFIO_NOIOMMU
  PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure
  PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported
  ARM: 9105/1: atags_to_fdt: don't warn about stack size
  libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs
  media: rc-loopback: return number of emitters rather than error
  media: uvc: don't do DMA on stack
  VMCI: fix NULL pointer dereference when unmapping queue pair
  power: supply: max17042: handle fails of reading status register
  crypto: public_key: fix overflow during implicit conversion
  xen: fix setting of max_pfn in shared_info
  powerpc/perf/hv-gpci: Fix counter value parsing
  PCI/MSI: Skip masking MSI-X on Xen PV
  rtc: tps65910: Correct driver module alias
  fbmem: don't allow too huge resolutions
  clk: kirkwood: Fix a clocking boot regression
  IMA: remove -Wmissing-prototypes warning
  KVM: x86: Update vCPU's hv_clock before back to guest when tsc_offset is adjusted
  tty: Fix data race between tiocsti() and flush_to_ldisc()
  ipv4: make exception cache less predictible
  bcma: Fix memory leak for internally-handled cores
  ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()
  usb: ehci-orion: Handle errors of clk_prepare_enable() in probe
  i2c: mt65xx: fix IRQ check
  CIFS: Fix a potencially linear read overflow
  mmc: moxart: Fix issue with uninitialized dma_slave_config
  mmc: dw_mmc: Fix issue with uninitialized dma_slave_config
  i2c: s3c2410: fix IRQ check
  i2c: iop3xx: fix deferred probing
  Bluetooth: add timeout sanity check to hci_inquiry
  usb: gadget: mv_u3d: request_irq() after initializing UDC
  usb: phy: tahvo: add IRQ check
  usb: host: ohci-tmio: add IRQ check
  Bluetooth: Move shutdown callback before flushing tx and rx queue
  usb: phy: twl6030: add IRQ checks
  usb: phy: fsl-usb: add IRQ check
  usb: gadget: udc: at91: add IRQ check
  drm/msm/dsi: Fix some reference counted resource leaks
  Bluetooth: fix repeated calls to sco_sock_kill
  arm64: dts: exynos: correct GIC CPU interfaces address range on Exynos7
  Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow
  soc: qcom: smsm: Fix missed interrupts if state changes while masked
  PCI: PM: Enable PME if it can be signaled from D3cold
  i2c: highlander: add IRQ check
  net: cipso: fix warnings in netlbl_cipsov4_add_std
  tcp: seq_file: Avoid skipping sk during tcp_seek_last_pos
  Bluetooth: sco: prevent information leak in sco_conn_defer_accept()
  media: go7007: remove redundant initialization
  media: dvb-usb: fix uninit-value in vp702x_read_mac_addr
  media: dvb-usb: fix uninit-value in dvb_usb_adapter_dvb_init
  certs: Trigger creation of RSA module signing key if it's not an RSA key
  crypto: qat - use proper type for vf_mask
  spi: spi-pic32: Fix issue with uninitialized dma_slave_config
  m68k: emu: Fix invalid free in nfeth_cleanup()
  udf_get_extendedattr() had no boundary checks.
  crypto: qat - do not export adf_iov_putmsg()
  crypto: qat - fix naming for init/shutdown VF to PF notifications
  crypto: qat - fix reuse of completion variable
  crypto: qat - handle both source of interrupt in VF ISR
  crypto: qat - do not ignore errors from enable_vf2pf_comms()
  libata: fix ata_host_start()
  power: supply: max17042_battery: fix typo in MAx17042_TOFF
  udf: Check LVID earlier
  crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop()
  power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors
  crypto: mxs-dcp - Check for DMA mapping errors
  regmap: fix the offset of register error log
  PCI: Call Max Payload Size-related fixup quirks early
  x86/reboot: Limit Dell Optiplex 990 quirk to early BIOS versions
  Revert "btrfs: compression: don't try to compress if we don't have enough pages"
  mm/page_alloc: speed up the iteration of max_order
  net: ll_temac: Remove left-over debug message
  powerpc/boot: Delete unneeded .globl _zimage_start
  powerpc/module64: Fix comment in R_PPC64_ENTRY handling
  crypto: talitos - reduce max key size for SEC1
  mm/kmemleak.c: make cond_resched() rate-limiting more efficient
  s390/disassembler: correct disassembly lines alignment
  ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)
  gfs2: Don't clear SGID when inheriting ACLs
  nvme-pci: Fix an error handling path in 'nvme_probe()'
  tc358743: fix register i2c_rd/wr function fix
  PM / wakeirq: Enable dedicated wakeirq for suspend
  net/sched: cls_flower: Use mask for addr_type
  USB: serial: mos7720: improve OOM-handling in read_mos_reg()
  usb: phy: isp1301: Fix build warning when CONFIG_OF is disabled
  igmp: Add ip_mc_list lock in ip_check_mc_rcu
  media: stkwebcam: fix memory leak in stk_camera_probe
  ath9k: Postpone key cache entry deletion for TXQ frames reference it
  ath: Modify ath_key_delete() to not need full key entry
  ath: Export ath_hw_keysetmac()
  ath9k: Clear key cache explicitly on disabling hardware
  ath: Use safer key clearing with key cache entries
  ALSA: pcm: fix divide error in snd_pcm_lib_ioctl
  ARM: 8918/2: only build return_address() if needed
  cryptoloop: add a deprecation warning
  perf/x86/amd/ibs: Work around erratum #1197
  qede: Fix memset corruption
  qed: Fix the VF msix vectors flow
  xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG
  mtd: nand: atmel_nand: remove build warning in atmel_nand_remove()
  ext4: fix race writing to an inline_data file while its xattrs are changing

 Conflicts:
	arch/arm64/mm/proc.S
	drivers/staging/android/ion/ion_system_heap.c
	fs/gfs2/acl.c
	kernel/sched/cpufreq_schedutil.c

Change-Id: I4f527f0ca32f1649fdb0fba22be08a0dfaeabfa2