Commit graph

607993 commits

Author SHA1 Message Date
Linux Build Service Account
078396ec4c Merge "Merge android-4.4-p.196 (736005d) into msm-4.4" 2019-11-05 08:04:23 -08:00
Linux Build Service Account
c4920ff327 Merge "defconfig: Enable serial for msm8996-perf" 2019-11-05 08:04:22 -08:00
Linux Build Service Account
d847b96c75 Merge "drm/msm/hdmi-staging: Fix Buffer Overflow" 2019-11-05 08:04:21 -08:00
Gustavo Solaira
e3e04ee170 defconfig: Enable serial for msm8996-perf
Enable serial support for msm8996-perf.

Change-Id: I4935e3df060a7564158b7c4be06ca1643ca4fd50
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2019-10-30 13:50:49 -07:00
Srinivasarao P
bc046dc1dd Merge android-4.4-p.196 (736005d) into msm-4.4
* refs/heads/tmp-736005d
  Linux 4.4.196
  NFC: fix attrs checks in netlink interface
  smack: use GFP_NOFS while holding inode_smack::smk_lock
  Smack: Don't ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set
  sch_cbq: validate TCA_CBQ_WRROPT to avoid crash
  net/rds: Fix error handling in rds_ib_add_one()
  xen-netfront: do not use ~0U as error return value for xennet_fill_frags()
  sch_dsmark: fix potential NULL deref in dsmark_init()
  nfc: fix memory leak in llcp_sock_bind()
  net: qlogic: Fix memory leak in ql_alloc_large_buffers
  net: ipv4: avoid mixed n_redirects and rate_tokens usage
  ipv6: drop incoming packets having a v4mapped source address
  hso: fix NULL-deref on tty open
  ANDROID: binder: synchronize_rcu() when using POLLFREE.
  ANDROID: binder: remove waitqueue when thread exits.
  kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
  ocfs2: wait for recovering done after direct unlock request
  hypfs: Fix error number left in struct pointer member
  fat: work around race with userspace's read via blockdev while mounting
  security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb()
  HID: apple: Fix stuck function keys when using FN
  ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
  mfd: intel-lpss: Remove D3cold delay
  scsi: core: Reduce memory required for SCSI logging
  powerpc/pseries: correctly track irq state in default idle
  powerpc/64s/exception: machine check use correct cfar for late handler
  vfio_pci: Restore original state on release
  pinctrl: tegra: Fix write barrier placement in pmx_writel
  powerpc/pseries/mobility: use cond_resched when updating device tree
  powerpc/futex: Fix warning: 'oldval' may be used uninitialized in this function
  powerpc/rtas: use device model APIs and serialization during LPM
  clk: sirf: Don't reference clk_init_data after registration
  clk: qoriq: Fix -Wunused-const-variable
  ipmi_si: Only schedule continuously in the thread in maintenance mode
  gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()
  video: ssd1307fb: Start page range at page_offset

