724270 Commits

Author SHA1 Message Date
LuK1337
a30605a54f muic: muic_afc: Return proper value after setting afc_disable
...otherwise android::base::WriteStringToFile() will keep retrying
indefinitely in case kernel can't write to the param partition.

Change-Id: Iec9d2a317182f484307759ce9f196d85848c10bf
2025-08-14 22:18:42 +00:00
Tim Zimmermann
3bd135d694 ARM64: dts: Disable dex touchpad support
* As of U QPR3 this makes a mouse pointer show up on lockscreen after boot,
  until the device is touched

Change-Id: Ie68f0b693f0786e8f90d3703a0ae500d8c58bbeb
2025-01-01 15:16:37 +01:00
LuK1337
c3447b8cf4 ARM64: vdso32: Hardcode toolchain target
Fixes the following error when building with clang r530567:
error: version 'kernel' in target triple 'arm-unknown-linux-androidkernel' is invalid

Change-Id: I5a2d27bf0e8a22b2fe752c64efc0cc91c790b5f0
2024-12-18 18:52:11 +01:00
Chung-Hsien Hsu
9b7ffd7b43 nl80211: add WPA3 definition for SAE authentication
Add definition of WPA version 3 for SAE authentication.

Change-Id: I19ca34b8965168f011cc1352eba420f2d54b0258
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-12-14 11:34:43 +01:00
Rick Yiu
16026dfb9b ARM64: configs: Enable CFQ group schedule
Test: function enabled correctly
Bug: 112242999
Change-Id: Iee61f684836691f1758beb61c0f491f42c06c40e
Signed-off-by: Rick Yiu <rickyiu@google.com>
2024-06-30 11:01:14 +01:00
Swetha Chikkaboraiah
ce9b4fca75 defconfig: gts4lv/gts4lvwifi: Enable OverlayFS
OverlayFS is needed to be enabled to align with the
latest android base config.

Change-Id: Ibf7cb8e75a7858841f9fc0b5ea84c4ec4db666f8
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2023-12-26 17:09:11 +00:00
Andrey Sprynga
a46d5d6646 ARM64: dts: Fully remove fstab mounting for sdm670 devices
Signed-off-by: Andrey Sprynga <rtx4d@aospa.co>
Change-Id: Ice7f1108c41bb325e3db99aa4ef5a3c12c3c7c41
2023-10-24 16:48:09 +00:00
Sebastiano Barezzi
902de054b3 defconfig: gts4lv: Enable CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
Change-Id: I22b5eb981c886d9280957f6bd1047fc76ac9916b
2023-10-24 16:48:05 +00:00
Sebastiano Barezzi
60ea96fa56 init: Add CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
* Ignoring an ignore flag, yikes
* Also replace skip_initramf with want_initramf (omitting last letter for Magisk since it binary patches that out of kernel, I'm not even sure why we're supporting that mess)

Co-authored-by: Erfan Abdi <erfangplus@gmail.com>
Change-Id: Ifdf726f128bc66bf860bbb71024f94f56879710f
2023-10-24 16:48:02 +00:00
LuK1337
a602e03b87 treewide: sec: Address clang-17 build warnings
Change-Id: I3f29a36cfc89fbb9ecc4b4bfbf5c05eac4408dd4
2023-10-24 16:47:59 +00:00
vantoman
354a0b5336 ipa_v3: Fix enum conversion warnings
clang-15 complains:
drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c:499:41: error: implicit
conversion from enumeration type 'enum ipa_ip_type_enum_v01'
to different enumeration type 'enum ipa_ip_type'
[-Werror,-Wenum-conversion]
        q6_ul_flt_rule_ptr->ip = flt_spec_ptr->ip_type;
                               ~ ~~~~~~~~~~~~~~^~~~~~~
drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c:500:45: error: implicit
conversion from enumeration type 'enum ipa_filter_action_enum_v01'
to different enumeration type 'enum ipa_flt_action'
[-Werror,-Wenum-conversion]
        q6_ul_flt_rule_ptr->action = flt_spec_ptr->filter_action;
                                   ~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~
2 errors generated.

