Commit graph

974,125 commits

Author SHA1 Message Date
Michael Bestas
bb0f246e35
Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina
"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  Asoc: dsp: Fix to check the list is empty or not
  dsp: q6lsm: Check size of payload before access
  Fix for OOB access issue
  dsp: q6asm increase the locking range
  ASoC: msm-pcm-q6-v2: Add size check
  ASoC : Add proper copyright marking.
  dsp: afe: Add check for num_spks
  soc: pinctrl-lpi: remove pm ops
  asoc: msm-compress: Fix compress_pause failure on gki
  Audio legacy: Integer overflow in msm_lsm_ioctl_compat during audio playback usecase. size = sizeof(p_info_32) + p_info_32.param_size; This overflow issue may result heap overflow during copying the data: memcpy(param_info_rsp, &p_info_32, sizeof(p_info_32));
  ASoC : Add macro to differentiate auto code
  ASoC: msm: get CoPP index based on FE id
  asoc: codecs: add array bound check
  soc: Address SWR rate mismatch interrupt
  asoc : add configuration about SLIMBUS_7_TX
  asoc: lahaina: add support for aud_ref_clk_sel mux
  dsp: afe: add support for aud_ref_clk_sel mux
  ASoC: dsp: Release lock before return
  ASoC: wcd937x: Add flag to decide RX_MUTE for HPHL and EAR
  ASoC: bolero: Add check for CMPDR switch
  ASoC : add support of HDMI controller for rb3gen2 platform
  asoc: lahaina: fractional sample rate support for TDM
  asoc: support for fractional sample rate over tdm
  Revert "asoc: msm-compress : Fix for CTS-on-gsi with gki"
  audio-kernel:swr: Add dynamic SWRM clk support
  asoc: codec: make mclk freq configurable in Bolero
  asoc: lahaina: Add ext clk source support
  asoc: ext-clk: Add support for configuring ext clk
  dsp: afe: Enhance and expose API for configuring ext clk
  dsp: q6voice: Handle mutex lock-unlock
  asoc: msm-compress : Fix for CTS-on-gsi with gki

Change-Id: I21b8e5f5ef608bf298230419123e4ee37c9b0797
2024-05-29 03:04:05 +03:00
Michael Bestas
d9c4f23b02
Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0 into android13-5.4-lahaina
"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0:
  Release 2.0.8.34N
  qcacld-3.0: Reset roaming_in_progress upon VDEV down

Change-Id: I5a55a8b81c7c182b1798e57acc7e8b26137e5aa0
2024-05-29 03:03:32 +03:00
Michael Bestas
adb424d0a1
Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn into android13-5.4-lahaina
"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn:
  qcacmn: Fix OOB reads in util_gen_new_ie
  qcacmn: Add length checks for noninheritance_ie
  qcacmn: Add check to avoid NULL pointer deference in parse MBSSID
  qcacmn: Fix use-after-free issue in util_scan_parse_mbssid
  qcacmn: Fix memleak in MBSSIE handler
  qcacmn: Fix potential OOB read in util_scan_parse_mbssid()
  qcacmn: Fix potential OOB read in util_scan_is_split_prof_found()
  qcacmn: Fix out of bound read issue in ESP ie parse