Change-Id: If2b47b65954e56510e7a8b963a7110ebc9a4f1cc
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-10-30 16:36:42 +05:30
Srinivasarao P
ae145f3c29 Merge android-4.4-p.195 (4af3204) into msm-4.4
* refs/heads/tmp-4af3204
  Linux 4.4.195
  Btrfs: fix race setting up and completing qgroup rescan workers
  btrfs: Relinquish CPUs in btrfs_compare_trees
  Btrfs: fix use-after-free when using the tree modification log
  ovl: filter of trusted xattr results in audit
  CIFS: Fix oplock handling for SMB 2.1+ protocols
  i2c: riic: Clear NACK in tend isr
  hwrng: core - don't wait on add_early_randomness()
  quota: fix wrong condition in is_quota_modification()
  ext4: fix punch hole for inline_data file systems
  /dev/mem: Bail out upon SIGKILL.
  cfg80211: Purge frame registrations on iftype change
  md/raid6: Set R5_ReadError when there is read failure on parity disk
  alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP
  ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up
  ASoC: Intel: Fix use of potentially uninitialized variable
  media: sn9c20x: Add MSI MS-1039 laptop to flip_dmi_table
  KVM: x86: Manually calculate reserved bits when loading PDPTRS
  KVM: x86: set ctxt->have_exception in x86_decode_insn()
  KVM: x86: always stop emulation on page fault
  parisc: Disable HP HSC-PCI Cards to prevent kernel crash
  fuse: fix missing unlock_page in fuse_writepage()
  printk: Do not lose last line in kmsg buffer dump
  ALSA: firewire-tascam: check intermediate state of clock status and retry
  ALSA: firewire-tascam: handle error code when getting current source of clock
  media: omap3isp: Set device on omap3isp subdevs
  btrfs: extent-tree: Make sure we only allocate extents from block groups with the same type
  ALSA: hda/realtek - Blacklist PC beep for Lenovo ThinkCentre M73/93
  media: ttusb-dec: Fix info-leak in ttusb_dec_send_command()
  libertas: Add missing sentinel at end of if_usb.c fw_table
  mmc: sdhci: Fix incorrect switch to HS mode
  ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set
  kprobes: Prohibit probing on BUG() and WARN() address
  dmaengine: ti: edma: Do not reset reserved paRAM slots
  md/raid1: fail run raid1 array when active disk less than one
  hwmon: (acpi_power_meter) Change log level for 'unsafe software power cap'
  ACPI: custom_method: fix memory leaks
  libtraceevent: Change users plugin directory
  ACPI / CPPC: do not require the _PSD method
  media: ov9650: add a sanity check
  media: saa7134: fix terminology around saa7134_i2c_eeprom_md7134_gate()
  media: cpia2_usb: fix memory leaks
  media: saa7146: add cleanup in hexium_attach()
  media: hdpvr: add terminating 0 at end of string
  media: radio/si470x: kill urb on error
  net: lpc-enet: fix printk format strings
  media: omap3isp: Don't set streaming state on random subdevs
  dmaengine: iop-adma: use correct printk format strings
  media: gspca: zero usb_buf on error
  efi: cper: print AER info of PCIe fatal error
  md: don't set In_sync if array is frozen
  md: don't call spare_active in md_reap_sync_thread if all member devices can't work
  ia64:unwind: fix double free for mod->arch.init_unw_table
  ALSA: usb-audio: Skip bSynchAddress endpoint check if it is invalid
  base: soc: Export soc_device_register/unregister APIs
  media: iguanair: add sanity checks
  ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls()
  ALSA: hda - Show the fatal CORB/RIRB error more clearly
  x86/apic: Soft disable APIC before initializing it
  x86/reboot: Always use NMI fallback when shutdown via reboot vector IPI fails
  sched/core: Fix CPU controller for !RT_GROUP_SCHED
  sched/fair: Fix imbalance due to CPU affinity
  media: hdpvr: Add device num check and handling
  media: dib0700: fix link error for dibx000_i2c_set_speed
  leds: leds-lp5562 allow firmware files up to the maximum length
  dmaengine: bcm2835: Print error in case setting DMA mask fails
  ASoC: sgtl5000: Fix charge pump source assignment
  ALSA: hda: Flush interrupts on disabling
  nfc: enforce CAP_NET_RAW for raw sockets
  ieee802154: enforce CAP_NET_RAW for raw sockets
  ax25: enforce CAP_NET_RAW for raw sockets
  appletalk: enforce CAP_NET_RAW for raw sockets
  mISDN: enforce CAP_NET_RAW for raw sockets
  usbnet: sanity checking of packet sizes and device mtu
  usbnet: ignore endpoints with invalid wMaxPacketSize
  skge: fix checksum byte order
  sch_netem: fix a divide by zero in tabledist()
  openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC
  net/phy: fix DP83865 10 Mbps HDX loopback disable function
  cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize
  arcnet: provide a buffer big enough to actually receive packets
  Bluetooth: btrtl: Additional Realtek 8822CE Bluetooth devices
  drm: Flush output polling on shutdown
  f2fs: fix to do sanity check on segment bitmap of LFS curseg
  Revert "f2fs: avoid out-of-range memory access"
  f2fs: check all the data segments against all node ones
  irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices
  locking/lockdep: Add debug_locks check in __lock_downgrade()
  mac80211: handle deauthentication/disassociation from TDLS peer
  mac80211: Print text for disassociation reason
  ALSA: hda - Add laptop imic fixup for ASUS M9V laptop
  ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt()
  net: rds: Fix NULL ptr use in rds_tcp_kill_sock
  crypto: talitos - fix missing break in switch statement
  mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword()
  HID: hidraw: Fix invalid read in hidraw_ioctl
  HID: logitech: Fix general protection fault caused by Logitech driver
  HID: lg: make transfer buffers DMA capable
  HID: prodikeys: Fix general protection fault during probe
  Revert "Bluetooth: validate BLE connection interval updates"
  ANDROID: usb: gadget: Fix dependency for f_accessory
  Remove taskname from lowmemorykiller kill reports
  ANDROID: Fixes to locking around handle_lmk_event