Change-Id: I7a40b0d7b082836670b6551f2a04aa141d240153
2023-10-24 16:47:56 +00:00
Nathan Chancellor
2539bc4ff6 icnss: Fix enum-conversion warning from Clang
../drivers/soc/qcom/icnss.c:3154:37: warning: implicit conversion from
enumeration type 'enum icnss_driver_mode' to different enumeration type
'enum wlfw_driver_mode_enum_v01' [-Wenum-conversion]
        ret = wlfw_wlan_mode_send_sync_msg(mode);
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~
1 warning generated.

Change-Id: I7ff0326411b4b2a6e020cf50bc655ec26c1e4992
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2023-10-24 16:47:52 +00:00
Tashfin Shakeer Rhythm
973bb52d1b qca-wifi-host-cmn: Add void keyword to old-style zero prototype functions
Newer clang builds complain about old-style function declarations
not having any prototype assigned. The missing `void` is triggering
the Wstrict-prototype warns. Explicitly add the `void` keyword to
satisfy the compiler.

This fixes the following warnings:

drivers/staging/qca-wifi-host-cmn/hif/src/ce/ce_service_legacy.c:
1288:34: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct ce_ops *ce_services_legacy()
                                 ^
                                  void
drivers/staging/qca-wifi-host-cmn/hif/src/ce/ce_service_srng.c:1017:32:
error: a function declaration without a prototype is deprecated in all
versions of C [-Werror,-Wstrict-prototypes]
struct ce_ops *ce_services_srng()
                               ^
                                void
drivers/staging/qca-wifi-host-cmn/target_if/core/src/target_if_main.c:
88:40: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct target_if_ctx *target_if_get_ctx()
                                       ^
                                        void

Change-Id: Ifd95b57d19a25f0932e5de8ec4de2f2c1e7e1259
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
2023-10-24 16:47:46 +00:00
andhu
6d35c17ee1 qcacld-3.0: Fix compile error of mdie
Fix compile error of mdie[SIR_MDIE_SIZE], use
mdie[] instead.

Change-Id: I934d3f02a19b511583141deeca7af5b4d4c0ef30
CRs-Fixed: 3364146
2023-10-24 17:25:48 +01:00
Bruno Martins
f54c11a5fe arm64: vdso32: Allow building with LLVM integrated AS
Change-Id: I8bfc0e53b4bd347adaa298594402a2210aed3b49
2023-10-24 17:25:48 +01:00
Nick Desaulniers
4969867afb arm64: vdso32: suppress error message for 'make mrproper'
commit 14831fad73f5ac30ac61760487d95a538e6ab3cb upstream.

When running the following command without arm-linux-gnueabi-gcc in
one's $PATH, the following warning is observed:

$ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 mrproper
make[1]: arm-linux-gnueabi-gcc: No such file or directory

This is because KCONFIG is not run for mrproper, so CONFIG_CC_IS_CLANG
is not set, and we end up eagerly evaluating various variables that try
to invoke CC_COMPAT.

This is a similar problem to what was observed in
commit dc960bfeedb0 ("h8300: suppress error messages for 'make clean'")

Reported-by: Lucas Henneman <henneman@google.com>
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Change-Id: I672930f558d087230c119ece518b83cac7d8baa7
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20211019223646.1146945-4-ndesaulniers@google.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-24 17:25:48 +01:00
Stephen Boyd
f839fba169 ARM64: vdso32: Install vdso32 from vdso_install
[ Upstream commit 8d75785a814241587802655cc33e384230744f0c ]

Add the 32-bit vdso Makefile to the vdso_install rule so that 'make
vdso_install' installs the 32-bit compat vdso when it is compiled.

Fixes: a7f71a2c8903 ("arm64: compat: Add vDSO")
Change-Id: I554988049d9f4395d226988a410a0a68eeed304d
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Will Deacon <will@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20200818014950.42492-1-swboyd@chromium.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-24 17:25:48 +01:00
Will Deacon
b1f3725520 arm64: vdso32: Don't use KBUILD_CPPFLAGS unconditionally
KBUILD_CPPFLAGS is defined differently depending on whether the main
compiler is clang or not. This means that it is not possible to build
the compat vDSO with GCC if the rest of the kernel is built with clang.

Define VDSO_CPPFLAGS directly to break this dependency and allow a clang
kernel to build a compat vDSO with GCC:

  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
    CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- CC=clang \
    COMPATCC=arm-linux-gnueabihf-gcc

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Change-Id: Iaa7f6197bc99ca5c8162c6e34e3dd38c31d894cd
Signed-off-by: Will Deacon <will@kernel.org>
2023-10-24 17:25:48 +01:00
Vincenzo Frascino
10faadba46 arm64: vdso32: Remove jump label config option in Makefile
The jump labels are not used in vdso32 since it is not possible to run
runtime patching on them.

