Commit Graph
821810 Commits
Author SHA1 Message Date
qctecmdr 649867c065 Merge "qcom/l2cache_counters: Add support to check available CPUS" 2022-09-20 06:06:51 -07:00
qctecmdr 133df27b9b Merge "cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree" 2022-09-20 02:03:03 -07:00
Shivnandan Kumar 2ade71c67b qcom/l2cache_counters: Add support to check available CPUS
Add support to check available CPUS for each cluster.

Change-Id: Ifc40333cdfe4e846b1cd527afc36a84f89bd8538
Signed-off-by: Shivnandan Kumar <quic_kshivnan@quicinc.com>
2022-09-20 11:05:34 +05:30
qctecmdr 6920b254f3 Merge "FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls" 2022-09-16 11:37:05 -07:00
Christian Brauner 8fee3469ba UPSTREAM: binderfs: use refcount for binder control devices too
Binderfs binder-control devices are cleaned up via binderfs_evict_inode
too() which will use refcount_dec_and_test(). However, we missed to set
the refcount for binderfs binder-control devices and so we underflowed
when the binderfs instance got unmounted. Pretty obvious oversight and
should have been part of the more general UAF fix. The good news is that
having test cases (suprisingly) helps.

Technically, we could detect that we're about to cleanup the
binder-control dentry in binderfs_evict_inode() and then simply clean it
up. But that makes the assumption that the binder driver itself will
never make use of a binderfs binder-control device after the binderfs
instance it belongs to has been unmounted and the superblock for it been
destroyed. While it is unlikely to ever come to this let's be on the
safe side. Performance-wise this also really doesn't matter since the
binder-control device is only every really when creating the binderfs
filesystem or creating additional binder devices. Both operations are
pretty rare.

