CONFIG_CFI_CLANG breaks cross-module function address equality, which
breaks virtio_dma_buf as it compares a locally taken function address to
a one passed from a different module. Remove these sanity checks for now
to allow Cuttlefish to boot with CFI.
Bug: 178495907
Bug: 199547335
Change-Id: I508e2fa9e3ddd888dc2fdb743cec20a400eaf1f5
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Alistair Delva <adelva@google.com>
Commit 865c50e1d2 ("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT")
added an optimised version of __get_user_asm() for x86 using 'asm goto'.
Like the non-optimised code, the 32-bit implementation of 64-bit get_user()
expands to a pair of 32-bit accesses. Unlike the non-optimised code, the
_original_ pointer is incremented to copy the high word instead of loading
through a new pointer explicitly constructed to point at a 32-bit type.
Consequently, if the pointer points at a 64-bit type then we end up
loading the wrong data for the upper 32-bits.
This was observed as a mount() failure in Android targetting i686 after
b0cfcdd9b9 ("d_path: make 'prepend()' fill up the buffer exactly on
overflow") because the call to copy_from_kernel_nofault() from
prepend_copy() ends up in __get_kernel_nofault() and casts the source
pointer to a 'u64 __user *'. An attempt to mount at "/debug_ramdisk"
therefore ends up failing trying to mount "/debumdismdisk".
Use the existing '__gu_ptr' source pointer to unsigned int for 32-bit
__get_user_asm_u64() instead of the original pointer.
Fixes: 865c50e1d2 ("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT")
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210913163547.5156-1-will@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I652ecff43caf258bd0aa31e52fdd58f9461b9e46
This reverts commit c30036e2ec.
Reason for revert: Causes boot failure on kernel_virt_aarch64
Bug: 199547335
Test: revert and boot of aarch64 GKI on arm64 cf
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: I4fb34e19e85e661b28f40b2de53b063436838eab
After commit f80fb3a3d5 ("arm64: add support for kernel ASLR")
The module range is determined by module_alloc_base and MODULES_VSIZE;
Fixes: f0c48487a5 ("ANDROID: kernel: add module info for debug_kinfo")
Bug: 191677481
Bug: 191767613
Bug: 199478594
Signed-off-by: Jone Chou <jonechou@google.com>
Change-Id: Id41d95cfba01e8e5502d058f98e30ecbaf52abe4
Enable CONFIG_MEMCG config to provide a way to use memory cgroups with
GKI kernels. If not needed, memcgs can be disabled using
"group_disable=memory" kernel command-line option.
Bug: 191223209
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ife5cfe17576d92ac116dabd1a118bc0bb013b26f
Enable CONFIG_HIST_TRIGGERS which will be useful
in various perf evaluations.
Bug: 185890730
Change-Id: Ia4c140863ce248fea0dd235ca8a9cdee1176f8ed
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
This change adds I3C core support, as we have need it for
I3C master driver development and support.
Bug: 187575084
Change-Id: Ida6ed02e3059a341f99d8e9bb3216ad3cc0c2b47
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
Devices with plenty of RAM may benefit from THP usage. Enable THP while
setting CONFIG_TRANSPARENT_HUGEPAGE_MADVISE require explicit opt-in for
the feature by default in sysfs.
Bug: 179484689
Bug: 179223738
Signed-off-by: Collin Fijalkovich <cfijalkovich@google.com>
Change-Id: If85765daba3817dac38e7bf29530acfaed1d50a3
Steps on the way to 5.15-rc1
Fixes merge conflicts in:
scripts/Makefile.lib
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I12b5165860a212fb39c98504a0729f1bab52ab54
Steps on the way to 5.15-rc1.
Resolves merge conflicts in:
arch/arm64/kernel/process.c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3cfadd5edf7a45d45eca6a26fd62cb0f23697208
Steps on the way to 5.15-rc1
Resolves merge conflicts in:
drivers/firmware/Makefile
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icdf4539d0985fd5a3430455c3a2b603b2b456a44
Steps on the way to 5.15-rc1
Resolves merge conflicts in:
drivers/misc/Makefile
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I102636df13eb6320bb7ad739cbb4b82084fe078e
This reverts commit 44043ee002.
printk_deferred() is about to become a #define, so having it be an
exported symbol will break the build.
Bug: 172264047
Fixes: 44043ee002 ("ANDROID: printk: printk_deferred for modules")
Cc: Sai Harshini Nimmala <snimmala@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I45d16f936646c4cecbfe541175e0d3929a736432
Fix the following compiler warning caused by STATUSTYPE_IMA being added
upstream:
drivers/md/dm-bow.c: In function ‘dm_bow_status’:
drivers/md/dm-bow.c:1239:2: warning: enumeration value ‘STATUSTYPE_IMA’ not handled in switch [-Wswitch]
1239 | switch (type) {
| ^~~~~~
Until IMA data is defined for this target (currently there is no need to
do so), the right thing to do is to just return an empty string.
This should be folded into ANDROID-dm-bow-Add-dm-bow-feature.patch.
Bug: 129280212
Fixes: bc2f6edebd ("Merge 9e9fb7655e ("Merge tag 'net-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") into android-mainline")
Change-Id: I8b0e7c9d67f20071cdad8e7cb6940a9e35623e31
Signed-off-by: Eric Biggers <ebiggers@google.com>
Fix the following compiler warning caused by STATUSTYPE_IMA being added
upstream:
drivers/md/dm-default-key.c: In function ‘default_key_status’:
drivers/md/dm-default-key.c:328:2: warning: enumeration value ‘STATUSTYPE_IMA’ not handled in switch [-Wswitch]
328 | switch (type) {
| ^~~~~~
Until IMA data is defined for this target (currently there is no need to
do so), the right thing to do is to just return an empty string.
This should be folded into
ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch.
Bug: 160885805
Reported-by: John Stultz <john.stultz@linaro.org>
Fixes: bc2f6edebd ("Merge 9e9fb7655e ("Merge tag 'net-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") into android-mainline")
Change-Id: Ia38ee61a6864ff256bc22f98a4263292a6eca908
Signed-off-by: Eric Biggers <ebiggers@google.com>
Due to upstream commit da521626ac ("bio: optimize initialization of a
bio"), the bi_skip_dm_default_key field is no longer being initialized,
which breaks dm-default-key. Make bio_init() initialize it.
This should be folded into
ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch.
Bug: 160885805
Reported-by: John Stultz <john.stultz@linaro.org>
Fixes: dc39b05494 ("Merge 916d636e0a ("Merge tag 'vfs-5.15-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux") into android-mainline")
Change-Id: I79310f63e38497db7953c50b3e90013aa6679d31
Signed-off-by: Eric Biggers <ebiggers@google.com>
This hunk should not have been retained.
This re-aligns with Mainline.
Fixes: 3cc02cd189 ("Revert "ANDROID: add extra free kbytes tunable"")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I04ad519f03784fed1ad2f9ff3fa4fff2bc9ea5de
This re-aligns with Mainline.
Fixes: 3cc02cd189 ("Revert "ANDROID: add extra free kbytes tunable"")
Change-Id: Ia1a8e48415b42dae767ca7b1c59263863eb85cd3
Signed-off-by: Lee Jones <lee.jones@linaro.org>
These are implicitly enabled via ARCH_EXYNOS, rendering them superfluous.
Bug: 142159113
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I9cda8c23e448e0dbe3770fadb14b12c3ce59e708
Now that commit 2344019e04 ("ANDROID: arm64: gki_defconfig: Enable
ARCH_EXYNOS") has enabled the ARCH_EXYNOS symbol we can replace the
'depends on' line in SERIAL_SAMSUNG's Kconfig entry.
This brings the entry back inline with the upstream version.
Bug: 142159113
Change-Id: I7bbf9d94d77f6771d3594a46d3043c6f15a53685
Signed-off-by: Lee Jones <lee.jones@linaro.org>
commit fad7cd3310 ("nbd: add the check to prevent overflow in __nbd_ioctl()")
exposed something that's long been broken for semi-hosted environments
like the kernel in Clang:
check_mul_overflow() is implemented in terms of
__builtin_mul_overflow(). For 64b operands on 32b hosts, LLVM was
emitting libcalls to __mulodi4() which assumes that compiler-rt is being
linked against. The kernel does not do so, so LLVM was emitting calls to
functions that have no definition, resulting in the linkage failure:
ERROR: modpost: "__mulodi4" [drivers/block/nbd.ko] undefined!
I have been fixing LLVM upstream, see the six fixes linked from:
https://bugs.llvm.org/show_bug.cgi?id=28629#c23.
I still need to detect older toolchains that we'd still like to support,
then find an appropriate workaround for the kernel.
Disable network block devices for now, so that we don't lose coverage of
32b ARM allmodconfig builds which are currently red in our CI.
Bug: 199191028
Link: https://github.com/ClangBuiltLinux/linux/issues/1438
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I79a597177f75370f60621b984cb8e21ca2a268d6
Run CtsNetTestCases in presubmit for changes in net/ and
include/net/.
Bug: 186664401
Change-Id: I3cf942bd0418ad55a6559d6933927b0da86da595
Signed-off-by: Steve Muckle <smuckle@google.com>
The isa_bus_to_virt is only needed under X86 and in fact the code
that sets the ibft_phys_addr is only compiled under X86.
As such lets just ifdef the code.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
CC: Maurizio Lombardi <mlombard@redhat.com>
CC: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Change-Id: I68b691cbd2f9f44fe8c876a303c5e4a2c38df82b
---
v2: Remove the ibft_phys_addr as it is defined in iscsi_ibft.h
(cherry picked from commit 799206c130)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
After commit 342f43af70 ("iscsi_ibft: fix crash due to KASLR physical
memory remapping") x86_64_defconfig shows the following errors:
arch/x86/kernel/setup.c: In function ‘setup_arch’:
arch/x86/kernel/setup.c:916:13: error: implicit declaration of function ‘acpi_mps_check’ [-Werror=implicit-function-declaration]
916 | if (acpi_mps_check()) {
| ^~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1110:9: error: implicit declaration of function ‘acpi_table_upgrade’ [-Werror=implicit-function-declaration]
1110 | acpi_table_upgrade();
| ^~~~~~~~~~~~~~~~~~
[... more acpi noise ...]
acpi.h was being implicitly included from iscsi_ibft.h in this
configuration so the removal of that header means these functions have
no definition or declaration.
In most other configurations, <linux/acpi.h> continued to be included
through at least <linux/tboot.h> if CONFIG_INTEL_TXT was enabled, and
there were probably other implicit include paths too.
Add acpi.h explicitly so there is no more error, and so that we don't
continue to depend on these unreliable implicit include paths.
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Cc: Maurizio Lombardi <mlombard@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit ea7b4244b3)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia142a20a3ffebc4e9579a0551b67b8d2f3457a92
Just like the presently enabled ARCH_QCOM, ARCH_SUNXI and ARCH_HISI
symbols, ARCH_EXYNOS based platforms require drivers which currently
depend on the symbol being enabled.
A recent attempt to remove one of these dependencies was firmly NACKed
by a bunch of upstream Maintainers [0], with one of them stating that
ARCH_EXYNOS should be enabled by any generic kernel which planned on
supporting the associated platforms.
Once this has been applied, we can revert the associated hacks we're
currently carrying in android-mainline.
[0] https://lore.kernel.org/lkml/20200220102628.3371996-1-gregkh@linuxfoundation.org/
Bug: 142159113
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I1277f173c1a39c1cdd23bca27ee5f0deb784e3fb
Steps on the way to 5.15-rc1
Resolves conflicts in:
fs/iomap/direct-io.c
Cc: Eric Biggers <ebiggers@google.com>
Cc: Satya Tangirala <satyat@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4e366229a4dc6a150c840fc488feb0bc7cfe9716
In commit edb0872f44 ("block: move the bdi from the request_queue to
the gendisk"), the backing device info moved .h files which breaks the
building of incfs. Fix this up like was done for fat, just include the
correct .h file.
Fixes: edb0872f44 ("block: move the bdi from the request_queue to the gendisk")
CC: Paul Lawrence <paullawrence@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iccc990b1b01af4580192921410b915b91dc6a155
This reverts portions of commit 9ad8ff902e
The mutex code is rewritten in 5.15-rc1, so hooks like this are no
longer in the correct location, if even needed at all. So remove them
for now, if vendors still need them, they can add them back in.
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib85c108e5bb306faea4fef5e0ca3b617a7f8f5c6
This reverts commit e289faa9f1.
The mutex code is rewritten in 5.15-rc1, so hooks like this are no
longer in the correct location, if even needed at all. So remove them
for now, if vendors still need them, they can add them back in.
Cc: JINHO LIM <jordan.lim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idceef90a86c8794008e2f013d6ff958142661572
Pull configfs updates from Christoph Hellwig:
- fix a race in configfs_lookup (Sishuai Gong)
- minor cleanups (me)
* tag 'configfs-5.15' of git://git.infradead.org/users/hch/configfs:
configfs: fix a race in configfs_lookup()
configfs: fold configfs_attach_attr into configfs_lookup
configfs: simplify the configfs_dirent_is_ready
configfs: return -ENAMETOOLONG earlier in configfs_lookup
Pull dlm updates from David Teigland:
"This set includes a number of minor fixes and cleanups related to the
networking changes in the last release.
A patch to delay ack messages reduces network traffic significantly"
* tag 'dlm-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
fs: dlm: avoid comms shutdown delay in release_lockspace
fs: dlm: fix return -EINTR on recovery stopped
fs: dlm: implement delayed ack handling
fs: dlm: move receive loop into receive handler
fs: dlm: fix multiple empty writequeue alloc
fs: dlm: generic connect func
fs: dlm: auto load sctp module
fs: dlm: introduce generic listen
fs: dlm: move to static proto ops
fs: dlm: introduce con_next_wq helper
fs: dlm: cleanup and remove _send_rcom
fs: dlm: clear CF_APP_LIMITED on close
fs: dlm: fix typo in tlv prefix
fs: dlm: use READ_ONCE for config var
fs: dlm: use sk->sk_socket instead of con->sock