Remove the configuration option from the Makefile.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Change-Id: Ie0f311218a761a6b18b3ed3cccf30fd10f440407
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
2023-10-24 17:25:48 +01:00
LuK1337
adf1e580f7 hid: samsung: Remove bluetooth devices from samsung_devices
This driver only supports USB devices and listing BT ones prevents
generic driver from registering them instead.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5851
Change-Id: I467f85632375a742cd2170ae0edc8b04ddc1a946
2023-07-29 15:01:00 +02:00
Lincoln Tran
dfce365d1d qcacld-3.0: Add pointer check before dereferencing
Make sure the parsed association request array is valid at the
association ID index, before dereferencing it. This will prevent NULL
pointer deref. There is already a check for the beginning of the parsed
assoc req array, but it is not checking at the assoc ID index.

Change-Id: Icac3b2a4a0646dec4c64a2224e3271b0842a8194
CRs-Fixed: 3147273
2023-03-26 12:53:41 +01:00
Wu Gao
dbc54477e4 qcacmn: Check cookie and avoid to read out of bound
Read out of bound due to invalid cookie and cause device broken. This
change checks cookie before using it as index of DBR buffer pool.

Change-Id: I1abc7d771cc62a7dd2dfe98784bf8ef2710f26ca
CRs-Fixed: 3144133
2023-03-26 12:50:23 +01:00
chunquan
0a0f562c0c qcacld-3.0: Fix out-of-bounds in tx_stats
The tx_stats array length num_entries can't be more than
param_buf->num_tx_stats from fw.
Otherwies out-of-bounds will happen when read wmi_tx_stats.

Change-Id: I7ab3c7cc7baef6d903ba6301622bd67efe52cebe
CRs-Fixed: 3104318
2023-03-26 12:47:16 +01:00
Albert I
9d3ff9ea55 ARM64/errata: Ensure vulnerable CPUs are actually flagged on is_spectrev2_safe()
This updates logic introduced by commit 0d2ce644 to ensure affected CPUs
are properly flagged as affected by Spectre BHB, either by SMCCC or PSCI
methods of detection.

Signed-off-by: Albert I <kras@raphielgang.org>
[jjpprrrr: change !(A || B) to (!B && !A) to take advantage of short
circuit when B (PSCI) is the more likely case]
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I1da47886c5e1f1331ece977813ae3ec832d13af3
2023-03-26 12:37:05 +01:00
Albert I
4d8704d806 ARM64/errata: Check arm64_psci_bp_harden_cpus list too for is_spectrev2_safe()
If PSCI_BP_HARDENING is set, Kryo 2xx/3xx Gold targets will be on this list
instead of the default arm64_bp_harden_smccc_cpus list.

Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: Ida0d3720fb76e02ac0774719fa002c17abc86173
2023-03-26 12:37:05 +01:00
Albert I
8e315b5a68 ARM64/errata: Kryo 2xx/3xx Gold might be affected by Spectre BHB
As they're based off Cortex-A73 and Cortex-A75 respectively, which are
vulnerable.

Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: I9df8865bbc89a47267e5d2bd965c86a690fc4d88
2023-03-26 12:37:05 +01:00
Austin Kim
6da256232c mm/vmalloc.c: move 'area->pages' after if statement
commit 7ea362427c170061b8822dd41bafaa72b3bcb9ad upstream.

If !area->pages statement is true where memory allocation fails, area is
freed.

In this case 'area->pages = pages' should not executed.  So move
'area->pages = pages' after if statement.

Change-Id: I5eeec0c15312fabba296781ad1fddcf60f6e23be
[akpm@linux-foundation.org: give area->pages the same treatment]
Link: http://lkml.kernel.org/r/20190830035716.GA190684@LGEARND20B15
Signed-off-by: Austin Kim <austindh.kim@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Roman Penyaev <rpenyaev@suse.de>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-26 12:37:05 +01:00
Todd Kjos
778469ace0 UPSTREAM: binder: add flag to clear buffer on txn complete
Add a per-transaction flag to indicate that the buffer
must be cleared when the transaction is complete to
prevent copies of sensitive data from being preserved
in memory.