Fixes: f0fe2c0f050d ("binder: prevent UAF for binderfs devices II")
Link: https://lore.kernel.org/r/CA+G9fYusdfg7PMfC9Xce-xLT7NiyKSbgojpK35GOm=Pf9jXXrA@mail.gmail.com
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20200311105309.1742827-1-christian.brauner@ubuntu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 211b64e4b5b6bd5fdc19cd525c2cc9a90e6b0ec9)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idb5e9e8945fa95506f3ff4f15bde3efaf65d7c9f
Git-commit: d2437b10ba
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2022-09-16 15:42:17 +05:30
qctecmdr 1e0b3aa120 Merge "media:uvc: supports dynamic setting of urb configuration" 2022-09-15 09:47:26 -07:00
haibinzhang (张海斌) e10bd267a4 FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls
emulation_proc_handler() changes table->data for proc_dointvec_minmax
and can generate the following Oops if called concurrently with itself:

 | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
 | Internal error: Oops: 96000006 [#1] SMP
 | Call trace:
 | update_insn_emulation_mode+0xc0/0x148
 | emulation_proc_handler+0x64/0xb8
 | proc_sys_call_handler+0x9c/0xf8
 | proc_sys_write+0x18/0x20
 | __vfs_write+0x20/0x48
 | vfs_write+0xe4/0x1d0
 | ksys_write+0x70/0xf8
 | __arm64_sys_write+0x20/0x28
 | el0_svc_common.constprop.0+0x7c/0x1c0
 | el0_svc_handler+0x2c/0xa0
 | el0_svc+0x8/0x200

To fix this issue, keep the table->data as &insn->current_mode and
use container_of() to retrieve the insn pointer. Another mutex is
used to protect against the current_mode update but not for retrieving
insn_emulation as table->data is no longer changing.

Bug: 237540956
Co-developed-by: hewenliang <hewenliang4@huawei.com>
Signed-off-by: hewenliang <hewenliang4@huawei.com>
Signed-off-by: Haibin Zhang <haibinzhang@tencent.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220128090324.2727688-1-hewenliang4@huawei.com
Link: https://lore.kernel.org/r/9A004C03-250B-46C5-BF39-782D7551B00E@tencent.com
Signed-off-by: Will Deacon <will@kernel.org>
[Lee: Added Fixes: tag]
(cherry picked from commit af483947d472eccb79e42059276c4deed76f99a6
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core)
Fixes: 587064b610 ("arm64: Add framework for legacy instruction emulation")
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If9b96bb79c79903f9d8292e719b06fdef57ef1c5
Git-commit: 5d2c9fe6e3
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: PavanKumar S.R <quic_pavasr@quicinc.com>
2022-09-14 02:43:27 -07:00
Arjun Singh 0441dc4864 media:uvc: supports dynamic setting of urb configuration
Frames are corrupted for higher resolution with default URB queue
size and frame size. This patch creates a sysfs node to support
dynamic setting of number of packers per urb  and maximum packet
size for higher resolution frames.
$ find . -name urb_config.
$ echo qsize:fsize > urb_config.

Change-Id: I70aaad824049acdc21a8a52242066a6437b96833
Signed-off-by: Arjun Singh <quic_arsingh@quicinc.com>
2022-09-14 12:13:00 +05:30
qctecmdr 8510870e67 Merge "msm: camera: Increase the total number of camera ID's supported" 2022-09-13 15:55:28 -07:00
qctecmdr d7c7e7b326 Merge "FROMLIST: binder: fix UAF of ref->proc caused by race condition" 2022-09-13 15:55:28 -07:00
qctecmdr 8270d4b325 Merge "usb: gadget: rndis: prevent integer overflow in rndis_set_response()" 2022-09-13 11:41:26 -07:00
qctecmdr 23f1ccf9a6 Merge "soc: qcom: socinfo: Add soc information for Khaje IOT" 2022-09-13 03:27:03 -07:00
Waseem Akhtar 1eddffa235 msm: camera: Increase the total number of camera ID's supported
Increase the total number of camera ID's supported.

Change-Id: Ib1eb78eb1d6686b28c90b06b87fa57bcc1f45c07
Signed-off-by: Waseem Akhtar <quic_wakhtar@quicinc.com>
2022-09-13 12:25:42 +05:30
Shivnandan Kumar 1e5ab21d52 cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree
When the kernel is configured with CONFIG_NR_CPUS smaller than the
number of CPU nodes in the device tree(DT), all the CPU nodes parsing
done to fetch topology information will fail. This is not reasonable
as it is valid to have all the physical CPUs in the system in the DT.
Let us just skip such CPU DT nodes that are not used in the kernel
rather than returning an error.

Change-Id: Ic7c50afd52741eb2a472fe33d532835f767e8d1c
Signed-off-by: Shivnandan Kumar <quic_kshivnan@quicinc.com>
2022-09-13 10:37:45 +05:30
Miklos Szeredi 40c4f6fd36 fuse: make sure reclaim doesn't write the inode
In writeback cache mode mtime/ctime updates are cached, and flushed to the
server using the ->write_inode() callback.

Closing the file will result in a dirty inode being immediately written,
but in other cases the inode can remain dirty after all references are
dropped.  This result in the inode being written back from reclaim, which
can deadlock on a regular allocation while the request is being served.

The usual mechanisms (GFP_NOFS/PF_MEMALLOC*) don't work for FUSE, because
serving a request involves unrelated userspace process(es).

Instead do the same as for dirty pages: make sure the inode is written
before the last reference is gone.

 - fallocate(2)/copy_file_range(2): these call file_update_time() or
   file_modified(), so flush the inode before returning from the call

 - unlink(2), link(2) and rename(2): these call fuse_update_ctime(), so
   flush the ctime directly from this helper

fuse_flush_time_update(inode) was skipped to call in __fuse_copy_file_range()
because of huge dependent changes.

Change-Id: I102dab1992c9ed2b5e89606265b3d3aa9c1cdb8a
Reported-by: chenguanyou <chenguanyou@xiaomi.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Git-commit: 5c791fe1e2a4f401f819065ea4fc0450849f1818
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
2022-09-12 14:16:06 +05:30
Dan Carpenter 72b8278666 usb: gadget: rndis: prevent integer overflow in rndis_set_response()
commit 65f3324f4b6fed78b8761c3b74615ecf0ffa81fa upstream.

If "BufOffset" is very large the "BufOffset + 8" operation can have an
integer overflow.

Change-Id: I2d68b3cc11832de13cf33f3eb56f1e8ecac4dda6
Cc: stable@kernel.org
Fixes: 38ea1eac7d88 ("usb: gadget: rndis: check size of RNDIS_MSG_SET command")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220301080424.GA17208@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 138d4f739b
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: PavanKumar S.R <quic_pavasr@quicinc.com>
2022-09-11 22:51:08 -07:00
Carlos Llamas 7cdb30b02b FROMLIST: binder: fix UAF of ref->proc caused by race condition
A transaction of type BINDER_TYPE_WEAK_HANDLE can fail to increment the
reference for a node. In this case, the target proc normally releases
the failed reference upon close as expected. However, if the target is
dying in parallel the call will race with binder_deferred_release(), so
the target could have released all of its references by now leaving the
cleanup of the new failed reference unhandled.

The transaction then ends and the target proc gets released making the
ref->proc now a dangling pointer. Later on, ref->node is closed and we
attempt to take spin_lock(&ref->proc->inner_lock), which leads to the
use-after-free bug reported below. Let's fix this by cleaning up the
failed reference on the spot instead of relying on the target to do so.

  ==================================================================
  BUG: KASAN: use-after-free in _raw_spin_lock+0xa8/0x150
  Write of size 4 at addr ffff5ca207094238 by task kworker/1:0/590

  CPU: 1 PID: 590 Comm: kworker/1:0 Not tainted 5.19.0-rc8 #10
  Hardware name: linux,dummy-virt (DT)
  Workqueue: events binder_deferred_func
  Call trace:
   dump_backtrace.part.0+0x1d0/0x1e0
   show_stack+0x18/0x70
   dump_stack_lvl+0x68/0x84
   print_report+0x2e4/0x61c
   kasan_report+0xa4/0x110
   kasan_check_range+0xfc/0x1a4
   __kasan_check_write+0x3c/0x50
   _raw_spin_lock+0xa8/0x150
   binder_deferred_func+0x5e0/0x9b0
   process_one_work+0x38c/0x5f0
   worker_thread+0x9c/0x694
   kthread+0x188/0x190
   ret_from_fork+0x10/0x20

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>

Bug: 239630375
Link: https://lore.kernel.org/all/20220801182511.3371447-1-cmllamas@google.com/
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I5085dd0dc805a780a64c057e5819f82dd8f02868
(cherry picked from commit ae3fa5d16a02ba7c7b170e0e1ab56d6f0ba33964)
Git-commit: 70f060f93c
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: PavanKumar S.R <quic_pavasr@quicinc.com>
2022-09-11 22:03:40 -07:00
qctecmdr 59120562ea Merge "msm_perf: check cpu_possible to improve stability" 2022-09-11 20:09:17 -07:00
Vijay Dandiga 93906db14a msm_perf: check cpu_possible to improve stability
check cpu_possible to improve stability

Change-Id: I9ce3b5a5a6b1e846f44ffb9e255cc5b6b701b377
Signed-off-by: Gaurav Singh <quic_sgaurav@quicinc.com>
Signed-off-by: Vijay Dandiga <quic_vdandiga@quicinc.com>
2022-09-08 22:50:42 +05:30
Linux Build Service Account 0ebb9f4bf0 Merge 367074bf05 on remote branch
Change-Id: I9bccad3f0509f258749c68a5d77440a54de7ac2d
2022-09-08 05:44:56 -07:00
Vamsi Krishna Gattupalli 2b533456ca msm: adsprpc: Validate the CID
Validating the CID is a valid channel number.

Change-Id: Ic11a259e8a04088f54b3df4bad982e669b02ee71
Acked-by: Abhishek Singh <abhishes@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2022-09-08 10:34:30 +05:30
Naina Mehta cd23045ae0 soc: qcom: socinfo: Add soc information for Khaje IOT
Add SOC ID to support socinfo for Khaje IOT platform.

Change-Id: Ibcc958d1f7326afeccb53c5cf6582f7f2269b46b
Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
2022-08-29 19:23:16 +05:30
qctecmdr 367074bf05 Merge "soc: qcom: socinfo: Add soc information for KhajeG" 2022-08-26 08:07:55 -07:00
Komal Bajaj ba4ca41a19 soc: qcom: socinfo: Add soc information for KhajeG
Add SOC ID to support socinfo for KhajeG platform.

Change-Id: Ie77ac540879e392754e51a3857c2c1317c2acb7c
Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com>
2022-08-26 14:28:11 +05:30
Veerendra Kumar Kamsali 65d6579e57 msm: ipa: Set the logbuf NULL after destroy
Set the ipa3_ctx->logbuf NULL after destroy,or
IPAERR will use the ipa3_ctx->logbuf after free it,
that can make crash.

Change-Id: I470c4a043d426d7620c01fadac1f1cd12ad54b08
Signed-off-by: Veerendra Kumar Kamsali <quic_veekum@quicinc.com>
2022-08-25 09:57:37 -07:00
qctecmdr 923bb76135 Merge "f2fs: guarantee to write dirty data when enabling checkpoint back" 2022-08-23 23:35:40 -07:00
qctecmdr 31f6ed57fb Merge "msm: kgsl: use kvcalloc for ringbuffer submission" 2022-08-23 10:57:18 -07:00
qctecmdr e4d67e1872 Merge "f2fs: flush data when enabling checkpoint back" 2022-08-23 04:36:44 -07:00
Rakesh Kota 3bdb099188 power: smb1398-charger: Fix wrong IIN value in register
There is possiblity of setting wrong IIN value, if user vote
for greater then IIN_MAX (5000mA <), so fix this by updating
the IIN_MAX as IIN value.

Change-Id: I50df73d71514967d0d383d612f1c9ddba58437ce
Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>
2022-08-18 21:11:32 +05:30
Wei Tan e9594b2d64 misc: updated log output for nordic driver
Cleaned debug log output when nordic 
controllers notify data to HMD.

Change-Id: Ibd767d3db181ff7b2f99976e910a4fd2f6c85727
Signed-off-by: Wei Tan <quic_weitan@quicinc.com>
2022-08-18 11:22:13 +08:00
qctecmdr 2cd3a2a1cb Merge "cnss2: Avoid dumping PBL/SBL registers" 2022-08-17 05:57:33 -07:00
qctecmdr 19dc779134 Merge "msm: adsprpc: Fix for hyp_assign_phys double call" 2022-08-17 05:57:33 -07:00
qctecmdr f50e566257 Merge "mmc: Enable Inline Crypto Engine clocks before programming key" 2022-08-17 02:35:45 -07:00
Vamsi Krishna Gattupalli 905c96e532 msm: adsprpc: Fix for hyp_assign_phys double call
A check is introduced to restrict  the double call of
hyp_assign_phys for the same address.

Change-Id: I0ac984af9fe456d317c7c2d99d6d1290f86830e8
Acked-by: Sandheep Balasubramanian <sandheep@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2022-08-16 03:06:16 -07:00
Linux Build Service Account 708f89fd47 Merge b5bac2400f on remote branch
Change-Id: Iba868d996856cd8d4d5919179936b6d25c7de5ef
2022-08-15 02:01:52 -07:00
qctecmdr b10e8b674d Merge "defconfig: kona: Enable I210 driver for Ethernet Card" 2022-08-11 06:31:21 -07:00
Pranav Patel 3d7bc844b2 msm: kgsl: use kvcalloc for ringbuffer submission
kcalloc returns out of memory in low memory conditions even if memory
is available in non-contiguous manner. This results in failure to
submit commands to ringbuffer. Use kvcalloc in place of kcalloc so
that when kcalloc fails in low memory conditions, commands can be
submitted if kvcalloc can provide enough memory.

Change-Id: If6a20e35983982b5c0888e5f7dabecfa8c026bcb
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
2022-08-11 18:45:52 +05:30
Lakshit Tyagi de1faa1406 defconfig: kona: Enable I210 driver for Ethernet Card
Enable I210 driver for Ethernet Card.

Change-Id: I8e996e5f47bf2df00efca6d614c9a5c03636f23f
Signed-off-by: Lakshit Tyagi <quic_ltyagi@quicinc.com>
2022-08-11 11:56:58 +05:30
Lakshit Tyagi 2c69c780bb defconfig: kona: Enable I210 driver for Ethernet Card
Enable I210 driver for Ethernet Card for perf builds.

Change-Id: Ib31ae5f07209f7056597a57421ec5c1eb6720779
Signed-off-by: Lakshit Tyagi <quic_ltyagi@quicinc.com>
2022-08-10 23:12:53 -07:00
qctecmdr 227ed6d234 Merge "drivers: thermal: Add valid cpu check in cpu isolate driver" 2022-08-10 04:55:59 -07:00
Priyansh Jain d6f59978b7 drivers: thermal: Add valid cpu check in cpu isolate driver
Add a check for valid cpu and create cpu isolation cooling
device only for those cpu's which passes this check.

Change-Id: Ic931a1aa51857ed109555e055879cb39da11f3cf
Signed-off-by: Priyansh Jain <quic_priyjain@quicinc.com>
2022-08-10 09:43:03 +05:30
Nirav Shah f6448cff88 cnss2: Avoid dumping PBL/SBL registers
Avoid dumping primary and secondary register dump
when crash happens in mission mode as these register might not
have correct info.

Change-Id: Ie6004924ecaf1c7177888c49303dbb221925dfc7
Signed-off-by: Nirav Shah <quic_nnshah@quicinc.com>
2022-08-10 09:37:38 +05:30
Pranav Patel 66e3c113f8 msm: kgsl: Use consolidated power level for thermal limit
Ensure that thermal limits set by devfreq cooling framework,
limits framework and sysfs nodes (like gpu_max_clock) don't
overwrite each other, instead a consolidated (lowest of all)
limit is used as a final thermal limit. If this fails, fall back
to setting thermal_pwrlevel directly.

Change-Id: Ia6ec60e4881176da064c3cd5cf4ffd8e0a8e1046
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
2022-08-09 17:14:58 +05:30
Abhinav Gupta b5bac2400f msm: kona_defconfig: Added the flag for ICE Driver as required by FDE
Enable the flag required to support ICE Driver for
Full Disk Encryption feature.

Change-Id: Icd107924f7d1deb1bbb797f155bca8e6aebac72c
Signed-off-by: Abhinav Gupta <quic_abgupt@quicinc.com>
2022-08-02 12:34:57 +05:30
Pruthvi Kurada 8b34b02c40 mmc: Enable Inline Crypto Engine clocks before programming key
Due to mmc optimizations mmc host controllers are turned off during
mmc suspend. These clocks have to be turned ON during ICE program/evict
key. In PFK based FBE there would be numerous calls to program/evict
ICE key.
The change ensure required clocks are turned on before programming
crypto key to avoid any unclocked access.
Validations done:-
1) Flash P SDM660 build and let device bootup successfully to UI.
2) adb shell getprop ro.crypto.state: encrypted
   adb shell getprop ro.crypto.type: file