Change-Id: I1b4880946cbe1c20838957274bffc0d60253c3d9
2024-05-29 03:03:01 +03:00
Michael Bestas
6053e63a3c
Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api into android13-5.4-lahaina
"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/fw-api:
  fw-api: CL 26368984 - update fw common interface files
  fw-api: CL 26367617 - update fw common interface files
  fw-api: CL 26367611 - update fw common interface files
  fw-api: CL 26351133 - update fw common interface files
  fw-api: CL 26304529 - update fw common interface files
  fw-api: CL 26304560 - update fw common interface files
  fw-api: CL 26301574 - update fw common interface files
  fw-api: CL 26280447 - update fw common interface files
  fw-api: CL 26269344 - update fw common interface files
  fw-api: CL 26268167 - update fw common interface files
  fw-api: CL 26238739, 26268166 - update fw common interface file txmon_tlvs.h #3
  fw-api: CL 26242685 - update fw common interface files
  fw-api: CL 26241114 - update fw common interface files
  fw-api: CL 26238739 - update fw common interface files
  fw-api: CL 26238735 - update fw common interface files
  fw-api: CL 26228983 - update fw common interface files
  fw-api: CL 26228979 - update fw common interface files
  fw-api: CL 26220780 - update fw common interface files
  fw-api: CL 26206720 - update fw common interface files
  fw-api: CL 26206715 - update fw common interface files
  fw-api: CL 26205559 - update fw common interface files
  fw-api: CL 26197005 - update fw common interface files
  fw-api: CL 26180835 - update fw common interface files
  fw-api: CL 26150181 - update fw common interface files
  fw-api: CL 26149972 - update fw common interface files
  fw-api: CL 26129651 - update fw common interface files
  fw-api: add TLV struct for sigb details
  fw-api: CL 26118792 - update fw common interface files
  fw-api: CL 26106643 - update fw common interface files
  fw-api: CL 26082151 - update fw common interface files
  fw-api: CL 26071804 - update fw common interface files
  fw-api: CL 26041862 - update fw common interface files
  fw-api: CL 26026870 - update fw common interface files
  fw-api: CL 26017002 - update fw common interface files
  fw-api: Incremental hw header file update for WCN7750
  fw-api: CL 25999327 - update fw common interface files

Change-Id: I6b14b90c99f8c68376776eebfe29e74e070d7afa
2024-05-29 03:02:12 +03:00
Michael Bestas
71d8fed9fd
Merge tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina
"LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0"

* tag 'LA.UM.9.14.r1-24700-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4:
  msm: npu v1: Fix OOB issue in IPC between driver and firmware
  mmc: sdhci-msm: Disable partial_init and clk-scaling to avoid RED error
  slimbus: qcom-ngd-ctrl: Avoid accessing deallocated stack
  msm_ipa: new structure for tunnel design for uC
  msm: ipa3: change variable name for indication of rx tlv format
  soc: qcom: llcc: Handle a second device without data corruption
  msm: eva: User after free fix in msm_cvp_mark_user_persist
  rpmsg: slatecom: out of bound read from process_cmd
  soc: qcom: msm_minidump: Configurable Encryption support
  defconfig: arm64: Disable trimming non-whitelisted symbols
  soc: qcom: add out of bound check for AON fifo
  rpmsg: slatecom: maintain rx_size to read
  Revert LLCC changes
  bus: mhi: Fix potential out-of-bound access

 Conflicts:
	arch/arm64/boot/dts/vendor/bindings/interrupt-controller/ti,sci-intr.txt
	drivers/soc/qcom/llcc-slice.c
	drivers/usb/dwc3/core.c
	kernel/events/core.c
	mm/memory-failure.c

Change-Id: Ie4d89454f0766d0a48ebd4f2e6facb6deca9ea57
2024-05-29 02:59:55 +03:00
Jia Ding
4034a73005
qcacmn: Dynamically allocate memory for ipa_wdi_conn_in_params
Currently struct ipa_wdi_conn_in_params occupies 1588 bytes and putting
it on the stack is rather expensive, which could potentially lead to
stack corruption.

Fix is to reduce stack usage in dp_ipa_setup by dynamically allocating
struct ipa_wdi_conn_in_params on the heap.

Change-Id: I8f71f44906a5c95f37627f7573b57b7825daaa7e
CRs-Fixed: 2852027
2024-05-18 23:10:53 +03:00
Sarannya S
ea009740e9
net: qrtr: Use xa_load in qrtr_get_service_id
In qrtr_get_service_id, use xa_load instead of node_get to check
if the node exists or not. Calling node_get from interrupt context
can cause potential deadlock since it calls into xa_store to
allocate the node if it does not exist.

Change-Id: Ida9f7a113417f0d184c0903004d94dd2eca6c472
Signed-off-by: Sarannya S <quic_sarannya@quicinc.com>
2024-05-18 18:07:50 +00:00
Tony Truong
691b019901
net: qrtr: fix type for size in smd
The return value for of_property_count_u32_elems can be negative in the
case of an error or the property is not found. It is incorrect to use
size_t, unsigned type, as this can cause an overflow. Switch size from
type size_t to int.