Signed-off-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20201120233743.3617529-1-tkjos@google.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 171501513
Change-Id: Ic9338c85cbe3b11ab6f2bda55dce9964bb48447a
(cherry picked from commit 0f966cba95c78029f491b433ea95ff38f414a761)
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2023-03-26 12:09:05 +01:00
Martijn Coenen
01ad2bbbd5 FROMGIT: binder: print warnings when detecting oneway spamming.
The most common cause of the binder transaction buffer filling up is a
client rapidly firing oneway transactions into a process, before it has
a chance to handle them. Yet the root cause of this is often hard to
debug, because either the system or the app will stop, and by that time
binder debug information we dump in bugreports is no longer relevant.

This change warns as soon as a process dips below 80% of its oneway
space (less than 100kB available in the configuration), when any one
process is responsible for either more than 50 transactions, or more
than 50% of the oneway space.

Signed-off-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20200821122544.1277051-1-maco@android.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 261e7818f06ec51e488e007f787ccd7e77272918
git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/
char-misc-next)

Bug: 147795659
Change-Id: Idc2b03ddc779880ca4716fdae47a70df43211f25
2023-03-26 12:09:05 +01:00
Todd Kjos
08134bba7a ANDROID: increase limit on sched-tune boost groups
Some devices need an additional sched-tune boost group to
optimize performance for key tasks

Bug: 150302001
Change-Id: I392c8cc05a8851f1d416c381b4a27242924c2c27
Signed-off-by: Todd Kjos <tkjos@google.com>
2023-03-26 12:09:05 +01:00
Jaegeuk Kim
834a07c181 FROMGIT: dm: do not allow readahead to limit IO size
Update DM to set the bdi's io_pages.  This fixes reads to be capped at
the device's max request size (even if user's read IO exceeds the
established readahead setting).

Bug: 120757803
Change-Id: I4ebe2a670d16300c4fe648333c947c214ea0a5b9
Link: https://lkml.org/lkml/2018/12/18/744
Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting")
Cc: stable@vger.kernel.org
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2023-03-26 12:09:05 +01:00
Sayali Lokhande
b7399301f0 fs: namespace: Fix use-after-free in unmount
During unmount, there is a chance that mntput_no_expire()
scheduled delayed_mntput_work() or in case MNT_INTERNAL
flag is set it can directly call cleanup_mnt().
This results in use-after-free in umount_end check as
mnt is already freed via below path :
cleanup_mnt()->delayed_free_mnt()->free_vfsmnt().

Fix this by moving unmount_end() before mntput_no_expire.

Change-Id: Ib3468ca3b1b3c137484b70972db5d5569f2f2753
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2023-03-26 12:09:04 +01:00
Jaegeuk Kim
afd4669f0a ANDROID: vfs/ext4,f2fs: finish umount(2) in time with filesystem work
This patch changes umount(2) flow to wait for delayed fput/mntput. Meanwhile,
we can still see unclosed name spaces which can trigger filesystem panic due
to released device illustrated below. (i.e., ext4 with errors=panic)

So, it introduces fs->umount_end() to change filesystem behavior like
error=remount-ro in ext4.

WARN: DO NOT upstream!

This is only related to Android reboot procedure, and resolves the below
issue where a kernel panic happens when a living filesystem tries to access
dead block device after device_shutdown done by kernel_restart.

Term: namespace(mnt_get_count())

1. create_new_namespaces() creates ns1 and ns2,

  /data(1)    ns1(1)    ns2(1)
    |          |          |
     ---------------------
               |
        sb->s_active = 3

2. after binder_proc_clear_zombies() for ns2 and ns1 triggers
  - delayed_fput()
    - delayed_mntput_work(ns2)

  /data(1)    ns1(1)
    |          |
     ----------
          |
    sb->s_active = 2

3. umount() for /data is successed.

  ns1(1)
    |
 sb->s_active = 1

4. device_shutdown() by init

5.  - delayed_mntput_work(ns1)
     - put_super(), since sb->s_active = 0
       - -EIO

Bug: 63981945
Bug: 65481582
Bug: 72236603
Change-Id: I7db02f480cc839bf9c245e078164a8168ea0d88b
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2023-03-26 12:09:04 +01:00
Jaegeuk Kim
b5bdb49f03 ICE, pfk: fix to set dio_inode precisely
When using loopback device with dio, we can't rely on page flag.

