798961 Commits

Author SHA1 Message Date
Chris Lew
e68e93d8b5 soc: qcom: smp2p: Remove IRQF_NO_SUSPEND
IRQF_NO_SUSPEND and enable_irq_wake should not be used simultaneously.
The specific behavior of each work at odds of one another and when used
together, prevents correct wakeup logging for the interrupt.

SMP2P needs the ability to wake the processor from suspend. Thus the
enable_irq_wake function should be used to mark the interrupt as wake
capable.

Using the IRQF_NO_SUSPEND flag allows the SMP2P interrupt to run with
less latency while the system is entering suspend but is not a correct
configuration according to power documentation. Instead, enable_irq_wake
should mark this interrupt as wake capable and abort suspend if an
interrupt comes while entering suspend.

Change-Id: I4cb7dee8e6e420d34c81bfdd63291fbd662d8872
Signed-off-by: Chris Lew <clew@codeaurora.org>
2022-03-15 19:48:29 +01:00
Rick Yiu
7d5ddbf86c drm/msm: move msm_drm_register to async probe
To reduce boot time to first stage.

Before:
[    1.221918] init: init first stage started!

After:
[    1.208333] init: init first stage started!

Bug: 129688998
Test: reboot 100 times, camera, wifi, basic operation
Change-Id: If35e5b5aa5d83fb9412dcd6c7d5292cec3a7914e
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-03-15 19:48:29 +01:00
Rick Yiu
8850047010 ion/msm: move msm_ion_init to async probe
To reduce boot time to first stage.

Before:
[    1.221918] init: init first stage started!

After:
[    1.194178] init: init first stage started!

Bug: 129688998
Test: reboot 100 times, camera, wifi, basic operation
Change-Id: I117bebc75cff08d16747cde6920794b0d9d92898
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-03-15 19:48:29 +01:00
Rick Yiu
039b5c2c9a soc/qcom: move icnss_initialize to async probe
To reduce boot time to first stage.

Before:
[    1.221918] init: init first stage started!

After:
[    1.199159] init: init first stage started!

Bug: 129688998
Test: reboot 100 times, camera, wifi, basic operation
Change-Id: Iff04c974605a2a5e5580c60a6b498b1fdbb44d12
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-03-15 19:48:29 +01:00
Rick Yiu
4c101b1226 msm: kgsl: move kgsl_3d_init to async probe
To reduce boot time to first stage.

Before:
[    1.221918] init: init first stage started!

After:
[    1.132756] init: init first stage started!

Bug: 129688998
Test: reboot 100 times, camera, wifi, basic operation
Change-Id: Ibce1d55a615f5d7f10f70263c1b9a4c6a1b26222
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-03-15 19:48:28 +01:00
Rick Yiu
4fb32ea137 i2c-qcom-geni: move geni_i2c_driver_init to async probe
To reduce boot time to first stage.

Before:
[    1.221918] init: init first stage started!

After:
[    1.182935] init: init first stage started!

Bug: 129688998
Test: reboot 100 times, camera, wifi, basic operation
Change-Id: I25aaf2bd7e1a031fa85930ddfb570c86b8c8ce79
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-03-15 19:48:28 +01:00
Harpreet "Eli" Sangha
14dc65f625 drivers: i2c: support per-device async suspend
Adds support for opting-in to async suspend on a per-device basis
through client flags and device tree.

Bug: 134704142
Test: Build and Run
Change-Id: I5609700cbff5c961dc820a9bcf9a4d57eafcd3b2
Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
2022-03-15 19:48:28 +01:00
Tim Murray
a236a186ba Revert "Revert "select: use freezable blocking call""
This reverts commit 59612d187912750f416fbffe0c00bc0811c54ab5.

Android doesn't need to worry about buggy i686 implementations, which
was the reason behind the original revert.

See https://bugzilla.kernel.org/show_bug.cgi?id=61781.

Test: device enters suspend and everything works fine
bug 77139736