Conflicts:
	drivers/staging/android/lowmemorykiller.c
	fs/f2fs/segment.c
	fs/f2fs/super.c

Change-Id: Id4b74ec2b0512aa13bc4392d61d5092f633fed0e
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-10-30 16:27:01 +05:30
Linux Build Service Account
95001d5135 Merge "Merge android-4.4-p.194 (2b29211) into msm-4.4" 2019-10-30 03:07:23 -07:00
Gerrit - the friendly Code Review server
337dc993cc Merge changes into msm-4.4 2019-10-29 09:15:20 -07:00
Linux Build Service Account
d092d362dd Merge "msm: kgsl: Check user generated timestamp before queuing drawobjs" 2019-10-29 03:06:38 -07:00
Linux Build Service Account
ae5acb1279 Merge "soc: msm-pcm: Add mutex lock to protect prvt data" 2019-10-27 22:38:11 -07:00
Linux Build Service Account
33f3e0360f Merge "cnss2: Expose PCIe window register lock related APIs" 2019-10-25 12:46:37 -07:00
Linux Build Service Account
b634cc178c Merge "HID: core: add usage_page_preceding flag for hid_concatenate_usage_page()" 2019-10-25 01:08:58 -07:00
Linux Build Service Account
eaf1260ced Merge "HID: core: move Usage Page concatenation to Main item" 2019-10-25 01:08:57 -07:00
Rahul Sharma
13d43fca0c drm/msm/hdmi-staging: Fix Buffer Overflow
This change is done to check the size of input before doing the
buffer copy.

Change-Id: I01f8b1f3c3b6e920f186f5f90ea9707bb25bcbbc
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2019-10-25 13:06:30 +05:30
Linux Build Service Account
fc509761a1 Merge "asoc: msm-pcm: Added lock in controls _put() and _get() callback" 2019-10-24 05:19:54 -07:00
Linux Build Service Account
9fe357b99e Merge "adreno_tz: Correct acc_relative_busy calculation" 2019-10-24 05:19:53 -07:00
Linux Build Service Account
d69c48ba9f Merge "asoc: msm-routing: Fix array out of bounds issue" 2019-10-24 05:19:53 -07:00
Linux Build Service Account
26e794c1c0 Merge "msm: adsprpc: Fix integer overflow in refcount of map" 2019-10-24 05:19:51 -07:00
Soumya Managoli
42ffbf03ec soc: msm-pcm: Add mutex lock to protect prvt data
Add mutex lock to protect private data in _put() and
get() calls.

Change-Id: I92f5a6515b6d1c4ad650a7dcf22a0a231a84dd30
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-24 16:18:27 +05:30
Soumya Managoli
1c9afab264 asoc: msm-pcm: Added lock in controls _put() and _get()
callback

There is race condition around private data used in put() and get()
of few mixer ctls with close() callback. Added global mutex lock and
code changes to protect such critical section by accessing such lock.

Change-Id: I276c2a234cfcbef88b4272b945e5c3f121e8eb32
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-24 14:52:10 +05:30
Linux Build Service Account
62e3c60264 Merge "qseecom : Clear client handle after unmap the resources" 2019-10-23 18:55:42 -07:00
Linux Build Service Account
b0929d3d6b Merge "soc: qcom: Reorganize PIL code for reclaiming MSS mem during SSR" 2019-10-23 18:55:41 -07:00
Harshitha Sai Neelati
04024ee164 adreno_tz: Correct acc_relative_busy calculation
Current acc_relative_busy calculation is causing integer overflow
in 32 bit system. "stats->busy_time * stats->current_frequency"
results in a value which is beyond the 32 bit range.

Typecasting the value to u64 to avoid overflow.

Change-Id: Id97da02bef608787ceb7c9751bbfc203af56deb1
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-10-23 17:21:16 +05:30
Archana Sriram
2af9b2a1e8 msm: kgsl: Check user generated timestamp before queuing drawobjs
In ioctls like kgsl_ioctl_submit_commands(), if both syncobj
type and cmd/marker/sparseobj type are submitted, the syncobj
is queued first followed by the other obj type. After syncobj
is successfully queued, in case of failure in get_timestamp
while queuing the other obj, both the command objs are
destroyed. As sync obj is already queued, accessing this
later would cause a crash.

Compare the user generated timestamp with the drawctxt
timestamp and return early in case of error. This avoids
unnecessary queuing of drawobjs.

Change-Id: I336c95c42ab1075d7653cba02772f92c918c884c
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-10-23 11:35:14 +05:30
Yue Ma
5ff3c8e366 cnss2: Expose PCIe window register lock related APIs
The register window needs to be configed properly before accessing
any larger than 4K range PCIe registers. Expose the lock to WLAN
driver to avoid race condition when both drivers try to config it.