3) Create files under /data and /data/misc/vold/user_key
4) Flash T build except userdata i.e. OTA to T.
5) Device able to boot successfully to UI.
6) Files created earlier got retained after flashing T build.

Change-Id: Ia1629a6b373895af42b1c724aebbe7ae6fc7de93
Signed-off-by: Pruthvi Kurada <quic_pkurada@quicinc.com>
2022-07-29 13:31:10 +05:30
Kamal Wadhwa 3da7600ca4 power: qpnp-fg-gen4: Improve SDAM corruption check
Add support for 4-byte SDAM cookie, instead of 1-byte(default),
to make the SDAM corruption check more accurate.

Change-Id: I084c44eef08d4555896a7efb38a098420ebfec69
Signed-off-by: Kamal Wadhwa <quic_kamalw@quicinc.com>
2022-07-27 20:38:10 +05:30
qctecmdr 523e8bfd6e Merge "net: usb: ax88179_178a: support setting mac to eeprom" 2022-07-25 07:22:30 -07:00
qctecmdr e5e657e49f Merge "gup: document and work around "COW can break either way" issue" 2022-07-25 02:34:28 -07:00
Wei Tan 0afc5ff087 misc: updates to controller's driver
Cleaned up and updated the driver for the
end-to-end scenario of XR reference device
connecting with the Remote VR controllers.

Change-Id: I1cb725c331b808addc7c5b8af0422ce616fa7f03
Signed-off-by: Wei Tan <quic_weitan@quicinc.com>
2022-07-22 09:01:56 -07:00
qctecmdr 4508a5698d Merge "power: qpnp-fg-gen4: Update msoc on every FVSS soc update" 2022-07-22 03:32:20 -07:00