Signed-off-by: Tim Murray <timmurray@google.com>
2022-03-15 19:48:28 +01:00
Tim Murray
2539ee167e cpuidle: don't disable cpuidle when entering suspend
cpuidle was disabled while entering suspend as part of commit
8651f97bd951d0bb1c10fa24e3fa3455193f3548 in order to work around some
ACPI bugs. However, there's no reason to do this on modern
platforms. Leaving cpuidle enabled can result in improved power
consumption if dpm_resume_noirq runs for a significant time.

Change-Id: Ie182785b176f448698c0264eba554d1e315e8a06
2022-03-15 19:48:28 +01:00
Danny Lin
fed4b203d3 dtc: Silence warnings
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2022-03-15 19:48:28 +01:00
Rob Herring
2377d447ef scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
This adds the following commits from upstream:

aadd0b65c987 checks: centralize printing of property names in failure messages
88960e398907 checks: centralize printing of node path in check_msg
f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
37dea76e9700 srcpos: drop special handling of tab
65893da4aee0 libfdt: overlay: Add missing license
962a45ca034d Avoid installing pylibfdt when dependencies are missing
cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
e54388015af1 dtc: Bump version to v1.4.6
a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
c8d5472de3ff tests: Improve compatibility with other platforms
c81d389a10cc checks: add chosen node checks
e671852042a7 checks: add aliases node checks
d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
18a3d84bb802 checks: add string list check for *-names properties
8fe94fd6f19f checks: add string list check
6c5730819604 checks: add a string check for 'label' property
a384191eba09 checks: fix sound-dai phandle with arg property check
b260c4f610c0 Fix ambiguous grammar for devicetree rule
fe667e382bac tests: Add some basic tests for the pci_bridge checks
7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
fca296445eab Add strstarts() helper function
cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
c8f8194d76cc implement strnlen for systems that need it
c8b38f65fdec libfdt: Remove leading underscores from identifiers
3b62fdaebfe5 Remove leading underscores from identifiers
2d45d1c5c65e Replace FDT_VERSION() with stringify()
2e6fe5a107b5 Fix some errors in comments
b0ae9e4b0ceb tests: Correct warning in sw_tree1.c

Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
identifiers") changed the multiple inclusion define protection, so the
kernel's libfdt_env.h needs the corresponding update.

Signed-off-by: Rob Herring <robh@kernel.org>
Change-Id: I0c7710b375f94b1b0c19d3672be6f3720271d4e6
2022-03-15 19:48:27 +01:00
Rob Herring
b0a4896e96 scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
Pickup the fix for handling unresolved phandles in overlays.

This adds the following commits from upstream:

c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
48c91c08bcfa libfdt: add stringlist functions to linker script

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Atman <masteratman@gmail.com>
2022-03-15 19:48:27 +01:00
Rob Herring
54e9e452e4 scripts/dtc: Update to upstream version v1.4.5-3-gb1a60033c110
This adds the following commits from upstream:

b1a60033c110 tests: Add a test for overlays syntactic sugar
737b2df39cc8 overlay: Add syntactic sugar version of overlays
497432fd2131 checks: Use proper format modifier for size_t
22a65c5331c2 dtc: Bump version to v1.4.5
c575d8059fff Add fdtoverlay to .gitignore
b6a6f9490d19 fdtoverlay: Sanity check blob size
8c1eb1526d2d pylibfdt: Use Python2 explicitly
ee3d26f6960b checks: add interrupts property check
c1e7738988f5 checks: add gpio binding properties check
b3bbac02d5e3 checks: add phandle with arg property checks
fe50bd1ecc1d fdtget: Split out cell list display into a new function
62d812308d11 README: Add a note about test_tree1.dts
5bed86aee9e8 pylibfdt: Add support for fdt_subnode_offset()
46f31b65b3b3 pylibfdt: Add support for fdt_node_offset_by_phandle()
a3ae43723687 pylibfdt: Add support for fdt_parent_offset()
a198af80344c pylibfdt: Add support for fdt_get_phandle()
b9eba92ea50f tests: Return a failure code when any tests fail
155faf6cc209 pylibfdt: Use local pylibfdt module
50e5cd07f325 pylibfdt: Add a test for use of uint32_t
ab78860f09f5 pylibfdt: Add stdint include to fix uint32_t
36f511fb1113 tests: Add stacked overlay tests on fdtoverlay
1bb00655d3e5 fdt: Allow stacked overlays phandle references
a33c2247ac8d Introduce fdt_setprop_placeholder() method
0016f8c2aa32 dtc: change default phandles to ePAPR style instead of both
e3b9a9588a35 tests: fdtoverlay unit test
42409146f2db fdtoverlay: A tool that applies overlays
aae22722fc8d manual: Document missing options
13ce6e1c2fc4 dtc: fix sprintf() format string error, again
d990b8013889 Makefile: Fix build on MSYS2 and Cygwin
51f56dedf8ea Clean up shared library compile/link options
21a2bc896e3d Suppress expected error message in fdtdump test
2a42b14d0d03 dtc: check.c fix compile error
a10cb3c818d3 Fix get_node_by_path string equality check
548aea2c436a fdtdump: Discourage use of fdtdump
c2258841a785 fdtdump: Fix over-zealous version check
9067ee4be0e6 Fix a few whitespace and style nits
e56f2b07be38 pylibfdt: Use setup.py to build the swig file
896f1c133265 pylibfdt: Use Makefile constructs to implement NO_PYTHON
90db6d9989ca pylibfdt: Allow setup.py to operate stand-alone
e20d9658cd8f Add Coverity Scan support
b04a2cf08862 pylibfdt: Fix code style in setup.py
1c5170d3a466 pylibfdt: Rename libfdt.swig to libfdt.i
580a9f6c2880 Add a libfdt function to write a property placeholder
ab15256d8d02 pylibfdt: Use the call function to simplify the Makefile
9f2e3a3a1f19 pylibfdt: Use the correct libfdt version in the module
e91c652af215 pylibfdt: Enable installation of Python module
8a892fd85d94 pylibfdt: Allow building to be disabled
741cdff85d3e .travis.yml: Add builds with and without Python library prerequisites
14c4171f4f9a pylibfdt: Use package_dir to set the package directory
89a5062ab231 pylibfdt: Use environment to pass C flags and files
4e0e0d049757 pylibfdt: Allow pkg-config to be supplied in the environment
6afd7d9688f5 Correct typo: s/pylibgfdt/pylibfdt/

Signed-off-by: Rob Herring <robh@kernel.org>
2022-03-15 19:48:27 +01:00
Rob Herring
1b75083577 scripts/dtc: add fdt_overlay.c and fdt_addresses.c to sync script
libfdt has gained some new files. We need to include them in the
kernel's copy.

Reported-by: Kyle Yan <kyan@codeaurora.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2022-03-15 19:48:27 +01:00
Rob Herring
1d6129e70b dtc: update warning settings for new bus and node/property name checks
dtc gained new warnings checking PCI and simple buses, unit address
formatting, and stricter node and property name checking. Disable the
new dtc warnings by default as there are 1000s. As before, warnings are
enabled with W=1 or W=2. The strict node and property name checks are a
bit subjective, so they are only enabled for W=2.

Signed-off-by: Rob Herring <robh@kernel.org>
2022-03-15 19:48:17 +01:00
Maulik Shah
f84b182c20 cpuidle: Do not select menu and ladder governors
LPM is registered as cpuidle governor. Menu and ladder
governors are not in use. Remove them as they increase
boot up time.