Change-Id: Ica0425abd034b82994ab32087f04d602ce3dd9e9
Signed-off-by: Tony Truong <quic_truong@quicinc.com>
2024-05-18 18:07:49 +00:00
YangYi
5fd8516a12
penang: device suspend tests fail
Penang:
fix the problem of device suspend tests fail.

Change-Id: I2477d57440b40dcf930fff27631554c2024ec444
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2424757
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-05-18 18:07:49 +00:00
YangYi
f378e9d0ba
Penang: resolve kasan panic
Penang:
KASAN: slab-out-of-bounds in qrtr_endpoint_register

Change-Id: I7542a0f2af0ceb0fdd04291b86795ba942ffe8d7
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2413704
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-05-18 18:07:48 +00:00
Lei Chen
1be799e9f5
topolygy:fix kansan panic at topology_parse_cpu_capacity
BUG: KASAN: slab-out-of-bounds in topology_parse_cpu_capacity
Write of size 4 at addr ffffffa64515031c by task swapper/0/1
Revert the changes I90055f96c320b15960efac10d8d92c69413eeb6b
Fix the kasan panic.

Change-Id: I7a8701e29a9de82c175e3c4e265a9bf179e32f91
Signed-off-by: Lei Chen <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2649556
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-05-18 18:07:48 +00:00
Jishnu Prakash
1bd12c499c
leds: qpnp-flash-v2: Fix compilation error
Fix a compilation error seen when casting void pointer to
int by casting it to uintptr_t instead.

Change-Id: I679da04f21041c386fa7ad8905ede94e12ea160c
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
2024-05-18 18:07:47 +00:00
Michael Bestas
c340e37c45
thermal: max31760_fan: Fix unused result warning
../drivers/thermal/qcom/max31760_fan.c:331:3: error: ignoring return
value of function declared with 'warn_unused_result' attribute
[-Werror,-Wunused-result]
                (pdata->vdd_reg);
                ^~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~

Change-Id: I06fb07da60cb765e4daf98c38afdb97690491c6f
2024-05-18 18:07:47 +00:00
Michael Bestas
57c2c02859
input: touchscreen: Fix unused result warnings
Fixes:
../drivers/input/touchscreen/focaltech_touch/focaltech_core.c:979:3:
error: ignoring return value of function declared with
'warn_unused_result' attribute [-Werror,-Wunused-result]
                PTR_ERR(acl_desc);
                ^~~~~~~ ~~~~~~~~
../drivers/input/touchscreen/focaltech_touch/focaltech_core.c:986:3:
error: ignoring return value of function declared with
'warn_unused_result' attribute [-Werror,-Wunused-result]
                PTR_ERR(sgl_desc);
                ^~~~~~~ ~~~~~~~~

Change-Id: I941c32696a52a84a0a9272d4f969755932925aaa
2024-05-18 18:07:46 +00:00
vantoman
27a903f872
tcp: fix a bitfield constant conversion
../net/ipv4/tcp_timer.c:202:27: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
                icsk->icsk_mtup.enabled = 1;

Change-Id: I7e1b4013ba6a67fad27a611d30f98939ceaa5109
2024-05-18 18:07:46 +00:00
vantoman
21834caf71
ipa_v3: Fix enum conversion warnings
../techpack/dataipa/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c:510:41: warning: implicit conversion from enumeration type 'enum ipa_ip_type_enum_v01' to different enumeration type 'enum ipa_ip_type' [-Wenum-conversion]
        q6_ul_flt_rule_ptr->ip = flt_spec_ptr->ip_type;
                               ~ ~~~~~~~~~~~~~~^~~~~~~
../techpack/dataipa/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c:511:45: warning: implicit conversion from enumeration type 'enum ipa_filter_action_enum_v01' to different enumeration type 'enum ipa_flt_action' [-Wenum-conversion]
        q6_ul_flt_rule_ptr->action = flt_spec_ptr->filter_action;
                                   ~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~

Change-Id: I0eb68d707151cd103676a30659ab81bf6fced131
2024-05-18 18:07:45 +00:00
Chenglu Lin
c3af0b80cf
gki_defconfig: enable CONFIG_CC_WERROR
Ensures that no new warnings are introduced to the build.

