Mot-CRs-fixed: (CR)
process_madvise currently requires ptrace attach capability.
PTRACE_MODE_ATTACH gives one process complete control over another
process. It effectively removes the security boundary between the
two processes (in one direction). Granting ptrace attach capability
even to a system process is considered dangerous since it creates an
attack surface. This severely limits the usage of this API.
The operations process_madvise can perform do not affect the correctness
of the operation of the target process; they only affect where the data
is physically located (and therefore, how fast it can be accessed).
What we want is the ability for one process to influence another process
in order to optimize performance across the entire system while leaving
the security boundary intact.
Replace PTRACE_MODE_ATTACH with a combination of PTRACE_MODE_READ
and CAP_SYS_NICE. PTRACE_MODE_READ to prevent leaking ASLR metadata
and CAP_SYS_NICE for influencing process performance.
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Link: https://lore.kernel.org/lkml/202101111033.2D03EA97@keescook/T/#u
Test: built and flashed kernel
Bug: 153444106
Signed-off-by: Edgar Arriaga <edgararriaga@google.com>
Change-Id: I3624a8b0697d70f23587c1dcb746ba753c301f45
Reviewed-on: https://gerrit.mot.com/2765787
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Mot-CRs-fixed: (CR)
it only has 5 parameters in libc, currently has 6 parameters in kernel to
cause it return -EINVAL in "flags" check
libc defined:
ssize_t process_madvise(int __pid_fd, const struct iovec* __iov, size_t __count, int __advice, unsigned __flags) __INTRODUCED_IN(31);
This reverts commit 306d0c3e29.
Change-Id: If69151ae97498f4db210fbe4d16bf53ad4abf42b
Reviewed-on: https://gerrit.mot.com/2765786
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
WHAT: Disable the kernel configs related to debug gpio, clock and regulator
dumping its values for miami
WHY: This is halting penang driver sgm4154x_chg_mmi, because this config will
eventually make sgm4154x_chg_mmi call msleep inside an atomic operation
(read the registers that CONFIG_DUMP_* is requiring) and since penang
has CONFIG_PANIC_ON_SCHED_BUG it will call BUG(), which will panic
Change-Id: I8768dd99eafc854c0cd55cd57b51b241798ea64f
Reviewed-on: https://gerrit.mot.com/2759524
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
Tested-by: Jira Key
Reviewed-by: Gilberto Gambugge Neto <gambugge@motorola.com>
Submit-Approved: Jira Key
The prerequisite for AICL is that VBUS is required,
so when usb or charger cable is not connected
(neither usbin nor dcin exists),
we need to skip re-run AICL.
Change-Id: I2d039fbfaa090ac3e7682e4ddb9889a278503484
Signed-off-by: Guocheng Wang <wanggc6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2760500
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wei Wei <weiweij@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Using Type-C to 3.5mm Headphone 2-in-1 Adapter,COM charging Failed.
Because the devices are in off-mode when usb plug-in,bootup process might
cause some detection delay.
So when DUT power on with typec and the typec vbus is exist,we need to
wait some times for check type-c is connected before call
smb5_typec_attach_detach_irq_handler.
Change-Id: I8ea0e904bc493c13d666a09f81c34d33fdb2663f
Signed-off-by: Guocheng Wang <wanggc6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2752957
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Only add OEM DATA on QGKI and keep the origin struct on GKI
to avoid break KMI.
Change-Id: I6678db4ce211a21c91c5305024cb18b9f5e1265e
Reviewed-on: https://gerrit.mot.com/2749363
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
GPIOLIB_IS_REQUEST() checking only return true when the gpio using request_gpio functions.
So if using pinctrl and subsystem gpio configuration, this checking logic will block.
And we will get lots of following errors:
[ 453.757397] gpio25: is not allocated in gpiolib
After removing this logic, we could get the gpio status:
09-07 21:27:55.968 0 0 W gpio25 : in low func0 2mA pull down
Change-Id: I2d03e86e3a236bd81a72dfa20cb9e0be41354348
Reviewed-on: https://gerrit.mot.com/2733812
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wei Wei <weiweij@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Open this func for fogos in kernel.
Change-Id: If8458d06fa7358453e43ce48da4f90762ce10a22
Signed-off-by: Liu Yang <liuyang81@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2727777
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Bolei Shang <shangbl1@lenovo.com>
Reviewed-by: Ji Zhao <zhaoji1@lenovo.com>
Reviewed-by: <zhanys2@motorola.com>
Reviewed-by: <mingjw1@motorola.com>
Reviewed-by: Simon C <chenzm8@motorola.com>
Reviewed-by: Zhang Lei <zhangl82@motorola.com>
Reviewed-by: <wuhao38@lenovo.com>
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
WHAT: Disable the kernel configs related to debug gpio, clock and regulator
dumping its values for penang
WHY: This is halting penang driver sgm4154x_chg_mmi, because this config will
eventually make sgm4154x_chg_mmi call msleep inside an atomic operation
(read the registers that CONFIG_DUMP_* is requiring) and since penang
has CONFIG_PANIC_ON_SCHED_BUG it will call BUG(), which will panic
Change-Id: I26eb620e832dbf9e94acd4cb22cd87eee444f350
Reviewed-on: https://gerrit.mot.com/2719824
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Gilberto Gambugge Neto <gambugge@motorola.com>
Submit-Approved: Jira Key
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
The error is from https://gerrit.mot.com/#/c/2710381/
Function gpio_debug_print_enabled is implemented under
the control of DEBUG_FS.
But user version do not have this macro definition.
Error message is as following:
ld.lld: error: undefined symbol: gpio_debug_print_enabled
>>> referenced by lpm-levels.c:1124 (/home/weiweij/work/u/fogoNA/main/kernel/msm-5.4/drivers/cpuidle/lpm-levels.c:1124)
>>> vmlinux.o:(cluster_configure)
make[1]: *** [/home/weiweij/work/u/fogoNA/main/kernel/msm-5.4/Makefile:1197: vmlinux] Error 1
Change-Id: I57ae5a19f43dd4bf59196c8d18919f15acf03d4b
Reviewed-on: https://gerrit.mot.com/2712951
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wei Wei <weiweij@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
add "device_remove_bin_file" white list for aw8838 driver.
it could be found in the latest abi_gki_aarch64*.xml file.
Change-Id: I1d73efccfd0d6f2e5d412a3e327843b04b62ce2b
Signed-off-by: liaohj <liaohj@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2706089
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
we are not serving system suspend if spi xfers were in progress, doing
force suspend if spi xfers were completed.
Port of patch spi_geni_fix2.patch provided by qcom in case 06677540
Change-Id: I929031556694abf77e78e573a6f56986dc8667e9
Reviewed-on: https://gerrit.mot.com/2697260
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Bruno Oliveira <brunosoe@motorola.com>
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
fix the error dtb project config
the error will block start-up, the error uart log is as below:
Best Soc Dtb 0x1FB/0x10000/0x0/0x0
Unable to find the Board Dtb
Error: Board Dtbo blob not found
BootLinux() failed: Not Found
Slot _a is not looking good
Change-Id: Id147a84a0beafba097b2915303d9944834e9c550
Signed-off-by: Franz Wang <wangxf14@motorola.com>
Reviewed-on: https://gerrit.mot.com/2684376
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Details:
There is no second flash supplier
So close this macro
Change-Id: I7f2fd8ed04d3e16ff15cd1ecfc34d9f2710452c6
Signed-off-by: Simon C <chenzm8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2674947
Reviewed-by: <huqian4@motorola.com>
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: <liuzy55@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
add "snd_soc_add_card_controls" white list for fs1815 driver.
it could be found in the latest abi_gki_aarch64*.xml file.
Change-Id: I3f31e167317f273322858da8bf2188c161c88a3d
Signed-off-by: liaohj <liaohj@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2658776
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Wanlong Zhou <zhouwl@motorola.com>
Submit-Approved: Jira Key
In order to track the usb abnormal disconnect problem,
open some log about usb in factory version recommended
by Qualcomm for bangkk.
Change-Id: I015803505ac6111780ca29f6684a8e3780ae938b
Reviewed-on: https://gerrit.mot.com/2654714
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
vdex/odex file mmap operation actually does random access, the large
read ahead size can harm the performance, use this configuration to
limit the uplimit of read ahead cache size
Change-Id: Ic370e9372803e538b247b69501875018afeba32e
Signed-off-by: wangwang <wangwang@motorola.com>
Reviewed-on: https://gerrit.mot.com/2650468
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Sometimes the cell voltage exceed the max limit when pump
disable/enable. Only allow the pump enable/disable when soc
is lower than 90%.
Change-Id: I775d22ee7491cd25e2a3a53fbbb5472c80cc8fc6
Signed-off-by: Lei Chen <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2647497
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Submit-Approved: Jira Key
1.modify the voltage of fake battery to 4.2V
2.modify the level of fake battery to 10%
Change-Id: I851ea8d5e80c3fa78eb659992446e0b81dbb43b4
Reviewed-on: https://gerrit.mot.com/2646055
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lei Chen <chenl18@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Powering on and initializing main sensor in camera open instead of
streams configuration to optimize the startup KPI.
It is a common feature and depends on sensor setting.
It can save about 30ms.
Porting this func from (CR) and (CR).
mot-cam-category: KPI
Change-Id: I622db10b469c0e3f26619200bebad95836d8ed9f
Signed-off-by: Liu Yang <liuyang81@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2640370
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zilong Zhang <zhangzl7@lenovo.com>
Reviewed-by: <leixu1@motorola.com>
Reviewed-by: Bolei Shang <shangbl1@lenovo.com>
Reviewed-by: <zhanys2@motorola.com>
Reviewed-by: <wuhao38@lenovo.com>
Reviewed-by: Ji Zhao <zhaoji1@lenovo.com>
Reviewed-by: Dongju He <hedj3@motorola.com>
Reviewed-by: <weilt2@motorola.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Due to camera legacy, the camera uapi kernel headers installation
routines need to be updated to consider the camera legacy support.
This commit fixes the routines to install kernel headers for
'make headers_install' and also 'qti_generate_kernel_headers_arm'
and 'qti_generate_kernel_headers_arm64'.
Change-Id: Iec98dad164d5efc0acaa8f90c29a9672efbe3142
Reviewed-on: https://gerrit.mot.com/2619497
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Submit-Approved: Jira Key
Add camera legacy support by checking BOARD_CONFIG_CAMERA_KERNEL_NAME
to decide which folder will be used to compile the camera techpack.
Change-Id: I674bc4531818273881e068e29cd8449443e9afc6
Reviewed-on: https://gerrit.mot.com/2616053
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Submit-Approved: Marcelo Pincinato <mpcinato@motorola.com>
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
In qrtr_endpoint_post, getting svc_id based on sk_buff->cb after sk_buff
has been queued to the endpoint leads to a potential use-after-free
scenario. To avoid this race condition, get the service ID via
sk_buff->cb before queueing the sk_buff.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2022-33292
Bug: 250627197
CRs-Fixed: 3152855
Change-Id: I53205fdffc08fd6dc48fd158c7fe5966f38aa978
Signed-off-by: Tony Truong <quic_truong@quicinc.com>
Signed-off-by: Ashutosh Verma <ashverma@motorola.com>
Reviewed-on: https://gerrit.mot.com/2601336
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key