Change-Id: I4a0d13aeb15932f5468704d12c1aa156aae1c507
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2022-03-15 19:02:51 +01:00
Demon000
de170cf95e video: backlight: disable modules enabled by default 2022-03-15 19:02:51 +01:00
Demon000
e94dc48101 media: gspca: disable gspca module 2022-03-15 19:02:51 +01:00
Demon000
ea5abdf2cd media: rc: disable geni ir module 2022-03-15 19:02:51 +01:00
Demon000
4aa9852394 net: disable bridge netfilter module 2022-03-15 19:02:51 +01:00
Demon000
bdc4b65344 net: ipv4: disable modules which are enabled by default 2022-03-15 19:02:50 +01:00
Demon000
0315432ed0 greybus: remove Android.mk file 2022-03-15 19:02:50 +01:00
Park Ju Hyung
f9cf463a34 qcacld-3.0: default_config: Tone down debugging
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: Iebfd389582217dbfb99a31b869d97c0af84c214d
2022-03-15 19:02:50 +01:00
Sultan Alsawaf
9fd26728f8 qcacld-3.0: Load driver during kernel init when not built as a module
Requiring userspace to write to /sys/kernel/boot_wlan/boot_wlan when
qcacld isn't built as a module is unnecessary. Loading this driver only
takes 1-2 ms, so we should just do so directly during kernel init.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: Ic0897d385b32b7a5401eced59608a2798266e4e9
2022-03-15 19:02:50 +01:00
Park Ju Hyung
eff39488d7 qcacld-3.0: Nuke Kconfig-based configuration entirely
This method of building qcacld isn't meant to be used and
causes conflicts with the new OEM profile configuration.

Configuration is now done with drivers/staging/qcacld-3.0/configs.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: I7f8930ac89c9192457ac4d5b77a1f72d656ddff2
2022-03-15 19:02:50 +01:00
Luca Stefani
c179fbd83b qcacld-3.0: Disable build timestamp
Change-Id: I8b917928671f14caedf2401eeb92ea07a184f351
2022-03-15 19:02:50 +01:00
LuK1337
00cd05deef drivers: staging: Include qcacld-3.0 source
* Also remove Android.mk as it overwrites our
  kernel source path.

Change-Id: I6bca60fec211d320c7fb2f1541daf225a1671715
2022-03-15 19:02:50 +01:00
Danny Lin
5880252e95 audio: Remove build timestamp injection
This causes parts of the audio module to be rebuilt during every
incremental build, even if there are no changes:

  CC      techpack/audio/ipc/apr.o - due to command line change
  CC      techpack/audio/ipc/apr_v2.o - due to command line change
  CC      techpack/audio/ipc/apr_tal_rpmsg.o - due to command line change
  CC      techpack/audio/ipc/wcd-dsp-glink.o - due to command line change

We're only experiencing this issue in techpack/audio/ipc at the moment,
but kill the timestamp injection in all the audio components to
eliminate the possibility of encountering this issue again in the
future. This is harmless since the injected BUILD_TIMESTAMP macro is
never used.

Change-Id: I35b588a2a902438b2c79ebbac31453f2e528bbbe
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2022-03-15 19:02:49 +01:00
Park Ju Hyung
dbda73f0ef audio: Load sm6150 configuration for sm6150 and sdmmagpie
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: Id75801293a7a61f774f1f97fce9f2a4a4638cfe3
2022-03-15 19:02:49 +01:00
AngeloGioacchino Del Regno
184f322d50 soc: snd_event: Declare is_snd_event_fwk_enabled func static
This function is included in more than one sound codec and anyway
it is supposed to be a static inline function...
2022-03-15 19:02:49 +01:00
AngeloGioacchino Del Regno
e23e45068b asoc: codecs: Kbuild: Include bolero codec in the build
The bolero codec is required by sm6150.

Change-Id: I7d1cb337d43ea75a053dd1ab99f7efc5df723f36
2022-03-15 19:02:49 +01:00
Yaroslav Furman
ee046b1819 soc: pinctrl-lpi: Initialise at late_initcall
Fixes booting with techpack online and modules disabled.
Without this it spits out a nasty NULL pointer dereference.

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: I05714d92d2631c2ae889db7995f64a10ddec9ef5
2022-03-15 19:02:49 +01:00
Angelo G. Del Regno
1546d2e785 soc: Fix headers links for in-kernel build
The links were hardcoded to an external path used for Android
only and expecting the kernel to be in a precise folder....