Change-Id: I94ccd963d4fd0a9715330d2e5733346ccd993ae1
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2019-10-22 12:18:15 -07:00
jitendrathakare
c5ca3ffaa4 qseecom : Clear client handle after unmap the resources
When unloading the app, reset all client members to NULL
to protect from accessing the memory after being freed.

Change-Id: I573b9c6fde03539522d2b04724a2246660c62518
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
2019-10-22 03:46:39 -07:00
Srinivasarao P
520bc0d2f2 Merge android-4.4-p.194 (2b29211) into msm-4.4
* refs/heads/tmp-2b29211
  Revert "ANDROID: regression introduced override_creds=off"
  ANDROID: regression introduced override_creds=off
  Fix fallout from changes to bootparam_utils.h
  ANDROID: sched: Disallow WALT with CFS bandwidth control
  ANDROID: fiq_debugger: remove
  ANDROID: arm64: fix leftover RWX when using CONFIG_UNMAP_KERNEL_AT_EL0
  ANDROID: fix kernelci build-break in lowmemorykiller
  ANDROID: Avoid taking multiple locks in handle_lmk_event
  UPSTREAM: net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
  ANDROID: fix binder change in merge of 4.4.183
  Fix overlayfs build break
  binder: binder: fix possible UAF when freeing buffer
  ANDROID: Revert "f2fs: avoid out-of-range memory access"
  ANDROID: overlayfs: Fix a regression in commit b24be4acd
  ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish
  ANDROID: xfrm: remove in_compat_syscall() checks
  BACKPORT: binder: Set end of SG buffer area properly.
  UPSTREAM: binder: check for overflow when alloc for security context
  BACKPORT: binder: fix race between munmap() and direct reclaim
  ANDROID: cuttlefish 4.4: enable CONFIG_CRYPTO_AES_NI_INTEL=y
  ANDROID: cuttlefish_defconfig: Disable DEVTMPFS
  ANDROID: cuttlefish_defconfig: Enable CONFIG_CPUSETS and CONFIG_CGROUP_SCHEDTUNE
  ANDROID: cuttlefish_defconfig: Drop dead CRYPTO options
  UPSTREAM: virtio: new feature to detect IOMMU device quirk
  UPSTREAM: vring: Use the DMA API on Xen
  UPSTREAM: virtio_ring: Support DMA APIs
  UPSTREAM: vring: Introduce vring_use_dma_api()
  ANDROID: cuttlefish_defconfig: L2TP/PPTP to OLAC/OPNS
  ANDROID: cuttlefish_defconfig: Enable DEBUG_SET_MODULE_RONX
  ANDROID: Fix cuttlefish redundant vsock connection.
  ANDROID: cuttlefish_defconfig: Enable CONFIG_RTC_HCTOSYS
  ANDROID: Move from clang r349610 to r353983c.
  Make arm64 serial port config compatible with crosvm
  UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED
  ANDROID: cuttlefish_defconfig: Add support for AC97 audio
  ANDROID: Move from clang r346389b to r349610.
  ANDROID: cuttlefish_defconfig: Enable vsock options
  UPSTREAM: vhost/vsock: fix reset orphans race with close timeout
  UPSTREAM: vhost/vsock: fix use-after-free in network stack callers
  UPSTREAM: vhost: correctly check the iova range when waking virtqueue
  UPSTREAM: vhost: synchronize IOTLB message with dev cleanup
  UPSTREAM: vhost: fix info leak due to uninitialized memory
  UPSTREAM: vhost: fix vhost_vq_access_ok() log check
  UPSTREAM: vhost: validate log when IOTLB is enabled
  UPSTREAM: vhost_net: add missing lock nesting notation
  UPSTREAM: vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
  UPSTREAM: vhost/vsock: fix uninitialized vhost_vsock->guest_cid
  UPSTREAM: vhost_net: correctly check tx avail during rx busy polling
  UPSTREAM: vsock: use new wait API for vsock_stream_sendmsg()
  UPSTREAM: vsock: cancel packets when failing to connect
  UPSTREAM: vhost-vsock: add pkt cancel capability
  UPSTREAM: vsock: track pkt owner vsock
  UPSTREAM: vhost: fix initialization for vq->is_le
  UPSTREAM: vhost/vsock: handle vhost_vq_init_access() error
  UPSTREAM: vsock: lookup and setup guest_cid inside vhost_vsock_lock
  UPSTREAM: vhost-vsock: fix orphan connection reset
  UPSTREAM: vsock/virtio: fix src/dst cid format
  UPSTREAM: VSOCK: Don't dec ack backlog twice for rejected connections
  UPSTREAM: vhost/vsock: drop space available check for TX vq
  UPSTREAM: virtio-vsock: fix include guard typo
  UPSTREAM: vhost/vsock: fix vhost virtio_vsock_pkt use-after-free
  UPSTREAM: VSOCK: Use kvfree()
  BACKPORT: vhost: split out vringh Kconfig
  UPSTREAM: vhost: drop vringh dependency
  UPSTREAM: vhost: drop vringh dependency
  UPSTREAM: vhost: detect 32 bit integer wrap around
  UPSTREAM: VSOCK: Add Makefile and Kconfig
  UPSTREAM: VSOCK: Introduce vhost_vsock.ko
  UPSTREAM: VSOCK: Introduce virtio_transport.ko
  BACKPORT: VSOCK: Introduce virtio_vsock_common.ko
  UPSTREAM: VSOCK: defer sock removal to transports
  UPSTREAM: VSOCK: transport-specific vsock_transport functions
  UPSTREAM: vsock: make listener child lock ordering explicit
  UPSTREAM: vhost: new device IOTLB API
  BACKPORT: vhost: convert pre sorted vhost memory array to interval tree
  UPSTREAM: vhost: introduce vhost memory accessors
  UPSTREAM: vhost_net: stop polling socket during rx processing
  UPSTREAM: VSOCK: constify vsock_transport structure
  UPSTREAM: vhost: lockless enqueuing
  UPSTREAM: vhost: simplify work flushing
  UPSTREAM: VSOCK: Only check error on skb_recv_datagram when skb is NULL
  BACKPORT: AF_VSOCK: Shrink the area influenced by prepare_to_wait
  UPSTREAM: vhost_net: basic polling support
  UPSTREAM: vhost: introduce vhost_vq_avail_empty()
  UPSTREAM: vhost: introduce vhost_has_work()
  UPSTREAM: vhost: rename vhost_init_used()
  UPSTREAM: vhost: rename cross-endian helpers
  UPSTREAM: vhost: fix error path in vhost_init_used()
  UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly
  UPSTREAM: net: move napi_hash[] into read mostly section
  ANDROID: cuttlefish_defconfig: Enable VIRTIO_INPUT
  ANDROID: cuttlefish_defconfig: Enable VIRT_WIFI
  FROMGIT, BACKPORT: mac80211-next: rtnetlink wifi simulation device
  ANDROID: Move from clang r328903 to r346389b.
  ANDROID: arm64 defconfig / build config for cuttlefish
  ANDROID: Communicates LMK events to userland where they can be logged
  Fix merge issue with 4.4.178
  Fix merge issue with 4.4.177
  FROMGIT: binder: create node flag to request sender's security context
  ion: Disable ION_HEAP_TYPE_SYSTEM_CONTIG
  ANDROID: uid_sys_stats: Copy task_struct comm field to bigger buffer
  UPSTREAM: binder: fix race that allows malicious free of live buffer
  Makefile: Tidy up 4.4.165 merge
  ANDROID: sdcardfs: Change current->fs under lock
  ANDROID: sdcardfs: Don't use OVERRIDE_CRED macro
  arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW
  ANDROID: arm64: mm: fix 4.4.154 merge
  Fix backport of "tcp: detect malicious patterns in tcp_collapse_ofo_queue()"
  tcp: detect malicious patterns in tcp_collapse_ofo_queue()
  tcp: avoid collapses in tcp_prune_queue() if possible

