Commit graph

603772 commits

Author SHA1 Message Date
Vivek Kumar
c4799c908d defconfig: msm: Enable earlydomain handoff support
Enable earlydomain handoff support for msm8996
auto.

Change-Id: If18f1152cd8f008cc5ef68c89680dbd37674a2d1
Signed-off-by: Vivek Kumar <vivekuma@codeaurora.org>
2018-12-06 03:51:24 -08:00
Vivek Kumar
0e2d41ea25 ARM: dts: msm: Add dt node for earlydomain
Add DT node for early domain driver for
msm8996 and remove reserved memory node
for lk_pool as it will be populated by
bootloader if early domain is enabled.

Change-Id: Idd364e2bfab97af78292b1e6a6e172a7b7c4c3a0
Signed-off-by: Vivek Kumar <vivekuma@codeaurora.org>
2018-12-06 03:51:17 -08:00
Linux Build Service Account
1446ca0585 Merge "cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT" 2018-12-05 13:57:33 -08:00
Linux Build Service Account
a26a21e685 Merge "scm_qcpe: validate hab_recv() return value for retry" 2018-12-05 06:01:23 -08:00
Linux Build Service Account
22b90bcbe5 Merge "soc: qcom: glink: Add support to set affinities" 2018-12-05 06:01:22 -08:00
Linux Build Service Account
a3eba1613d Merge "Bluetooth: Added spinlocks for serial_clock_vote" 2018-12-05 06:01:21 -08:00
Linux Build Service Account
9254e692f7 Merge "dwc3-msm: Do not resume usb3 phy if max speed is HS only" 2018-12-05 06:01:20 -08:00
Linux Build Service Account
93b010356e Merge "diag: Do not clear masks during logging mode switch" 2018-12-05 06:01:19 -08:00
Linux Build Service Account
8a0f0cceb7 Merge "defconfig: msm: enable SLUB_DEBUG_ON for gvm" 2018-12-05 06:00:42 -08:00
Youssef Youssef
010a0cd6a6 scm_qcpe: validate hab_recv() return value for retry
habmm_socket_recv() can return -EINTR which indicate that
the operation must be restarted.

Change-Id: I0860a9593303c7bf1fea5e0349595c4b2fb085eb
Signed-off-by: Youssef Youssef <yyoussef@codeaurora.org>
2018-12-05 01:09:36 -08:00
Linux Build Service Account
b4266af231 Merge "usb: gadget: Fix double free of device descriptor pointers" 2018-12-04 23:28:58 -08:00
Chris Lew
e3051954fb soc: qcom: glink: Add support to set affinities
There is a need to pin the interrupts and rx worker thread to a
specific cpu set for power and performance. Add support to define
the cpu set in device tree. This change does not include any hotplug
support.

Change-Id: Ibe651e987e72f5119e9e8453d87fa8059219ec1f
Signed-off-by: Chris Lew <clew@codeaurora.org>
2018-12-04 22:04:30 -08:00
Harish Bandi
5eceeebeee Bluetooth: Added spinlocks for serial_clock_vote
If we dont lock with spinlock before calling serial_clock_vote
in serial_clock_vote few global parameters may change values,
to avoid the race condition added hci_ibs_lock spinlock before
calling serial_clock_vote

Change-Id: I040d7ef0d998a60a274bf8d89649785db007afa3
Signed-off-by: Harish Bandi <c-hbandi@codeaurora.org>
2018-12-04 20:39:58 -08:00
Linux Build Service Account
9e66b661ec Merge "msm: camera: Fix for OOB security CR" 2018-12-04 13:39:03 -08:00
Linux Build Service Account
620331e4af Merge "ARM: dts: msm: Remove Out-Of-Bound access" 2018-12-04 07:07:22 -08:00
Abhishek Abbanaveni
4d15ce59f5 msm: camera: Fix for OOB security CR
If user passes an aribitary command with _IOC_DIR(cmd) == _IOC_NONE,
"arg" should point to any arbitrary address.

Check for invalid command and return error.