Bug: 141601405
Bug: 141860559
Bug: 140882488
Change-Id: I09526c25e8d5333853e777f29333f9fa8da37459
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-03-26 12:09:04 +01:00
Jaegeuk Kim
c1316baf42 sdcardfs: should use spin_lock instead of mutex in rcu
This patch fixes wrong usage of mutex in rcu.

[  398.181936] c1  10801  dump_stack+0xb8/0x110
[  398.181943] c1  10801  panic+0x130/0x290
[  398.181950] c1  10801  __stack_chk_fail+0x0/0x50
[  398.181956] c1  10801  report_bug+0x148/0x184
[  398.181962] c1  10801  bug_handler+0x28/0x84
[  398.181968] c1  10801  brk_handler+0x80/0x170
[  398.181974] c1  10801  do_debug_exception+0xc4/0x16c
[  398.181979] c1  10801  el1_dbg+0x18/0x74
[  398.181985] c1  10801  rcu_note_context_switch+0x46c/0x4fc
[  398.181993] c1  10801  __schedule+0xe0/0xb9c
[  398.181999] c1  10801  schedule_preempt_disabled+0x7c/0xa8
[  398.182005] c1  10801  __mutex_lock+0x294/0x494
[  398.182011] c1  10801  __mutex_lock_slowpath+0x10/0x18
[  398.182017] c1  10801  mutex_lock+0x2c/0x34
[  398.182024] c1  10801  sdcardfs_permission+0xa0/0x23c
[  398.182032] c1  10801  __inode_permission2+0x94/0xdc
[  398.182039] c1  10801  link_path_walk+0xf8/0x518
[  398.182045] c1  10801  path_lookupat+0x54/0x214
[  398.182051] c1  10801  filename_lookup+0x8c/0x194
[  398.182057] c1  10801  user_path_at_empty+0x44/0x54
[  398.182063] c1  10801  vfs_statx+0x84/0x124
[  398.182069] c1  10801  SyS_newfstatat+0x30/0x6c

Bug: 170596516
Fixes: 6a5a0f272a59 ("sdcardfs: fix stale permission error")
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I237d7f6f93dd400ed9cac524bbeca2b4114a78d8
2023-03-26 12:09:04 +01:00
Jaegeuk Kim
082eabab5a sdcardfs: fix stale permission error
This patch fixes a bug showing EACCES of open() which is caused by missing
inode and dentry object.

Bug: 142101178
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I4cab9a3554fad9e2c58a0840fc968257b796e156
2023-03-26 12:09:04 +01:00
Jaegeuk Kim
a0b560f596 sdcardfs: fix wrong ENOENT when creating a file
There is subtle race condtion where lower_dentry is null. If we retry
lookup again, we should get the correct dentry.

Bug: 110585947
Bug: 110464178
Bug: 80587794
Bug: 37231161
Bug: 110199687
Change-Id: I39b95de4649b034287776f5c8a5d197b6ebd9ada
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-03-26 12:09:04 +01:00
Chenyang Zhong
4b1b262184 drivers: fix section mismatch in qcom's regulator drivers
Section mismatch was warned after upstream commit 1b9980fb24
finally fixed modpost's ability to detect EXPORT_SYMBOL plus __init
or __exit. Qcom's qpnp and stub regulator drivers have both __init
and EXPORT_SYMBOL.

- This particular 4.9 kernel does not build anything into modules.
- Currently I do not see any code using qpnp_regulator_init or
  regulator_stub_init outside its own translation unit.

Therefore, similar to d336e9a71e, just unexport the symbol.

Also, according to the kernel-hacking doc [1], "it makes no sense
for a function marked with __init to be exported to modules with
EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL()" because functions marked
with __init are dropped after boot is complete.

[1] https://docs.kernel.org/kernel-hacking/hacking.html#init-exit-initdata

Change-Id: I6a70100a07bd9dc4c6b03cd8ae76c957055491d2
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-03-26 12:09:04 +01:00
David Lin
ed6ab4283c regulator: qpnp: fix memory leak when probe failed
This patch fixes the following sparse warnings:
qpnp-regulator.c:2187 qpnp_regulator_probe() warn:
possible memory leak of 'vreg'