Bug: 141372918
Change-Id: I4107af91f5c1ddd655037823350e005e8362d588
Signed-off-by: Chenglu Lin <chenglulin@google.com>
2024-05-18 18:07:45 +00:00
Chenglu Lin
d57b564745
kernel: Add CC_WERROR config to turn warnings into errors
Add configuration option CONFIG_CC_WERROR to prevent warnings
from creeping in.

Bug: 141372918
Change-Id: Ie2d067c0177d8f13e9aaa9a78867998e390f89ee
Signed-off-by: Chenglu Lin <chenglulin@google.com>
2024-05-18 18:07:44 +00:00
Ben Dai
c69129daaf
ANDROID: arm64: Fix the address of ftrace_call compiled with CFI_CLANG
When CONFIG_CFI_CLANG and CONFIG_DYNAMIC_FTRACE are enabled, LLVM will
generate a jump function named ftrace_call.cfi_jt for ftrace_call, which
makes "&ftrace_call" in ftrace_update_ftrace_func() actually the address
of ftrace_call.cfi_jt. As a result, the tracer can't be really enabled
through runtime modification. Use __va_function() to get the actual address
of ftrace_call to fix the issue.

Bug: 184105181
Signed-off-by: Ben Dai <ben.dai@unisoc.com>
Change-Id: Ic9272cd4ab447b3b145d8e397e5c9010c49f7a12
2024-05-18 18:07:44 +00:00
Sami Tolvanen
e06e6248a2
ANDROID: arm64: Place CFI jump table sections in .text
After the switch to non-canonical CFI jump tables, the jump table
sections were placed after the .text section. Merge these sections
into .text to fix issues with error injection and kallsyms.

Bug: 225079388
Bug: 190422440
Change-Id: I6c81b3e4dbba62739f7fc5f6b45271c54f278c8f
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2024-05-18 18:07:43 +00:00
Kishore Sri venkata Ganesh Bolisetty
4e24aaf585
msm_perf: fix warnings to enable msm_perf
Handle error checks in reading attributes.

Change-Id: I12b693e469b8a8de21a2bef36c92a012e5a2c034
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <quic_bsrivenk@quicinc.com>
[dereference23: Backport to msm-5.4]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:43 +00:00
Jeevan Shriram
04664d5d69
drivers: soc: spss_utils: Handle error return from copy_to_user
Handle error return value from copy_to_user() in ioctls to avoid
following compilation failure.

"error: ignoring return value of function declared with 'warn_unused_result'
 attribute".

Change-Id: I92944ade7fb88e0543ca4254fab226da5777def7
Signed-off-by: Jeevan Shriram <quic_jshriram@quicinc.com>
2024-05-18 18:07:43 +00:00
Alexander Winkowski
7b962f9da1
ANDROID: gki_defconfig: Enable __must_check attribute
It never hurts to know if drivers have some flaws.

Change-Id: Iba3acda0eeec9448fc907def5b3d25f117bc818b
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:42 +00:00
Diab Neiroukh
4130e755f5
crypto: qcedev: Const-ify the SHA initialisation vectors
Change-Id: Id199c8b1cbfea15e16e7d540c8f079d66cd49f70
Suggested-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev>
2024-05-18 18:07:42 +00:00
Nathan Chancellor
2160b12922
kbuild: Remove '-mno-global-merge'
This flag is specific to clang, where it is only used by the 32-bit and
64-bit ARM backends. In certain situations, the presence of this flag
will cause a warning, as shown by commit 6580c5c18fb3 ("um: clang: Strip
out -mno-global-merge from USER_CFLAGS").

Since commit 61163efae0 ("kbuild: LLVMLinux: Add Kbuild support for
building kernel with Clang") that added this flag back in 2014, there
have been quite a few changes to the GlobalMerge pass in LLVM. Building
several different ARCH=arm and ARCH=arm64 configurations with LLVM 11
(minimum) and 15 (current main version) with this flag removed (i.e.,
with the default of '-mglobal-merge') reveals no modpost warnings, so it
is likely that the issue noted in the comment is no longer relevant due
to changes in LLVM or modpost, meaning this flag can be removed.

If any new warnings show up that are a result of the removal of this
flag, it can be added back under arch/arm{,64}/Makefile to avoid
warnings on other architectures.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: David Gow <davidgow@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit cf300b83c793c25c6b485fdaf7a4447d8ea4c655)
Change-Id: Ice39a960619319828b83c8091798fe383395a2b0
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:41 +00:00
Alexander Winkowski
8f2a69d5a3
techpack: audio: Fix false positive -Wstrlcpy-strlcat-size
strlen(swr_dmic_name_prefix_of) + 1 bytes are allocated for prefix_name just above

techpack/audio/asoc/codecs/swr-dmic.c:685:11: error: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Werror,-Wstrlcpy-strlcat-size]
                        strlen(swr_dmic_name_prefix_of) + 1);
                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Change-Id: I808b4f135d42fc50587eeb9348848f7e0a3561cc
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:41 +00:00
Alexander Winkowski
4f5bf3d147
coresight-tmc: Fix false positive -Wfortify-source
The size is checked just above.