Change-Id: If60191a07bb80939af2d471a5acf1b17dd68aa58
CRs-Fixed: 2299567
Signed-off-by: Abhishek Abbanaveni <aabban@codeaurora.org>
2018-12-04 01:14:58 -08:00
Hemant Kumar
ceed3cc4a1 usb: gadget: Fix double free of device descriptor pointers
Upon driver unbind usb_free_all_descriptors() function frees all
speed descriptor pointers without setting them to NULL. In case
gadget speed changes (i.e from super speed plus to super speed)
after driver unbind only upto super speed descriptor pointers get
populated. Super speed plus desc still holds the stale (already
freed) pointer. As a result next composition switch results into
double free of super speed plus descriptor. Fix this issue by
setting all descriptor pointers to NULL after freeing them in
usb_free_all_descriptors(). Also clean up gsi_unbind() which is
setting up descriptor pointers to NULL already.

Change-Id: I4f28294c165bb3b5dc9feb4f22d819f527ad4d50
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2018-12-04 14:00:44 +05:30
Linux Build Service Account
0d67f89178 Merge "drm/msm/hdmi: disable HDR state on bridge disable" 2018-12-04 00:22:03 -08:00
Linux Build Service Account
0d7730d800 Merge "msm: ipa: Remove assert on ep empty" 2018-12-04 00:22:02 -08:00
Linux Build Service Account
37d8265f3e Merge "ASoC: msm: handle SSR event" 2018-12-04 00:22:02 -08:00
Linux Build Service Account
2f185a5acc Merge "defconfig: msm: Enable EHSET driver for 8996 GVM platform" 2018-12-04 00:22:01 -08:00
Linux Build Service Account
697d3f7621 Merge "dwc3-msm: Allow USB LPM with data role swap from dfp to ufp" 2018-12-04 00:22:00 -08:00
Linux Build Service Account
c471768d9c Merge "ARM: dts: msm: Add csi1 settings for early camera" 2018-12-04 00:21:58 -08:00
Linux Build Service Account
08a391fbb9 Merge "msm: ais: Move wait for early camera handoff" 2018-12-04 00:21:57 -08:00
Linux Build Service Account
0b402f74a0 Merge "Merge android-4.4.165 (f34ff9e) into msm-4.4" 2018-12-04 00:21:55 -08:00
Monika Singh
cc5c7e1c96 ARM: dts: msm: Remove Out-Of-Bound access
Remove the out of bound access vulnerability in the qce
driver reachable via ioctl.

Change-Id: I4320cd27334eaae975f4a6ad07fb7b2e5ebccffd
Signed-off-by: Monika Singh <monising@codeaurora.org>
2018-12-03 21:10:44 -08:00
Linux Build Service Account
8a475d4ba1 Merge "soc: qcom: boot_stats: Moved the early cam entry" 2018-12-03 17:19:24 -08:00
Navid Bahrani
ff7940216e drm/msm/hdmi: disable HDR state on bridge disable
HDR info frames were not disabled after a hotplug and app closure
or in the event of an unexpected termination of the userspace driver.
Fixed the issue by resetting to HDR_DISABLE state in hdmi bridge disable.

Change-Id: Iead5cfe11512a8c49b6a2183561de427ce16f393
Signed-off-by: Navid Bahrani <nbahrani@codeaurora.org>
2018-12-03 17:05:43 -08:00
Mohit Aggarwal
61d5461783 diag: Do not clear masks during logging mode switch
Currently, masks will be cleared during logging mode
switch if physical USB disconnection will happen in
concurrency. There is no need to clear the masks in
logging switch case. The patch ensures that masks
will be cleared only in valid cases.

Change-Id: I68f5335c4fa8fe06ba1f686f29336a8150991368
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2018-12-03 15:55:54 +05:30
E V Ravi
b03ef6aa9c soc: qcom: boot_stats: Moved the early cam entry
Added the new bootmarkers in struct boot_stats for
bootloader_checksum_start and bootloader_checksum_end
to match the exact order of entries defined in the
bootloader enum bs_entry. And also moved the
bootloader_early_camera_start entry to the bottom
to match the same.

Change-Id: I1fa19aa21b658d8fdf7dcf5bba6658c40420d426
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2018-12-03 13:20:15 +05:30
Nijun Gong
0309212b1a defconfig: msm: enable SLUB_DEBUG_ON for gvm
For checking memory leak issue, which was already enabled
in LA 1.2 SP.

Change-Id: I6d9beeadb98bbda84d61821e6f5bfc61d28f9316
Signed-off-by: Nijun Gong <ngong@codeaurora.org>
2018-12-03 15:12:59 +08:00
Mohammed
8ec4a3cb24 msm: ipa: Remove assert on ep empty
Device assert in ep empty
affecting LPM scenario.