Conflicts:
	Makefile
	arch/arm64/configs/cuttlefish_defconfig
	arch/arm64/include/asm/cpufeature.h
	arch/x86/configs/x86_64_cuttlefish_defconfig
	arch/x86/include/asm/uaccess_32.h
	drivers/net/wireless/virt_wifi.c
	drivers/staging/android/lowmemorykiller.c
	fs/f2fs/checkpoint.c
	fs/f2fs/data.c
	fs/f2fs/dir.c
	fs/f2fs/f2fs.h
	fs/f2fs/file.c
	fs/f2fs/inline.c
	fs/f2fs/inode.c
	fs/f2fs/node.c
	fs/f2fs/recovery.c
	fs/f2fs/segment.c
	fs/f2fs/segment.h
	fs/f2fs/super.c
	fs/squashfs/block.c
	include/linux/f2fs_fs.h
	include/linux/msm_mdp.h
	include/uapi/linux/android/binder.h
	include/uapi/linux/virtio_ids.h
	kernel/cpu.c

Change-Id: I3d8da865a81161d356b11f84344c27e172c3add3
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-10-22 11:47:49 +05:30
Linux Build Service Account
dd4645c977 Merge "msm: ekms: Remove the wait for completion of eDRM probe" 2019-10-21 00:16:55 -07:00
Candle Sun
8ba522499f HID: core: add usage_page_preceding flag for hid_concatenate_usage_page()
Upstream commit 58e75155009c ("HID: core: move Usage Page concatenation
to Main item") adds support for Usage Page item following Usage items
(such as keyboards manufactured by Primax).

Usage Page concatenation in Main item works well for following report
descriptor patterns:

    USAGE_PAGE (Keyboard)                   05 07
    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    INPUT (Data,Var,Abs)                    81 02

-------------

    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    USAGE_PAGE (Keyboard)                   05 07
    INPUT (Data,Var,Abs)                    81 02

But it makes the parser act wrong for the following report
descriptor pattern(such as some Gamepads):

    USAGE_PAGE (Button)                     05 09
    USAGE (Button 1)                        09 01
    USAGE (Button 2)                        09 02
    USAGE (Button 4)                        09 04
    USAGE (Button 5)                        09 05
    USAGE (Button 7)                        09 07
    USAGE (Button 8)                        09 08
    USAGE (Button 14)                       09 0E
    USAGE (Button 15)                       09 0F
    USAGE (Button 13)                       09 0D
    USAGE_PAGE (Consumer Devices)           05 0C
    USAGE (Back)                            0a 24 02
    USAGE (HomePage)                        0a 23 02
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (11)                       95 0B
    INPUT (Data,Var,Abs)                    81 02

With Usage Page concatenation in Main item, parser recognizes all the
11 Usages as consumer keys, it is not the HID device's real intention.

This patch adds usage_page_preceding flag to detect the third pattern.
Usage Page concatenation is done in both Local and Main parsing.
If usage_page_preceding equals 3(the third pattern encountered),
hid_concatenate_usage_page() is jumped.

Change-Id: Ieba9bcae85c49619b0abbafb55ce26d72a24f086
Signed-off-by: Candle Sun <candle.sun@unisoc.com>
Signed-off-by: Nianfu Bai <nianfu.bai@unisoc.com>
Fixes: 58e75155009c ("HID: core: move Usage Page concatenation to Main item")
Link: https://lore.kernel.org/lkml/1569830949-10771-1-git-send-email-candlesea@gmail.com/
Patch-mainline: linux-kernel @ 30/09/2019, 16:09
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
2019-10-21 00:05:22 -07:00
Nicolas Saenz Julienne
61fd8755a7 HID: core: move Usage Page concatenation to Main item
[ Upstream commit 58e75155009cc800005629955d3482f36a1e0eec ]

As seen on some USB wireless keyboards manufactured by Primax, the HID
parser was using some assumptions that are not always true. In this case
it's s the fact that, inside the scope of a main item, an Usage Page
will always precede an Usage.

The spec is not pretty clear as 6.2.2.7 states "Any usage that follows
is interpreted as a Usage ID and concatenated with the Usage Page".
While 6.2.2.8 states "When the parser encounters a main item it
concatenates the last declared Usage Page with a Usage to form a
complete usage value." Being somewhat contradictory it was decided to
match Window's implementation, which follows 6.2.2.8.

In summary, the patch moves the Usage Page concatenation from the local
item parsing function to the main item parsing function.

Change-Id: Id25c0c7e11712501d117fb715b64db7772ac2066
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Terry Junge <terry.junge@poly.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Git-commit: 5db3c5adf4
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
2019-10-21 00:04:35 -07:00
Linux Build Service Account
20ad64b4d0 Merge "msm: pcie: Use local variable for manipulation" 2019-10-19 01:24:46 -07:00
Linux Build Service Account
329af9b580 Merge "power: battery: Initialize work struct before cancelling work" 2019-10-18 15:15:38 -07:00
Linux Build Service Account
e39e0aa356 Merge "ASoC: Fix possible overflow in routing driver" 2019-10-18 04:49:02 -07:00
Soumya Managoli
66b26c141c asoc: msm-routing: Fix array out of bounds issue
It seems there is out of bound access chances for lsm_app_type_cfg
array within msm_routing_get_lsm_app_type_cfg_control() callback.
Added case check to return invalid value if user tries to exceed
maximum allocated size of array to avoid it.

Change-Id: Ied86e6c9a957255c55bb126a09741fbde429be32
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-17 03:59:51 -07:00
Soumya Managoli
27c90ea8af ASoC: Fix possible overflow in routing driver
The reg in soc_mixer_control is 32-bit. When using
SOC_SINGLE_EXT, the value of FE DAI ID which is passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Use SOC_DOUBLE_EXT instead of SOC_SINGLE_EXT so that the
reg field can be set to SOC_NO_PM to avoid any DAPM operation,
while passing BE and FE IDs in shift and rshift fields. And
these values can be retrieve in get/put functions and use them.
This is to avoid any possible overflow in DAPM operation.

Change-Id: I17fa4e059889ae725e6f015a779f518e6d0a813f
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-10-17 16:26:36 +05:30
Avaneesh Kumar Dwivedi
a19e5e98f4 soc: qcom: Reorganize PIL code for reclaiming MSS mem during SSR
This change ask hypervisor to remove memory mapping for MSS
from IOMMU second stage table and assign the ownership back to
HLOS just after MBA is booted.

Presently this is being done only after MBA is booted and MDT is
authenticated.

Change-Id: I724c1bcc664827e666612dd34cd078f3f044498a
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
2019-10-17 11:14:45 +05:30
Rahul Sharma
c2877a4eb8 msm: ekms: Remove the wait for completion of eDRM probe
Main DRM & eDRM driver has asynchronous probes. In order to ensure that
both the driver's probe has completed there is a wait for completion for
respective driver is executed. There is an issue where the
wait for the eDRM driver blocks the eDRM driver deferred probe call.

This change remove wait in the eDRM driver for completion of its probe
as eDRM driver is always initialized after main DRM and necessary clock
voting would also be done in main DRM.

Change-Id: I422419d381ad3d0361fb80f3b2b9d176203a9342
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2019-10-16 13:58:23 +05:30
Nirmal Abraham
6dec23e2d3 fbdev: msm: Avoid UAF in mdss_dsi_cmd_write
In mdss_dsi_cmd_write, a failure in copying the cmds to
'string_buf' can cause an early return. In this case,
the 'pcmds->string_buf' won't be pointing to a valid
buffer. This can lead to use-after-free and memory leak.
To avoid this, assign the newly allocated buffer to
'pcmds->string_buf' after returning from krealloc call.

Change-Id: I286f12c86078d1989cb09453c8a395a4ad94b324
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
2019-10-15 22:42:19 -07:00
Umang Chheda
666e83125b power: battery: Initialize work struct before cancelling work
Votable callback accesses work structure as part of
their callback, initialize work before creation of votables.

Change-Id: I91741b3d54c73aab5c695a31292a32752edc77cd
Signed-off-by: Umang Chheda <uchheda@codeaurora.org>
2019-10-15 11:54:11 +05:30
Linux Build Service Account
c65b958524 Merge "cnss2: Add support for genoa sdio" 2019-10-14 04:48:42 -07:00
Jayachandran Sreekumaran
e5b2b112b3 cnss2: Add support for genoa sdio
Add support for genoa sdio

Change-Id: Icf004d954ca0b508830412da6a381a7844f66efe
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-10-14 11:33:53 +05:30
Linux Build Service Account
4b981b7bf7 Merge "ARM: dts: msm: Removed IOMMU test device node for MSM8996" 2019-10-11 13:27:31 -07:00
Gerrit - the friendly Code Review server
a4e2c9c9ee Merge changes into msm-4.4 2019-10-11 05:18:32 -07:00
Arjun Sreenath
4bcdd835f0 ARM: dts: msm: Removed IOMMU test device node for MSM8996
Removed IOMMU test device node for MSM8996 only.

Change-Id: I3197da05da1096cd485b0464fb6ccf87513d927e
Signed-off-by: Arjun Sreenath <asreen@codeaurora.org>
2019-10-11 12:48:49 +05:30
Linux Build Service Account
eef0f89bc7 Merge "defconfig : Enable Configs for MSM8996" 2019-10-10 23:39:05 -07:00
Linux Build Service Account
f0cc9af172 Merge "msm: camera_v2: Avoid halting AXI bridge" 2019-10-10 14:55:36 -07:00
Manoj Prabhu B
e935115d05 diag: Validate msg source length to prevent out of bound access
Place check for mask size and validate source length against
sum of header length and mask size to prevent out of bound access.

Change-Id: I8ac089202b6e3007773b92be8cfdc52fcb30ec3c
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-10-09 01:57:01 -07:00
Greg Kroah-Hartman
736005daca This is the 4.4.196 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl2bi3UACgkQONu9yGCS
 aT5v6A//e5UzgJT3Y/V8goghiTF4gQqUP0AWRhfV0oJqjoOYHpDFxIBZ/6kJOmnS
 alYjMReNbjcYFg83MbCbggIm5BPfXFW7jtOWBHXuTBHQQv1Hj9tp6AA2dHe6ZLRs
 LgYpwrUhj7HF1kNBK3Ax/ojhIwCcCPNpED1KMoudAv/PDPhX/PyA2DXrrjCwgI8B
 lveownJVPhD/q6DMGjXpTkgBxtw/oKuJBz8fO0DzB7vwRacJXD9pCv7N8+wD3msY
 TCZ1N9Pc2uhWYrNMefMsRlLsnI35Ohfm3dNmMA6V/NZ5so6knnymmOO/Sqah88iO
 2AnTiqdqosv1LATxQPEMKTJpK+rXks24cLCAUhHgBfGE5zlLDhljVb2vAhXZgj6F
 /yNRUxX90rcGJMrUmIvTGmlf/fYjduteDRdckyGZmkHN931LDTLQq7AACNbhV7Iy
 HWAgkBUgCsdzzdPPWgVEv+e3l/0N01U5uVsMQa2JYl7SzzDEddu1h+0mKIuaNFNW
 CyJngR2UDduvoQUAm6gk/izwG3bbsAwldCWNC5WYjz0SKJ1swJuqvUAk2U4xhh+x
 hXBKTAr0RP0tOrxeSV1iMCf2IkA83f4r2imO+HTYr0Zvi+T5Pz+LEGs24pj+q2wi
 0oxDCk4OaetukAnIANhG2NguFXgEdyZvqbJOHZH+dni/k9ybyq8=
 =VjDb
 -----END PGP SIGNATURE-----

Merge 4.4.196 into android-4.4-p

Changes in 4.4.196
	video: ssd1307fb: Start page range at page_offset
	gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()
	ipmi_si: Only schedule continuously in the thread in maintenance mode
	clk: qoriq: Fix -Wunused-const-variable
	clk: sirf: Don't reference clk_init_data after registration
	powerpc/rtas: use device model APIs and serialization during LPM
	powerpc/futex: Fix warning: 'oldval' may be used uninitialized in this function
	powerpc/pseries/mobility: use cond_resched when updating device tree
	pinctrl: tegra: Fix write barrier placement in pmx_writel
	vfio_pci: Restore original state on release
	powerpc/64s/exception: machine check use correct cfar for late handler
	powerpc/pseries: correctly track irq state in default idle
	scsi: core: Reduce memory required for SCSI logging
	mfd: intel-lpss: Remove D3cold delay
	ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
	HID: apple: Fix stuck function keys when using FN
	security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb()
	fat: work around race with userspace's read via blockdev while mounting
	hypfs: Fix error number left in struct pointer member
	ocfs2: wait for recovering done after direct unlock request
	kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
	ANDROID: binder: remove waitqueue when thread exits.
	ANDROID: binder: synchronize_rcu() when using POLLFREE.
	hso: fix NULL-deref on tty open
	ipv6: drop incoming packets having a v4mapped source address
	net: ipv4: avoid mixed n_redirects and rate_tokens usage
	net: qlogic: Fix memory leak in ql_alloc_large_buffers
	nfc: fix memory leak in llcp_sock_bind()
	sch_dsmark: fix potential NULL deref in dsmark_init()
	xen-netfront: do not use ~0U as error return value for xennet_fill_frags()
	net/rds: Fix error handling in rds_ib_add_one()
	sch_cbq: validate TCA_CBQ_WRROPT to avoid crash
	Smack: Don't ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set
	smack: use GFP_NOFS while holding inode_smack::smk_lock
	NFC: fix attrs checks in netlink interface
	Linux 4.4.196

Change-Id: I7e03bb3ca1865988df014b8e38336b76430842a9
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-10-07 21:22:12 +02:00
Greg Kroah-Hartman
c61ebb668f Linux 4.4.196 2019-10-07 21:01:07 +02:00
Andrey Konovalov
2e48675890 NFC: fix attrs checks in netlink interface
commit 18917d51472fe3b126a3a8f756c6b18085eb8130 upstream.

nfc_genl_deactivate_target() relies on the NFC_ATTR_TARGET_INDEX
attribute being present, but doesn't check whether it is actually
provided by the user. Same goes for nfc_genl_fw_download() and
NFC_ATTR_FIRMWARE_NAME.

This patch adds appropriate checks.

Found with syzkaller.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-07 21:01:07 +02:00