Got words?
I have none.
2022-03-15 19:01:48 +01:00
Rashed Abdel-Tawab
c236699e0b Set correct techpack header install directory
Change-Id: If957ea9cb2f3d6dda94ebdf4e804937f48fde15e
2022-03-15 19:01:39 +01:00
Cosmin Tanislav
80ad5f5fbf audio: Remove Android.mk files
Change-Id: I4e39c5980a96ed638958ca73a9a31b15c81978f6
2022-03-15 19:01:27 +01:00
Arian
7397dd5dc9 Add 'techpack/audio/' from commit '6ae17fb294e9a019be3cc4d43757583b0baa4563'
git-subtree-dir: techpack/audio
git-subtree-mainline: af20aa70b54b5b11c7e8235ef28ccf4094119051
git-subtree-split: 6ae17fb294e9a019be3cc4d43757583b0baa4563
2022-03-15 19:01:13 +01:00
Arian
af20aa70b5 Add 'drivers/staging/qcacld-3.0/' from commit '41d33b0546bc270aea6ab649bb8d720f33d3b42b'
git-subtree-dir: drivers/staging/qcacld-3.0
git-subtree-mainline: 6cfe03755c8dc2d9a64be6855dcb82eb974ec78b
git-subtree-split: 41d33b0546bc270aea6ab649bb8d720f33d3b42b
2022-03-15 19:01:04 +01:00
Arian
6cfe03755c Add 'drivers/staging/qca-wifi-host-cmn/' from commit 'cf9faafb00911ac3595221440ae0e235dae33ec2'
git-subtree-dir: drivers/staging/qca-wifi-host-cmn
git-subtree-mainline: 16831047e6b2292b6dcc95ecd7e2c74f0b7003df
git-subtree-split: cf9faafb00911ac3595221440ae0e235dae33ec2
2022-03-15 19:00:55 +01:00
Arian
16831047e6 Add 'drivers/staging/fw-api/' from commit '5ff275ff5c5735ff4a9341b7f549ad9044b6d8c7'
git-subtree-dir: drivers/staging/fw-api
git-subtree-mainline: 95cb0280299f9b41dce9fca831671b2719c50d4c
git-subtree-split: 5ff275ff5c5735ff4a9341b7f549ad9044b6d8c7
2022-03-15 19:00:42 +01:00
Greg Kroah-Hartman
2414f45b93 This is the 4.14.271 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmIrEsMACgkQONu9yGCS
 aT4N9hAAjBRls3hG9yy1+/CmfgTi9zxAU1OY8trPJd7gZJKtCR5wTfPDWm2Dui7+
 PE8CH0OGcY61Qk61b4Ct+MQwmRHjVNhB9x05KeOGZaGQffes9VOy0PHTFZ9GjlbK
 IjUlByzhKk8qOTKFAosj9QLceUdUvqCbdP1nIKhHweYUdBch86YuXh5MPUXIpgA/
 uO2NUOCF5mEGwq5p9hl3SmjUMnwkmYG6ARGANsEUnSSz5lP16gcOnB+mTlEgFHwV
 iRqERDSgfNNwKqveHlSDtVzCH/ijdNjCoBd5N4fOms5isrDyBHnsSLL3VJZtmCJG
 tqgO+Uui9PsCz7RTM2CUyfCb6CVo6ix/C5jSZzmoTOYi5IBh8Iae87P0oR0teYMH
 MfucF1CLTZ3OFOHXhphoLpkryVUh+xv7K1HDJ3bG7HUqcRX1jG/E5DAg6SG4oTEO
 UMv/RlwNhhvRMQlltMQnrpSwiJOJQVmrXthimlOCHhtNXvYR42PBrs6i8/7KVhLC
 jLMIkf2aL6hzSqEwjHgg+hGdYR3Z9uvFt49/GpMqmBeRu0+BHCp2kZ6R+8g3/CB2
 mGaZCk1Ard0Xb1uVPldcIz+jBwbSkHFLNbgrUm/d4TJjlChgBcmcaT+/BV0YrZfK
 hzYYYlR2jN0qTZBTHUM0ci8nQFDEwT5oi1LM6sHOTgiCSX7hFTI=
 =0edC
 -----END PGP SIGNATURE-----