Remove device assert in ep empty check.
which is not really required since IPA BAM
reset is taken care.

Change-Id: I57ae9ada7f15c335a181247675f10b607774fd14
Signed-off-by: Mohammed <mjavid@codeaurora.org>
2018-11-30 11:39:55 -08:00
Vamsi Krishna Samavedam
78d434a224 dwc3-msm: Do not resume usb3 phy if max speed is HS only
usb3 phy is needed when core is operating at super speed or
higher. Do not turn on usb3 phy clocks even when core is
programmed to work at high speed only mode. While at it,
remove redundant module parameter to control max speed. Speed
can be controlled using existing sysfs entry.

Example: To set High speed only:
echo "high" > /sys/devices/platform/soc/<devname>/speed

To set super speed:
echo "super" > /sys/devices/platform/soc/<devname>/speed

Change-Id: I24a9a869d97e6efc3ebc0d7a1374805139c65648
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2018-11-30 16:43:42 +05:30
Mayank Rana
21caf80630 dwc3-msm: Allow USB LPM with data role swap from dfp to ufp
Current code checks IN_P3 status (i.e. USB is into U3 or not) with
dwc3_prepare_suspend() API using in_host_mode or vbus_active flag.
With data role swap transition (e.g. dfp -> ufp case), in_host_mode
flag sets to false and vbus_active flag sets to true due to quick
calling of stop host and start peripheral mode from policy engine.
This results into USB doesn't go into LPM with stop host mode (i.e.
USB LPM is aborted due to vbus_active flag seen as true) which
results into no USB enumeration in start peripheral mode. Current
code doesn't perform block reset while stopping USB host mode
functionality. Hence to invoke USB core and PHYs related reset and
init functionality allow USB LPM by replacing vbus_active check with
in_device_mode flag which provides status of USB controller's data
role while going into USB LPM. Start peripheral mode brings USB
out of LPM which performs POR functionality.

Change-Id: I2bbb804bce5f910826ba30a3dda4317bbdb2e1f1
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2018-11-29 10:15:14 +05:30
Jeff Bernard
0f17e73908 ARM: dts: msm: Add csi1 settings for early camera
Add a vote for csi1 clks for early rear view camera for
automotive.

Change-Id: Ie89a99e0333d3755f025297fb7f815bbbdc3e9d9
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
2018-11-28 13:20:05 -05:00
E V Ravi
b97ae1f1d0 msm: ais: Move wait for early camera handoff
Ensure camera driver waits for early camera
handoff from LK to avoid hardware contention.

Change-Id: If301b63b34331285ac3d126543ca3c1d5cae6ba4
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2018-11-28 12:59:25 -05:00
Andrew Zaborowski
0dbd3a4c45 cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT
Disconnect or deauthenticate when the owning socket is closed if this
flag is supplied to CMD_CONNECT or CMD_ASSOCIATE.  This may be used
to ensure userspace daemon doesn't leave an unmanaged connection behind.

In some situations it would be possible to account for that, to some
degree, in the deamon restart code or in the up/down scripts without
the use of this attribute.  But there will be systems where the daemon
can go away for varying periods without a warning due to local resource
management.

Signed-off-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Git-commit: 36a554cec119bbd20c4ec0cb96bd4712d124bfea
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/
mac80211-next.git
Change-Id: Ic09ee323fc6215059d5c2572ba3e77c56addad32
CRs-Fixed: 2182553
Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
Signed-off-by: Jiachao Wu <jiacwu@codeaurora.org>
Signed-off-by: Min Liu <minliu@codeaurora.org>
2018-11-28 17:29:44 +08:00
Erin Yan
77b9c2877b ASoC: msm: handle SSR event
Change sound card status when got SSR event notification, so that usespace
can be aware of SSR start and complete by detect sound card status.