../drivers/hwtracing/coresight/coresight-tmc.c:423:26: warning: 'sscanf' may overflow; destination buffer in argument 3 has size 10, but the corresponding specifier may require size 11 [-Wfortify-source]
  423 |         if (sscanf(buf, "%10s", str) != 1)
      |                                 ^
../drivers/hwtracing/coresight/coresight-tmc.c:464:26: warning: 'sscanf' may overflow; destination buffer in argument 3 has size 10, but the corresponding specifier may require size 11 [-Wfortify-source]
  464 |         if (sscanf(buf, "%10s", str) != 1)
      |                                 ^
2 warnings generated.

Change-Id: I5db199a85ba0c7dfc15fae5d62c9c4d8c550d3e7
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:40 +00:00
Alexander Winkowski
4e8fdc63e9
input: touchscreen: nt36xxx: Fix -Wfortify-source
../drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c:1096:3: warning: 'snprintf' size argument is too large; destination buffer has size 32, but size argument is 4096 [-Wfortify-source]
 1096 |                 snprintf(mpcriteria, PAGE_SIZE, "novatek-mp-criteria-%04X", ts->nvt_pid);
      |                 ^
1 warning generated.

Change-Id: I84e8c8d932ad1a26b52b020990435f8567e8c282
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:40 +00:00
Alexander Winkowski
d6254684dc
soc: qcom: minidump: Fix -Wstrlcpy-strlcat-size
Extracted from I54b58226e3d6de0b674ac4ca1407138d1c9707e8

../drivers/soc/qcom/msm_minidump.c:521:39: warning: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Wstrlcpy-strlcat-size]
  521 |         strlcpy(banner, linux_banner, strlen(linux_banner) + 1);
      |                                       ~~~~~~~^~~~~~~~~~~~~~~~~
1 warning generated.

Change-Id: I43fa5006150dd402405f8c942571f08da0eb714a
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:39 +00:00
Alexander Winkowski
deac4ca723
thermal_debugfs: Avoid sscanf buffer overflow
Only 19 characters out of total 20 can be used due to the '\0' terminator.

Change-Id: I34883be26f97a16fdcb5ff97ff326d98f4d93c18
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:39 +00:00
Danny Lin
2a468765ee
Makefile: Remove obsolete -fno-builtin flag
CAF cherry-picked an obsolete LLVMLinux patch from 2014 in commit
a2a31f1ddc that introduced this
unnecessary flag. Now that the functions used by Clang's libcall
optimizations have been implemented, we can allow Clang to perform said
optimizations for a minor performance bump in certain code paths.

Change-Id: Ifa6b731c9702973be2c656d341e33a6186ed7cf2
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2024-05-18 18:07:38 +00:00
Danny Lin
27cb5cc179
Revert "ANDROID: HACK: arm64, LLVMLinux: use -mno-implicit-float"
This reverts commit 1210d2329b.

Unnecessary with Clang 6.0+.

Change-Id: I6f29ca050566e9027e51605e64bf6893602344ef
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2024-05-18 18:07:38 +00:00
Sultan Alsawaf
6c876cb48f
msm: ipa3: Silence PM notifier log spam
We don't need to know that PM notifiers are working. Silence the entry/exit
log spam in ipa_pm_notify().