Merge 4.14.271 into android-4.14-stable

Changes in 4.14.271
	x86/speculation: Merge one test in spectre_v2_user_select_mitigation()
	x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
	x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE
	x86/speculation: Add eIBRS + Retpoline options
	Documentation/hw-vuln: Update spectre doc
	x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
	x86/speculation: Use generic retpoline by default on AMD
	x86/speculation: Update link to AMD speculation whitepaper
	x86/speculation: Warn about Spectre v2 LFENCE mitigation
	x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT
	arm/arm64: Provide a wrapper for SMCCC 1.1 calls
	arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
	ARM: report Spectre v2 status through sysfs
	ARM: early traps initialisation
	ARM: use LOADADDR() to get load address of sections
	ARM: Spectre-BHB workaround
	ARM: include unprivileged BPF status in Spectre V2 reporting
	ARM: fix build error when BPF_SYSCALL is disabled
	ARM: fix co-processor register typo
	ARM: Do not use NOCROSSREFS directive with ld.lld
	ARM: fix build warning in proc-v7-bugs.c
	xen/xenbus: don't let xenbus_grant_ring() remove grants in error case
	xen/grant-table: add gnttab_try_end_foreign_access()
	xen/blkfront: don't use gnttab_query_foreign_access() for mapped status
	xen/netfront: don't use gnttab_query_foreign_access() for mapped status
	xen/scsifront: don't use gnttab_query_foreign_access() for mapped status
	xen/gntalloc: don't use gnttab_query_foreign_access()
	xen: remove gnttab_query_foreign_access()
	xen/9p: use alloc/free_pages_exact()
	xen/gnttab: fix gnttab_end_foreign_access() without page specified
	xen/netfront: react properly to failing gnttab_end_foreign_access_ref()
	Linux 4.14.271

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9f41bca7a4638913cfd2b97006d19185dd9bf584
2022-03-11 11:13:06 +01:00
Greg Kroah-Hartman
af48f51cb5 Linux 4.14.271
Link: https://lore.kernel.org/r/20220309155856.090281301@linuxfoundation.org
Link: https://lore.kernel.org/r/20220310140807.524313448@linuxfoundation.org
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:34 +01:00
Juergen Gross
1b9f411573 xen/netfront: react properly to failing gnttab_end_foreign_access_ref()
Commit 66e3531b33ee51dad17c463b4d9c9f52e341503d upstream.

When calling gnttab_end_foreign_access_ref() the returned value must
be tested and the reaction to that value should be appropriate.

In case of failure in xennet_get_responses() the reaction should not be
to crash the system, but to disable the network device.

The calls in setup_netfront() can be replaced by calls of
gnttab_end_foreign_access(). While at it avoid double free of ring
pages and grant references via xennet_disconnect_backend() in this case.

This is CVE-2022-23042 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:33 +01:00
Juergen Gross
94b8ccbcc0 xen/gnttab: fix gnttab_end_foreign_access() without page specified
Commit 42baefac638f06314298087394b982ead9ec444b upstream.

gnttab_end_foreign_access() is used to free a grant reference and
optionally to free the associated page. In case the grant is still in
use by the other side processing is being deferred. This leads to a
problem in case no page to be freed is specified by the caller: the
caller doesn't know that the page is still mapped by the other side
and thus should not be used for other purposes.

The correct way to handle this situation is to take an additional
reference to the granted page in case handling is being deferred and
to drop that reference when the grant reference could be freed
finally.

This requires that there are no users of gnttab_end_foreign_access()
left directly repurposing the granted page after the call, as this
might result in clobbered data or information leaks via the not yet
freed grant reference.

This is part of CVE-2022-23041 / XSA-396.

Reported-by: Simon Gaiser <simon@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:33 +01:00
Juergen Gross
22fd4f3fc1 xen/9p: use alloc/free_pages_exact()
Commit 5cadd4bb1d7fc9ab201ac14620d1a478357e4ebd upstream.

Instead of __get_free_pages() and free_pages() use alloc_pages_exact()
and free_pages_exact(). This is in preparation of a change of
gnttab_end_foreign_access() which will prohibit use of high-order
pages.