Change-Id: Ic6b931b8ffca06881016bc1a063d11164a1233bf
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
2018-11-28 00:57:23 -08:00
Srinivasarao P
0a858409d5 Merge android-4.4.165 (f34ff9e) into msm-4.4
* refs/heads/tmp-f34ff9e
  Linux 4.4.165
  xhci: Fix USB3 NULL pointer dereference at logical disconnect.
  HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
  new helper: uaccess_kernel()
  ACPI / platform: Add SMB0001 HID to forbidden_id_list
  drivers/misc/sgi-gru: fix Spectre v1 vulnerability
  USB: misc: appledisplay: add 20" Apple Cinema Display
  misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
  usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
  USB: quirks: Add no-lpm quirk for Raydium touchscreens
  usb: cdc-acm: add entry for Hiro (Conexant) modem
  uio: Fix an Oops on load
  media: v4l: event: Add subscription to list before calling "add" operation
  Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV"
  Revert "media: videobuf2-core: don't call memop 'finish' when queueing"
  btrfs: fix pinned underflow after transaction aborted
  gfs2: Put bitmap buffers in put_super
  SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()
  zram: close udev startup race condition as default groups
  lib/raid6: Fix arm64 test build
  hwmon: (ibmpowernv) Remove bogus __init annotations
  netfilter: xt_IDLETIMER: add sysfs filename checking routine
  netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()
  s390/mm: Fix ERROR: "__node_distance" undefined!
  netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net
  s390/vdso: add missing FORCE to build targets
  arm64: percpu: Initialize ret in the default case
  platform/x86: acerhdf: Add BIOS entry for Gateway LT31 v1.3307
  clk: samsung: exynos5420: Enable PERIS clocks for suspend
  fs/exofs: fix potential memory leak in mount option parsing
  um: Give start_idle_thread() a return code
  hfsplus: prevent btree data loss on root split
  hfs: prevent btree data loss on root split
  reiserfs: propagate errors from fill_with_dentries() properly
  x86/build: Use cc-option to validate stack alignment parameter
  x86/build: Fix stack alignment for CLang
  x86/boot: #undef memcpy() et al in string.c
  x86/build: Specify stack alignment for clang
  x86/build: Use __cc-option for boot code compiler options
  kbuild: Add __cc-option macro
  x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility
  crypto, x86: aesni - fix token pasting for clang
  x86/kbuild: Use cc-option to enable -falign-{jumps/loops}
  arm64: Disable asm-operand-width warning for clang
  kbuild: allow to use GCC toolchain not in Clang search path
  kbuild: set no-integrated-as before incl. arch Makefile
  kbuild: clang: disable unused variable warnings only when constant
  kbuild: clang: remove crufty HOSTCFLAGS
  kbuild: clang: fix build failures with sparse check
  kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
  kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
  kbuild: fix linker feature test macros when cross compiling with Clang
  efi/libstub/arm64: Set -fpie when building the EFI stub
  efi/libstub/arm64: Force 'hidden' visibility for section markers
  crypto: arm64/sha - avoid non-standard inline asm tricks
  kbuild: clang: Disable 'address-of-packed-member' warning
  modules: mark __inittest/__exittest as __maybe_unused
  kbuild: Add support to generate LLVM assembly files
  kbuild: use -Oz instead of -Os when using clang
  kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  kbuild: drop -Wno-unknown-warning-option from clang options
  kbuild: fix asm-offset generation to work with clang
  kbuild: consolidate redundant sed script ASM offset generation
  kbuild: Consolidate header generation from ASM offset information
  kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
  kbuild: Add better clang cross build support
  ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
  tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
  net-gro: reset skb->pkt_type in napi_reuse_skb()
  ip_tunnel: don't force DF when MTU is locked
  flow_dissector: do not dissect l4 ports for fragments

Conflicts:
	arch/um/os-Linux/skas/process.c

Change-Id: I6587d94332e204c068f7d44428a2ec1280bc3a7f
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-11-28 11:43:50 +05:30
Greg Kroah-Hartman
f34ff9e87b This is the 4.4.165 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlv9XdMACgkQONu9yGCS
 aT6Lsw/9FWbMlF79xXabQ0UaPoIGmfdZlN+q+ooubmjNNsoYvYOu409WJqXac3x5
 AHQh+0EBjgEEv2nwQ2x5FFN5xRImndse7XPA0UMqLU+cYHctxOvzgY23qW++42nn
 QH/f1pPoNjNvFcPXkVSa0Rz05z+GUcEsE0ufOx/dzb0cTrhymO09QY5w1onomLIJ
 lUdUBLWOhXBerDU0osy6rayA2CsiKkm4KDrwaH+KMSKoXxVMzqMMK8oSPyFClZB/
 1ajD8lVvF8pYvwvA6De0CbVRsB7T53Kq/XWccGb+i7zzMe6/6ZMzkIkZ7yhORO9A
 mFmFIR8Sqtne+ch+aghLEoWNjewMokjW44hF9mVSSOLbHPSQwNs4GZFn4mlZimSJ
 87eJdee1i25Xnyp5psvlsbjKH0lNVQ2A0JfJ70rEkuTdat/FItFOyMOZvOZFpDVe
 NpnQUHjH6MFhiFra4w5QM4ljYilmiOZvWEZiUcxnKkMjqYsKS9F5xhBJ72SGVJWy
 LPWZH57i1XlY7MvX2q5qizU62dIlxLz8JdPdj5tSeTx/HUmcsvXA2RXLgt03CdEg
 nn+FtFOscvyJhYi7BFj7CWJaJd1vOAnsPXys12R4W3XYQpAqTxxuFujOq6OYeikV
 oih7WpzT9WLlxU30JRmAPGz52MM7RluXueuM70+vM9UHp9C3cyQ=
 =tqWJ
 -----END PGP SIGNATURE-----