Change-Id: I9bae89fa5e27b8835683ec1423ecc751491ea13c
Signed-off-by: Sultan Alsawaf <sultan@osomprivacy.com>
2024-05-18 18:07:37 +00:00
Alexander Winkowski
5944a71d89
arm64: configs: holi-qgki: Update LSE config name
After commit 1248f43abe ("arm64: Move the LSE gas support detection to Kconfig")
CONFIG_ARM64_USE_LSE_ATOMICS should be used to disable LSE atomics usage.

Change-Id: Ibb1abef274883b74b3d6151cc0fbe1647d5b9076
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:37 +00:00
Alexander Winkowski
0fd4ffe10a
techpack: dataipa: Fix compilation without PCI
Change-Id: Ice4284ce6a9b710638c21add2bef5f5bb4e52b63
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:36 +00:00
Alexander Winkowski
0fce6380a2
input: touchscreen: synaptics_tcm: Fix Kconfig
The conditional was mistakenly removed in e4e5585516.

Change-Id: If8fdb03cbda21a75b2c6ad00cee268f1a1c3ebe1
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-05-18 18:07:36 +00:00
Maulik Shah
10d1ba23b0
irqchip: qcom-mpm: Do not break s2idle suspend
Do not mark MPM as wake irq. Break s2idle suspend when MPM irq
is pending.

Change-Id: Ia455c589fdadcaa3be6084a68990887a2d4c3517
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2024-05-18 18:07:35 +00:00
Maulik Shah
b08b1645a2
irqchip: qcom-mpm: Add IRQCHIP_SET_TYPE_MASKED flag
Add IRQCHIP_SET_TYPE_MASKED flag for gpio and gic irqchips.

Change-Id: Ie6bf76ab2c98e4bc40ad4adfb13da9c9b69734c9
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2024-05-18 18:07:35 +00:00
Raghavendra Kakarla
a565bb6b89
irqchip: mpm: Remove IRQF_NO_SUSPEND from mpm irq request
As mpm irq is not expected to fire during the suspend phase,
so irq set with IRQF_NO_SUSPEND is not required.

This patch removes the IRQF_NO_SUSPEND flag from mpm irq
request.

Change-Id: I546968efa093e14f056c245648c2409e88a1bc45
Signed-off-by: Raghavendra Kakarla <quic_rkakarla@quicinc.com>
2024-05-18 18:07:24 +00:00
Linux Build Service Account
9959c58ead Merge 9ed4117589 on remote branch
Change-Id: I54713c210706001fc5f5d67d4daed5713ab94173
2024-05-08 02:16:21 -07:00
Linux Build Service Account
22b720cac0 Merge 8b50c4db78 on remote branch
Change-Id: Ida009310bd4ecdcc37356e38c4dadbcda14d4de9
2024-05-08 02:07:17 -07:00
Linux Build Service Account
a7687d992b Merge fa68ddc57b on remote branch
Change-Id: Ia0c005f129c866045453c7e3e9aff7e85a138184
2024-05-08 02:05:39 -07:00
Michael Bestas
1cba2b4252
Merge tag 'ASB-2024-05-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
https://source.android.com/docs/security/bulletin/2024-05-01
CVE-2023-4622

* tag 'ASB-2024-05-05_11-5.4' of https://android.googlesource.com/kernel/common:
  ANDROID: 16K: Fix show maps CFI failure
  ANDROID: 16K: Handle pad VMA splits and merges
  ANDROID: 16K: madvise_vma_pad_pages: Remove filemap_fault check
  ANDROID: 16K: Only madvise padding from dynamic linker context
  ANDROID: 16K: Separate padding from ELF LOAD segment mappings
  ANDROID: 16K: Exclude ELF padding for fault around range
  ANDROID: 16K: Use MADV_DONTNEED to save VMA padding pages.
  ANDROID: 16K: Introduce ELF padding representation for VMAs
  ANDROID: 16K: Introduce /sys/kernel/mm/pgsize_miration/enabled
  ANDROID: GKI: add snd_compr_stop_error to Xiaomi_abi
  UPSTREAM: netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path
  UPSTREAM: netfilter: nf_tables: release batch on table validation from abort path
  UPSTREAM: netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout

 Conflicts:
	mm/Makefile
	mm/mlock.c
	mm/mprotect.c

