Thanks to commit dcb7c0b946 ("hardening: Clarify Kconfig text for
auto-var-init"), CONFIG_INIT_STACK_ALL_ZERO is now automatically
selected depending on the compiler's support for it, so it is not longer
needed to explicitly enable it in the config file.
Fixes: dcb7c0b946 ("hardening: Clarify Kconfig text for auto-var-init")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9df386f22d3a24ae0f9ab4da2e0ab35277a48f17
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>