Merge 4.4.165 into android-4.4

Changes in 4.4.165
	flow_dissector: do not dissect l4 ports for fragments
	ip_tunnel: don't force DF when MTU is locked
	net-gro: reset skb->pkt_type in napi_reuse_skb()
	tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
	ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
	kbuild: Add better clang cross build support
	kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
	kbuild: Consolidate header generation from ASM offset information
	kbuild: consolidate redundant sed script ASM offset generation
	kbuild: fix asm-offset generation to work with clang
	kbuild: drop -Wno-unknown-warning-option from clang options
	kbuild, LLVMLinux: Add -Werror to cc-option to support clang
	kbuild: use -Oz instead of -Os when using clang
	kbuild: Add support to generate LLVM assembly files
	modules: mark __inittest/__exittest as __maybe_unused
	kbuild: clang: Disable 'address-of-packed-member' warning
	crypto: arm64/sha - avoid non-standard inline asm tricks
	efi/libstub/arm64: Force 'hidden' visibility for section markers
	efi/libstub/arm64: Set -fpie when building the EFI stub
	kbuild: fix linker feature test macros when cross compiling with Clang
	kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
	kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
	kbuild: clang: fix build failures with sparse check
	kbuild: clang: remove crufty HOSTCFLAGS
	kbuild: clang: disable unused variable warnings only when constant
	kbuild: set no-integrated-as before incl. arch Makefile
	kbuild: allow to use GCC toolchain not in Clang search path
	arm64: Disable asm-operand-width warning for clang
	x86/kbuild: Use cc-option to enable -falign-{jumps/loops}
	crypto, x86: aesni - fix token pasting for clang
	x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility
	kbuild: Add __cc-option macro
	x86/build: Use __cc-option for boot code compiler options
	x86/build: Specify stack alignment for clang
	x86/boot: #undef memcpy() et al in string.c
	x86/build: Fix stack alignment for CLang
	x86/build: Use cc-option to validate stack alignment parameter
	reiserfs: propagate errors from fill_with_dentries() properly
	hfs: prevent btree data loss on root split
	hfsplus: prevent btree data loss on root split
	um: Give start_idle_thread() a return code
	fs/exofs: fix potential memory leak in mount option parsing
	clk: samsung: exynos5420: Enable PERIS clocks for suspend
	platform/x86: acerhdf: Add BIOS entry for Gateway LT31 v1.3307
	arm64: percpu: Initialize ret in the default case
	s390/vdso: add missing FORCE to build targets
	netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net
	s390/mm: Fix ERROR: "__node_distance" undefined!
	netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()
	netfilter: xt_IDLETIMER: add sysfs filename checking routine
	hwmon: (ibmpowernv) Remove bogus __init annotations
	lib/raid6: Fix arm64 test build
	zram: close udev startup race condition as default groups
	SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()
	gfs2: Put bitmap buffers in put_super
	btrfs: fix pinned underflow after transaction aborted
	Revert "media: videobuf2-core: don't call memop 'finish' when queueing"
	Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV"
	media: v4l: event: Add subscription to list before calling "add" operation
	uio: Fix an Oops on load
	usb: cdc-acm: add entry for Hiro (Conexant) modem
	USB: quirks: Add no-lpm quirk for Raydium touchscreens
	usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
	misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
	USB: misc: appledisplay: add 20" Apple Cinema Display
	drivers/misc/sgi-gru: fix Spectre v1 vulnerability
	ACPI / platform: Add SMB0001 HID to forbidden_id_list
	new helper: uaccess_kernel()
	HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
	xhci: Fix USB3 NULL pointer dereference at logical disconnect.
	Linux 4.4.165