Bug: 77543262
Test: boot
Change-Id: I115e2c992f37e91fe9b31e7e475619bb679c1ee8
Signed-off-by: David Lin <dtwlin@google.com>
2023-03-26 12:09:04 +01:00
Rik van Riel
fde7ff468d fork,random: use get_random_canary() to set tsk->stack_canary
Use the ascii-armor canary to prevent unterminated C string overflows
from being able to successfully overwrite the canary, even if they
somehow obtain the canary value.

Inspired by execshield ascii-armor and Daniel Micay's linux-hardened
tree.

Link: http://lkml.kernel.org/r/20170524155751.424-3-riel@redhat.com
Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I3127dc016674ffb78ef62f37c44fa5d6df47fe61
2023-03-26 12:09:04 +01:00
Reinazhard
6b46328de3 soc/qcom: early_random: Fix race during early random pool initialization
Recent random.c upstream introduced early random pool init race.
As Jason A. Donenfeld suggests, change the call to
add_hwgenerator_randomness to be add_bootloader_randomness,
and remove the last argument with the left shift operator usage.

This fixes the splash boot issue after latest RNG upstream and adapts
Qualcomm's early random driver to it.

Test: Device boots, RNG probes successfully alongside early_random driver.

Change-Id: Id75c66bf6d65bf077570a68145d4a4d200747865
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
Co-authored-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Reinazhard <reinazhard@gmail.com>
[ Tashar02: Reword the commit message & description ]
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
(cherry picked from commit bd8265f32a21efc95d9b2d7473ca30e17352b0eb)
Signed-off-by: Albert I <kras@raphielgang.org>
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-03-26 12:09:04 +01:00
Chenyang Zhong
99ea7e4b8d soc/qcom: include random.h instead of hw_random.h
add_hwgenerator_randomness() has been moved to random.h in upstream
commit 75cc37f461.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I34b1a2e2a477a2a9a14e5833650cdfc6f3733138
2023-03-26 12:09:04 +01:00
Chenyang Zhong
fbe241ba61 drivers: soc: qcom: switch to cached rbtree root for timerqueue
Following upstream commit ef2e6403, adapt the timerqueue_head to
use the cached rbtree.

Change-Id: Ic00e382de64e190d0a2057fa53478ca9b9b7d4c4
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-03-26 12:09:04 +01:00
Chenyang Zhong
c4dd26e62b drm/msm: drop unused "fail" label
The label "fail:" is unused after commit 96393660.

It is not an issue in upstream because upstream does not have CAF
commit 7e5bda56 that removed other usage of fail:.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: Ic80cd75a17b67d348b4baf536a222a29f8b5458c
2023-03-26 12:09:04 +01:00
Chenyang Zhong
a275f2254a dm-table: re-arrange inlinecrypt capability check logic
According to upstream commit 75c5d315, "a non-zero return code
returned by iterate_devices_callout_fn will stop the iteration in
advance". In addition, commit a36aeade specifically inverts the
dax capability check to be is(not capable) instead of not(capable)
to address the issue. Therefore, follow that change to invert the
logic on inlinecrypt capability check as well.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: Ia6ca5aed174e781017299d626676e30f787d38a6
2023-03-26 12:09:04 +01:00
Chenyang Zhong
77a795a58d dm-table: implement dm_table_supports_inlinecrypt()
Upstream commit 75c5d315 dropped dm_table_all_devices_attribute()
that is needed by CAF's commit 0c00b775. Implement the iterative
check in similar styles of dm_table_supports_discards(), as
indicated by the comment above dm_table_any_dev_attr().

One thing that is different from dm_table_supports_discards() is
that CAF's inlinecrypt check requires _all_ devices to support it.
Therefore, only return true after iterating through all devices.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I4e2eb3f89181b291e2064ae523f75deba7fb61fe
2023-03-26 12:09:04 +01:00
Bruno Martins
36a0e31e15 drivers: md: Remove SECTOR_SIZE definition
Required after upstream commit d24c407b0f.