Change-Id: I559d13f0370fd2ede446df61fd1ce0550fa45155
2024-05-07 20:29:15 +03:00
Krupali Dhanvijay
9f52922253 qcacmn: Fix OOB reads in util_gen_new_ie
In util_gen_new_ie, there are several possible out-of-bound reads
with invalid information elements such as improper/missing check when
updating tmp_old, missing check prior to starting while loop and missing
length check.

To fix these OOB issues add and improve length checks in util_gen_new_ie.

Change-Id: I39b9cd82ab6a7bd1a4c8d7cd5039a998a290b85f
CRs-Fixed: 3717568
(cherry picked from commit 9a7916c74a)
2024-05-07 00:07:17 -07:00
Sheenam Monga
d0a13be77f qcacmn: Add length checks for noninheritance_ie
In util_scan_find_noninheritance_ie API,
ies[ELEM_ID_EXTN_POS] may lead to OOB access if
len==MIN_IE_LEN.

util_parse_noninheritance_list may lead to OOB
read access extn_elem[ELEM_ID_LIST_LEN_POS]

Fix is to add length checks and add sub_copy and length
subie_len checks before accessing extn_elem to avoid any
OOB read.

Change-Id: I7758c6e4d8d568a5050011603b48a23e0b11da94
CRs-Fixed: 3717569
(cherry picked from commit aab3fa668d)
2024-05-06 23:21:56 -07:00
Kalesh Singh
f952d4f3c8 ANDROID: 16K: Fix show maps CFI failure
If the kernel is built CONFIG_CFI_CLANG=y, reading smaps
may cause a panic. This is due to a failed CFI check; which
is triggered becuase the signature of the function pointer for
printing smaps padding VMAs does not match exactly with that
for show_smap().

Fix this by casting the function pointer to the expected type
based on whether printing maps or smaps padding.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I65564a547dacbc4131f8557344c8c96e51f90cd5
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-02 15:03:26 -07:00
Kalesh Singh
ecba20dd59 ANDROID: 16K: Handle pad VMA splits and merges
In some cases a VMA with padding representation may be split, and
therefore the padding flags must be updated accordingly.

There are 3 cases to handle:

Given:
    | DDDDPPPP |

where:
    - D represents 1 page of data;
    - P represents 1 page of padding;
    - | represents the boundaries (start/end) of the VMA

1) Split exactly at the padding boundary

    | DDDDPPPP | --> | DDDD | PPPP |

    - Remove padding flags from the first VMA.
    - The second VMA is all padding

2) Split within the padding area

    | DDDDPPPP | --> | DDDDPP | PP |

    - Subtract the length of the second VMA from the first VMA's
      padding.
    - The second VMA is all padding, adjust its padding length (flags)

3) Split within the data area

    | DDDDPPPP | --> | DD | DDPPPP |

    - Remove padding flags from the first VMA.
    - The second VMA is has the same padding as from before the split.

To simplify the semantics merging of padding VMAs is not allowed.

If a split produces a VMA that is entirely padding, show_[s]maps()
only outputs the padding VMA entry (as the data entry is of length 0).

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: Ie2628ced5512e2c7f8af25fabae1f38730c8bb1a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-02 15:03:17 -07:00
Kalesh Singh
7231bbf0e4 ANDROID: 16K: madvise_vma_pad_pages: Remove filemap_fault check
Some file systems like F2FS use a custom filemap_fault ops. Remove this
check, as checking vm_file is sufficient.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: Id6a584d934f06650c0a95afd1823669fc77ba2c2
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-02 15:03:03 -07:00
Kalesh Singh
95ac7272d7 ANDROID: 16K: Only madvise padding from dynamic linker context
Only preform padding advise from the execution context on bionic's
dynamic linker. This ensures that madvise() doesn't have unwanted
side effects.