Change-Id: I5bd20327e0c1139c46f74e8d5916fa0530a307d3
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-11-27 16:20:35 +01:00
Greg Kroah-Hartman
2757e11be6 Linux 4.4.165 2018-11-27 16:08:03 +01:00
Mathias Nyman
d57a6bb220 xhci: Fix USB3 NULL pointer dereference at logical disconnect.
commit 2278446e2b7cd33ad894b32e7eb63afc7db6c86e upstream.

Hub driver will try to disable a USB3 device twice at logical disconnect,
racing with xhci_free_dev() callback from the first port disable.

This can be triggered with "udisksctl power-off --block-device <disk>"
or by writing "1" to the "remove" sysfs file for a USB3 device
in 4.17-rc4.

USB3 devices don't have a similar disabled link state as USB2 devices,
and use a U3 suspended link state instead. In this state the port
is still enabled and connected.

hub_port_connect() first disconnects the device, then later it notices
that device is still enabled (due to U3 states) it will try to disable
the port again (set to U3).

The xhci_free_dev() called during device disable is async, so checking
for existing xhci->devs[i] when setting link state to U3 the second time
was successful, even if device was being freed.

The regression was caused by, and whole thing revealed by,
Commit 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device")
which sets xhci->devs[i]->udev to NULL before xhci_virt_dev() returned.
and causes a NULL pointer dereference the second time we try to set U3.

Fix this by checking xhci->devs[i]->udev exists before setting link state.

The original patch went to stable so this fix needs to be applied there as
well.

Fixes: 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device")
Cc: <stable@vger.kernel.org>
Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch>
Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Eric Biggers
645cb3965b HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
commit 8c01db7619f07c85c5cd81ec5eb83608b56c88f5 upstream.

When a UHID_CREATE command is written to the uhid char device, a
copy_from_user() is done from a user pointer embedded in the command.
When the address limit is KERNEL_DS, e.g. as is the case during
sys_sendfile(), this can read from kernel memory.  Alternatively,
information can be leaked from a setuid binary that is tricked to write
to the file descriptor.  Therefore, forbid UHID_CREATE in these cases.

No other commands in uhid_char_write() are affected by this bug and
UHID_CREATE is marked as "obsolete", so apply the restriction to
UHID_CREATE only rather than to uhid_char_write() entirely.