Change-Id: I4dc8751199363afed0c613a8330d965760da21f0
2023-03-26 12:09:04 +01:00
Bruno Martins
9162135978 Merge branch 'deprecated/android-4.9-q' of https://android.googlesource.com/kernel/common into HEAD
Conflicts:
	arch/arm/Makefile
	arch/arm/include/asm/unistd.h
	arch/arm/kernel/calls.S
	arch/arm64/include/asm/assembler.h
	arch/arm64/include/asm/cputype.h
	arch/arm64/kernel/bpi.S
	arch/arm64/kernel/cpu_errata.c
	arch/arm64/kernel/setup.c
	arch/arm64/kernel/vdso.c
	arch/arm64/mm/proc.S
	arch/mips/include/uapi/asm/Kbuild
	arch/powerpc/include/uapi/asm/Kbuild
	drivers/char/Kconfig
	drivers/char/random.c
	drivers/clk/qcom/clk-rcg2.c
	drivers/gpu/drm/drm_edid.c
	drivers/irqchip/irq-gic.c
	drivers/md/dm-table.c
	drivers/media/dvb-core/dmxdev.c
	drivers/mmc/core/core.c
	drivers/mmc/core/host.c
	drivers/mmc/core/mmc.c
	drivers/mmc/host/sdhci.c
	drivers/net/usb/lan78xx.c
	drivers/scsi/ufs/ufs_quirks.h
	drivers/scsi/ufs/ufshcd.c
	drivers/staging/android/ion/ion-ioctl.c
	drivers/staging/android/ion/ion.c
	drivers/staging/android/ion/ion_priv.h
	drivers/staging/android/ion/ion_system_heap.c
	drivers/tty/tty_io.c
	drivers/usb/core/hub.c
	drivers/usb/core/usb.h
	drivers/usb/dwc3/core.c
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/composite.c
	drivers/usb/gadget/configfs.c
	drivers/usb/gadget/function/f_accessory.c
	drivers/usb/gadget/function/rndis.c
	drivers/usb/gadget/function/rndis.h
	fs/eventpoll.c
	fs/ext4/namei.c
	fs/fat/fatent.c
	fs/gfs2/acl.c
	include/linux/random.h
	include/uapi/drm/Kbuild
	include/uapi/linux/Kbuild
	include/uapi/linux/cifs/Kbuild
	include/uapi/linux/genwqe/Kbuild
	kernel/cpu.c
	kernel/exit.c
	kernel/sched/cpufreq_schedutil.c
	lib/Makefile
	lib/string.c
	mm/memory.c
	mm/page-writeback.c
	mm/page_alloc.c
	net/ipv4/udp.c
	net/ipv6/datagram.c
	net/ipv6/ip6_output.c
	net/netfilter/nf_conntrack_irc.c
	net/netfilter/xt_quota2.c
	net/netlink/genetlink.c
	security/selinux/avc.c
	security/selinux/include/objsec.h
	sound/core/compress_offload.c

Change-Id: I41982a5a8e22a21b72ec5dfa61a3680be66213f4
2023-03-26 12:09:00 +01:00
Herbert Xu
f9b8314c64 UPSTREAM: ipv6: raw: Deduct extension header length in rawv6_push_pending_frames
commit cb3e9864cdbe35ff6378966660edbcbac955fe17 upstream.

The total cork length created by ip6_append_data includes extension
headers, so we must exclude them when comparing them against the
IPV6_CHECKSUM offset which does not include extension headers.

Reported-by: Kyle Zeng <zengyhkyle@gmail.com>
Fixes: 357b40a18b ("[IPV6]: IPV6_CHECKSUM socket option can corrupt kernel memory")
Change-Id: I73cf556998cab122229e1a361d186925775aad61
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 35ed8ba485544a31a4ab9b92a1c68e406ab66a47)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-01-18 11:48:41 +00:00
Gavrilov Ilia
1b1e3a2a7b UPSTREAM: netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
commit 9ea4b476cea1b7d461d16dda25ca3c7e616e2d15 upstream.

When first_ip is 0, last_ip is 0xFFFFFFFF, and netmask is 31, the value of
an arithmetic expression 2 << (netmask - mask_bits - 1) is subject
to overflow due to a failure casting operands to a larger data type
before performing the arithmetic.

Note that it's harmless since the value will be checked at the next step.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: b9fed74818 ("netfilter: ipset: Check and reject crazy /0 input parameters")
Change-Id: I13e759e84d67e14d3d34aa63e8e22299a6a18a34
Signed-off-by: Ilia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e137d9bb26bd85ce07323a38e38ceb0b160db841)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-01-18 11:47:54 +00:00