Also rearrange the order of fail checks in madvise_vma_pad_pages()
in order of ascending cost.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I3e05b8780c6eda78007f86b613f8c11dd18ac28f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-02 15:02:59 -07:00
Kalesh Singh
1375f8328b ANDROID: 16K: Separate padding from ELF LOAD segment mappings
In has been found that some in-field apps depend on the output of
/proc/*/maps to determine the address ranges of other operations.

With the extension of LOAD segments VMAs to be contiguous in memory,
the apps may perform operations on an area that is not backed by the
underlying file, which results in a SIGBUS. Other apps have crashed
with yet unindentified reasons.

To avoid breaking in-field apps, maintain the output of /proc/*/[s]maps
with PROT_NONE VMAs for the padding pages of LOAD segmetns instead of
showing the segment extensions.

NOTE: This does not allocate actual backing VMAs for the shown
      PROT_NONE mappings.

This approach maintains 2 possible assumptions that userspace (apps)
could be depending on:
   1) That LOAD segment mappings are "contiguous" (not speparated by
      unrelated mappings) in memory.
   2) That no virtual address space is available between mappings of
      consecutive LOAD segments for the same ELF.

For example the output of /proc/*/[s]maps before and after this change
is shown below. Segments maintain PROT_NONE gaps ("[page size compat]")
for app compatiblity but these are not backed by actual slab VMA memory.

Maps Before:

7fb03604d000-7fb036051000 r--p 00000000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fb036051000-7fb036055000 r-xp 00004000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fb036055000-7fb036059000 r--p 00008000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fb036059000-7fb03605a000 rw-p 0000c000 fe:09 21935719                   /system/lib64/libnetd_client.so

Maps After:

7fc707390000-7fc707393000 r--p 00000000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fc707393000-7fc707394000 ---p 00000000 00:00 0                          [page size compat]
7fc707394000-7fc707398000 r-xp 00004000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fc707398000-7fc707399000 r--p 00008000 fe:09 21935719                   /system/lib64/libnetd_client.so
7fc707399000-7fc70739c000 ---p 00000000 00:00 0                          [page size compat]
7fc70739c000-7fc70739d000 rw-p 0000c000 fe:09 21935719                   /system/lib64/libnetd_client.so

Smaps Before:

7fb03604d000-7fb036051000 r--p 00000000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                 16 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                  16 kB
Pss:                   0 kB
Pss_Dirty:             0 kB
Shared_Clean:         16 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:           16 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd mr mw me
7fb036051000-7fb036055000 r-xp 00004000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                 16 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                  16 kB
Pss:                   0 kB
Pss_Dirty:             0 kB
Shared_Clean:         16 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:           16 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd ex mr mw me
7fb036055000-7fb036059000 r--p 00008000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                 16 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   4 kB
Pss:                   4 kB
Pss_Dirty:             4 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         4 kB
Referenced:            4 kB
Anonymous:             4 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd mr mw me ac
7fb036059000-7fb03605a000 rw-p 0000c000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                  4 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   4 kB
Pss:                   4 kB
Pss_Dirty:             4 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         4 kB
Referenced:            4 kB
Anonymous:             4 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd wr mr mw me ac

Smaps After:

7fc707390000-7fc707393000 r--p 00000000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                 12 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                  12 kB
Pss:                   0 kB
Shared_Clean:         12 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:           12 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd mr mw me ??
7fc707393000-7fc707394000 ---p 00000000 00:00 0                          [page size compat]
Size:                  4 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: mr mw me
7fc707394000-7fc707398000 r-xp 00004000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                 16 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                  16 kB
Pss:                   0 kB
Shared_Clean:         16 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:           16 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd ex mr mw me
7fc707398000-7fc707399000 r--p 00008000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                  4 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   4 kB
Pss:                   4 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         4 kB
Referenced:            4 kB
Anonymous:             4 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd mr mw me ac ?? ??
7fc707399000-7fc70739c000 ---p 00000000 00:00 0                          [page size compat]
Size:                 12 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: mr mw me ac
7fc70739c000-7fc70739d000 rw-p 0000c000 fe:09 21935719                   /system/lib64/libnetd_client.so
Size:                  4 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   4 kB
Pss:                   4 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         4 kB
Referenced:            4 kB
Anonymous:             4 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:    0
VmFlags: rd wr mr mw me ac

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I12bf2c106fafc74a500d79155b81dde5db42661e
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-02 15:02:55 -07:00