By using the local variable "order" instead of ring->intf->ring_order
in the error path of xen_9pfs_front_alloc_dataring() another bug is
fixed, as the error path can be entered before ring->intf->ring_order
is being set.

By using alloc_pages_exact() the size in bytes is specified for the
allocation, which fixes another bug for the case of
order < (PAGE_SHIFT - XEN_PAGE_SHIFT).

This is part of CVE-2022-23041 / XSA-396.

Reported-by: Simon Gaiser <simon@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:33 +01:00
Juergen Gross
9a7fa4be28 xen: remove gnttab_query_foreign_access()
Commit 1dbd11ca75fe664d3e54607547771d021f531f59 upstream.

Remove gnttab_query_foreign_access(), as it is unused and unsafe to
use.

All previous use cases assumed a grant would not be in use after
gnttab_query_foreign_access() returned 0. This information is useless
in best case, as it only refers to a situation in the past, which could
have changed already.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:33 +01:00
Juergen Gross
a37eb07798 xen/gntalloc: don't use gnttab_query_foreign_access()
Commit d3b6372c5881cb54925212abb62c521df8ba4809 upstream.

Using gnttab_query_foreign_access() is unsafe, as it is racy by design.

The use case in the gntalloc driver is not needed at all. While at it
replace the call of gnttab_end_foreign_access_ref() with a call of
gnttab_end_foreign_access(), which is what is really wanted there. In
case the grant wasn't used due to an allocation failure, just free the
grant via gnttab_free_grant_reference().

This is CVE-2022-23039 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:33 +01:00
Juergen Gross
bbf2a869c3 xen/scsifront: don't use gnttab_query_foreign_access() for mapped status
Commit 33172ab50a53578a95691310f49567c9266968b0 upstream.

It isn't enough to check whether a grant is still being in use by
calling gnttab_query_foreign_access(), as a mapping could be realized
by the other side just after having called that function.

In case the call was done in preparation of revoking a grant it is
better to do so via gnttab_try_end_foreign_access() and check the
success of that operation instead.

This is CVE-2022-23038 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:32 +01:00
Juergen Gross
fbb5d5edd2 xen/netfront: don't use gnttab_query_foreign_access() for mapped status
Commit 31185df7e2b1d2fa1de4900247a12d7b9c7087eb upstream.

It isn't enough to check whether a grant is still being in use by
calling gnttab_query_foreign_access(), as a mapping could be realized
by the other side just after having called that function.

In case the call was done in preparation of revoking a grant it is
better to do so via gnttab_end_foreign_access_ref() and check the
success of that operation instead.

This is CVE-2022-23037 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:32 +01:00
Juergen Gross
60dd3ab592 xen/blkfront: don't use gnttab_query_foreign_access() for mapped status
Commit abf1fd5919d6238ee3bc5eb4a9b6c3947caa6638 upstream.

It isn't enough to check whether a grant is still being in use by
calling gnttab_query_foreign_access(), as a mapping could be realized
by the other side just after having called that function.

In case the call was done in preparation of revoking a grant it is
better to do so via gnttab_end_foreign_access_ref() and check the
success of that operation instead.

For the ring allocation use alloc_pages_exact() in order to avoid
high order pages in case of a multi-page ring.

If a grant wasn't unmapped by the backend without persistent grants
being used, set the device state to "error".

This is CVE-2022-23036 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:32 +01:00
Juergen Gross
1b2f59f854 xen/grant-table: add gnttab_try_end_foreign_access()
Commit 6b1775f26a2da2b05a6dc8ec2b5d14e9a4701a1a upstream.

Add a new grant table function gnttab_try_end_foreign_access(), which
will remove and free a grant if it is not in use.

Its main use case is to either free a grant if it is no longer in use,
or to take some other action if it is still in use. This other action
can be an error exit, or (e.g. in the case of blkfront persistent grant
feature) some special handling.

This is CVE-2022-23036, CVE-2022-23038 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:13:32 +01:00