Thanks to Dmitry Vyukov for adding uhid definitions to syzkaller and to
Jann Horn for commit 9da3f2b740544 ("x86/fault: BUG() when uaccess
helpers fault on kernel addresses"), allowing this bug to be found.

Reported-by: syzbot+72473edc9bf4eb1c6556@syzkaller.appspotmail.com
Fixes: d365c6cfd3 ("HID: uhid: add UHID_CREATE and UHID_DESTROY events")
Cc: <stable@vger.kernel.org> # v3.6+
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Al Viro
342bd595ed new helper: uaccess_kernel()
commit db68ce10c4f0a27c1ff9fa0e789e5c41f8c4ea63 upstream.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[only take the include/linux/uaccess.h portion - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Hans de Goede
7f0052a880 ACPI / platform: Add SMB0001 HID to forbidden_id_list
commit 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa upstream.

Many HP AMD based laptops contain an SMB0001 device like this:

Device (SMBD)
{
    Name (_HID, "SMB0001")  // _HID: Hardware ID
    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
    {
        IO (Decode16,
            0x0B20,             // Range Minimum
            0x0B20,             // Range Maximum
            0x20,               // Alignment
            0x20,               // Length
            )
        IRQ (Level, ActiveLow, Shared, )
            {7}
    })
}

The legacy style IRQ resource here causes acpi_dev_get_irqresource() to
be called with legacy=true and this message to show in dmesg:
ACPI: IRQ 7 override to edge, high

This causes issues when later on the AMD0030 GPIO device gets enumerated:

Device (GPIO)
{
    Name (_HID, "AMDI0030")  // _HID: Hardware ID
    Name (_CID, "AMDI0030")  // _CID: Compatible ID
    Name (_UID, Zero)  // _UID: Unique ID
    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
    {
	Name (RBUF, ResourceTemplate ()
	{
	    Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
	    {
		0x00000007,
	    }
	    Memory32Fixed (ReadWrite,
		0xFED81500,         // Address Base
		0x00000400,         // Address Length
		)
	})
	Return (RBUF) /* \_SB_.GPIO._CRS.RBUF */
    }
}

Now acpi_dev_get_irqresource() gets called with legacy=false, but because
of the earlier override of the trigger-type acpi_register_gsi() returns
-EBUSY (because we try to register the same interrupt with a different
trigger-type) and we end up setting IORESOURCE_DISABLED in the flags.

The setting of IORESOURCE_DISABLED causes platform_get_irq() to call
acpi_irq_get() which is not implemented on x86 and returns -EINVAL.
resulting in the following in dmesg:

amd_gpio AMDI0030:00: Failed to get gpio IRQ: -22
amd_gpio: probe of AMDI0030:00 failed with error -22

The SMB0001 is a "virtual" device in the sense that the only way the OS
interacts with it is through calling a couple of methods to do SMBus
transfers. As such it is weird that it has IO and IRQ resources at all,
because the driver for it is not expected to ever access the hardware
directly.

The Linux driver for the SMB0001 device directly binds to the acpi_device
through the acpi_bus, so we do not need to instantiate a platform_device
for this ACPI device. This commit adds the SMB0001 HID to the
forbidden_id_list, avoiding the instantiating of a platform_device for it.
Not instantiating a platform_device means we will no longer call
acpi_dev_get_irqresource() for the legacy IRQ resource fixing the probe of
the AMDI0030 device failing.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1644013
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198715
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199523
Reported-by: Lukas Kahnert <openproggerfreak@gmail.com>
Tested-by: Marc <suaefar@googlemail.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Gustavo A. R. Silva
b61865ef9b drivers/misc/sgi-gru: fix Spectre v1 vulnerability
commit fee05f455ceb5c670cbe48e2f9454ebc4a388554 upstream.

req.gid can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

vers/misc/sgi-gru/grukdump.c:200 gru_dump_chiplet_request() warn:
potential spectre issue 'gru_base' [w]

Fix this by sanitizing req.gid before calling macro GID_TO_GRU, which
uses it to index gru_base.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Mattias Jacobsson
1b44cb3b63 USB: misc: appledisplay: add 20" Apple Cinema Display
commit f6501f49199097b99e4e263644d88c90d1ec1060 upstream.

Add another Apple Cinema Display to the list of supported displays

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Nathan Chancellor
285745ac5a misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
commit 7c97301285b62a41d6bceded7d964085fc8cc50f upstream.

After building the kernel with Clang, the following section mismatch
warning appears:

WARNING: vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from
the function ssc_probe() to the function
.init.text:atmel_ssc_get_driver_data()
The function ssc_probe() references
the function __init atmel_ssc_get_driver_data().
This is often because ssc_probe lacks a __init
annotation or the annotation of atmel_ssc_get_driver_data is wrong.

Remove __init from atmel_ssc_get_driver_data to get rid of the mismatch.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Emmanuel Pescosta
095ead1603 usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
commit a77112577667cbda7c6292c52d909636aef31fd9 upstream.

Following on from this patch: https://lkml.org/lkml/2017/11/3/516,
Corsair K70 LUX RGB keyboards also require the DELAY_INIT quirk to
start correctly at boot.

Dmesg output:
usb 1-6: string descriptor 0 read error: -110
usb 1-6: New USB device found, idVendor=1b1c, idProduct=1b33
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: can't set config #1, error -110

Signed-off-by: Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
Kai-Heng Feng
f88d08ecc6 USB: quirks: Add no-lpm quirk for Raydium touchscreens
commit deefd24228a172d1b27d4a9adbfd2cdacd60ae64 upstream.

Raydium USB touchscreen fails to set config if LPM is enabled:
[    2.030658] usb 1-8: New USB device found, idVendor=2386, idProduct=3119
[    2.030659] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.030660] usb 1-8: Product: Raydium Touch System
[    2.030661] usb 1-8: Manufacturer: Raydium Corporation
[    7.132209] usb 1-8: can't set config #1, error -110

Same behavior can be observed on 2386:3114.

Raydium claims the touchscreen supports LPM under Windows, so I used
Microsoft USB Test Tools (MUTT) [1] to check its LPM status. MUTT shows
that the LPM doesn't work under Windows, either. So let's just disable LPM
for Raydium touchscreens.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-test-tools

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00