Commit Graph

1023649 Commits

Author SHA1 Message Date
qctecmdr
1c893f7c9f Merge "msm: ep_pcie: Move link enumeration part to workqueue" 2023-04-02 23:11:16 -07:00
qctecmdr
72c8190b8e Merge "defconfig: Add changes to enable AP72200 regulator driver" 2023-04-02 23:11:14 -07:00
Todd Kjos
d88cd5c7f0 ANDROID: Fix kernelci break: eventfd_signal_mask redefined
Fix a merge issue where eventfd_signal_mask() was added twice which
resulted in kernelci issues when !CONFIG_EVENTFD:

include/linux/eventfd.h:76:19: error: redefinition of ‘eventfd_signal_mask’

Fixes: 4ef66581d7 ("eventfd: provide a eventfd_signal_mask() helper")
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ifdd212e857c2ff76c75283e77b9978e51a96d178
2023-03-31 19:23:38 +00:00
Rakesh Kota
00aa363f8c leds: qpnp-flash-v2: fix the cleanup logic in the probe failure path
Fix the cleanup logic in the driver probe failure code flow.

Change-Id: I08436bed13803b00803faf8bce25afa54aef9e6f
Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>
2023-03-31 20:07:56 +05:30
Vamsi Krishna Gattupalli
3e711613b4 msm: adsprpc: To prohibit accumulating logs of minidump data
Minidump ramdump collection appends dump data of
previous CDSP SSR dump elf to current elf. To avoid this
buffer cleaned up and data node removed after taking dump.

Change-Id: Ic412bf5c51769b1d69cd678a0a67225281d4bfcd
Acked-by: Ansa Ahmed <ansa@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
2023-03-31 17:19:24 +05:30
Krishna chaitanya chundru
3d63d5327e msm: ep_pcie: Move link enumeration part to workqueue
When there is no host attached ep driver is creating a huge boot
delay about 35sec, as our driver is waiting for the host to deassert
PERST in response to WAKE. All this waiting happening in the driver
probe context. So it's delaying our driver probe completion and
thus affecting the overall kernel bootup.

To avoid this scenario, offloading the link training part to a
worker thread context.

Change-Id: Iafd1c797ac7e51baab9b8758c4ead8c9d563336a
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
2023-03-31 15:55:56 +05:30
qctecmdr
95c488493c Merge "defconfig: Clarence: gki: Enable testmode config" 2023-03-31 02:33:21 -07:00
Sai Pavan Akhil Remella
8f73d1ec90 defconfig: Clarence: gki: Enable CONFIG_BUS_AUTO_SUSPEND
Enable CONFIG_BUS_AUTO_SUSPEND to allow runtime suspend.

Change-Id: I9867f7e9e1ec0887fba92ebb2eb83e7b7a59d400
CRs-Fixed: 3425673
Signed-off-by: Sai Pavan Akhil Remella<quic_saipavan@quicinc.com>
2023-03-31 12:29:21 +05:30
Srikanth Marepalli
b794f9b60a defconfig: Clarence: gki: Enable testmode config
Enable the test mode config in Parrot GKI config set.

Change-Id: I69d01fb73db607632ea1bd394c7ce5b8a0836a71
CRs-Fixed: 3446188
Signed-off-by: Srikanth Marepalli <quic_srimarep@quicinc.com>
2023-03-30 17:29:39 +05:30
qctecmdr
1e5eaed198 Merge "interconnect: qcom: diwali: Mark QUP BCMs as keepalive" 2023-03-30 03:50:44 -07:00
qctecmdr
00e713ce8f Merge "i2c: i2c-msm-geni: use dma coherent memory for scatter list" 2023-03-30 03:50:44 -07:00
qctecmdr
6c5bd23762 Merge "msm: kgsl: Keep postamble packets in a privileged buffer" 2023-03-30 03:50:43 -07:00
Kalpak Kawadkar
4965885e27 bindings: clock: gcc-ravelin: Add support for venus clock resets
Add support for gcc venus clock resets on RAVELIN platform.

Change-Id: I971ac6b2bc2fac6a6fb69bd8ae106fd310e374ee
Signed-off-by: Kalpak Kawadkar <quic_kkawadka@quicinc.com>
2023-03-30 14:27:05 +05:30
qctecmdr
d0a00f6bf9 Merge "defconfig: build.config: Add earlycon option to commandline" 2023-03-29 23:51:37 -07:00
qctecmdr
f6a02ecd46 Merge "interconnect: qcom: parrot: Mark QUP BCMs as keepalive" 2023-03-29 23:51:36 -07:00
qctecmdr
4d2baf5da5 Merge "usb: dwc3: dwc3-msm-core: Add support to dump the qscratch registers" 2023-03-29 23:51:36 -07:00
qctecmdr
f923ffca86 Merge "interconnect: qcom: ravelin: Mark QUP BCMs as keepalive" 2023-03-29 23:51:35 -07:00
qctecmdr
e4d110839b Merge "remoteproc: qcom_spss: Fix subdevice add order" 2023-03-29 23:51:35 -07:00
Srinivasarao Pathipati
3ccfe3d43c Merge keystone/android12-5.10-keystone-qcom-release.160+ (026be06) into msm-5.10
* refs/heads/tmp-026be06:
  UPSTREAM: ext4: refuse to create ea block when umounted
  UPSTREAM: ext4: optimize ea_inode block expansion
  UPSTREAM: ext4: allocate extended attribute value in vmalloc area
  UPSTREAM: usb: gadget: composite: Draw 100mA current if not configured
  UPSTREAM: usb: dwc3: gadget: Change condition for processing suspend event
  ANDROID: GKI: update xiaomi symbol list
  UPSTREAM: net/sched: tcindex: update imperfect hash filters respecting rcu
  FROMGIT: KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available()
  UPSTREAM: KVM: arm64: Allow KVM to be disabled from the command line
  ANDROID: ABI: Cuttlefish Symbol update
  Revert "ANDROID: dma-ops: Add restricted vendor hook"
  UPSTREAM: io_uring: ensure that io_init_req() passes in the right issue_flags
  FROMGIT: usb: gadget: configfs: Restrict symlink creation is UDC already binded
  UPSTREAM: io_uring: add missing lock in io_get_file_fixed
  ANDROID: ABI: Update oplus symbol list
  ANDROID: vendor_hooks: Add hooks for mutex and rwsem optimistic spin
  ANDROID: dma-buf: heaps: Don't lock unused dmabuf_page_pool mutex
  ANDROID: mm/filemap: Fix missing put_page() for speculative page fault
  UPSTREAM: KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS
  UPSTREAM: net: qrtr: combine nameservice into main module
  ANDROID: GKI: Update symbol list for mtk
  FROMLIST: rcu-tasks: Fix build error
  ANDROID: incremental fs: Move throttling to outside page lock
  ANDROID: incremental fs: Fix race between truncate and write last block
  UPSTREAM: usb: gadget: u_serial: Add null pointer check in gserial_resume
  Revert "ANDROID: GKI: loadavg: Export for get_avenrun"
  ANDROID: ABI: Update allowed list for QCOM
  ANDROID: Update symbol list for mtk
  UPSTREAM: ext4: add inode table check in __ext4_get_inode_loc to aovid possible infinite loop
  UPSTREAM: net_sched: reject TCF_EM_SIMPLE case for complex ematch module
  UPSTREAM: io_uring/rw: remove leftover debug statement
  UPSTREAM: io_uring/rw: ensure kiocb_end_write() is always called
  UPSTREAM: io_uring: fix double poll leak on repolling
  UPSTREAM: io_uring: Clean up a false-positive warning from GCC 9.3.0
  UPSTREAM: io_uring/net: fix fast_iov assignment in io_setup_async_msg()
  UPSTREAM: io_uring: io_kiocb_update_pos() should not touch file for non -1 offset
  UPSTREAM: io_uring/rw: defer fsnotify calls to task context
  UPSTREAM: io_uring: do not recalculate ppos unnecessarily
  UPSTREAM: io_uring: update kiocb->ki_pos at execution time
  UPSTREAM: io_uring: remove duplicated calls to io_kiocb_ppos
  UPSTREAM: io_uring: ensure that cached task references are always put on exit
  UPSTREAM: io_uring: fix CQ waiting timeout handling
  UPSTREAM: io_uring: lock overflowing for IOPOLL
  UPSTREAM: io_uring: check for valid register opcode earlier
  UPSTREAM: io_uring: fix async accept on O_NONBLOCK sockets
  UPSTREAM: io_uring: allow re-poll if we made progress
  UPSTREAM: io_uring: support MSG_WAITALL for IORING_OP_SEND(MSG)
  UPSTREAM: io_uring: add flag for disabling provided buffer recycling
  UPSTREAM: io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly
  UPSTREAM: io_uring: improve send/recv error handling
  UPSTREAM: io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL
  BACKPORT: iommu: Avoid races around device probe
  UPSTREAM: io_uring/io-wq: only free worker if it was allocated for creation
  UPSTREAM: io_uring/io-wq: free worker if task_work creation is canceled
  UPSTREAM: io_uring: Fix unsigned 'res' comparison with zero in io_fixup_rw_res()
  UPSTREAM: um: Increase stack frame size threshold for signal.c

 Conflicts:
	net/qrtr/Makefile
	net/qrtr/af_qrtr.c

Change-Id: I84acecd94e0545c7423d04428e22526c6237c371
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2023-03-30 11:50:36 +05:30
Eric Biggers
2a7aed7298 ANDROID: dm-default-key: update for blk_crypto_evict_key() returning void
blk_crypto_evict_key() now returns void, so update default_key_dtr()
accordingly.

Bug: 270098322
Change-Id: I6add49a8f792c51f33e7adb189a9e7ed5ff410b0
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-03-29 20:05:47 +00:00
Eric Biggers
0dad2818cb BACKPORT: FROMGIT: blk-crypto: make blk_crypto_evict_key() more robust
If blk_crypto_evict_key() sees that the key is still in-use (due to a
bug) or that ->keyslot_evict failed, it currently just returns while
leaving the key linked into the keyslot management structures.

However, blk_crypto_evict_key() is only called in contexts such as inode
eviction where failure is not an option.  So actually the caller
proceeds with freeing the blk_crypto_key regardless of the return value
of blk_crypto_evict_key().

These two assumptions don't match, and the result is that there can be a
use-after-free in blk_crypto_reprogram_all_keys() after one of these
errors occurs.  (Note, these errors *shouldn't* happen; we're just
talking about what happens if they do anyway.)

Fix this by making blk_crypto_evict_key() unlink the key from the
keyslot management structures even on failure.

Also improve some comments.

Fixes: 1b26283970 ("block: Keyslot Manager for Inline Encryption")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230315183907.53675-2-ebiggers@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Bug: 270098322
(cherry picked from commit 5c7cb94452901a93e90c2230632e2c12a681bc92
 https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-next)
Change-Id: I4e8983ad7db94ea8cd422743196da8854adda552
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-03-29 20:05:47 +00:00
Eric Biggers
b3926f1a34 BACKPORT: FROMGIT: blk-crypto: make blk_crypto_evict_key() return void
blk_crypto_evict_key() is only called in contexts such as inode eviction
where failure is not an option.  So there is nothing the caller can do
with errors except log them.  (dm-table.c does "use" the error code, but
only to pass on to upper layers, so it doesn't really count.)

Just make blk_crypto_evict_key() return void and log errors itself.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230315183907.53675-2-ebiggers@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Bug: 270098322
(cherry picked from commit 70493a63ba04f754f7a7dd53a4fcc82700181490
 https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-next)
Change-Id: I8b9c7a74473e21fb740f021ac9f2fff95f986aa4
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-03-29 20:05:47 +00:00
Eric Biggers
e7bfca1670 BACKPORT: FROMGIT: blk-mq: release crypto keyslot before reporting I/O complete
Once all I/O using a blk_crypto_key has completed, filesystems can call
blk_crypto_evict_key().  However, the block layer currently doesn't call
blk_crypto_put_keyslot() until the request is being freed, which happens
after upper layers have been told (via bio_endio()) the I/O has
completed.  This causes a race condition where blk_crypto_evict_key()
can see 'slot_refs != 0' without there being an actual bug.

This makes __blk_crypto_evict_key() hit the
'WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)' and return without
doing anything, eventually causing a use-after-free in
blk_crypto_reprogram_all_keys().  (This is a very rare bug and has only
been seen when per-file keys are being used with fscrypt.)

There are two options to fix this: either release the keyslot before
bio_endio() is called on the request's last bio, or make
__blk_crypto_evict_key() ignore slot_refs.  Let's go with the first
solution, since it preserves the ability to report bugs (via
WARN_ON_ONCE) where a key is evicted while still in-use.

Fixes: a892c8d52c ("block: Inline encryption support for blk-mq")
Cc: stable@vger.kernel.org
Reviewed-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20230315183907.53675-2-ebiggers@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Bug: 270098322
(cherry picked from commit 9cd1e566676bbcb8a126acd921e4e194e6339603
 https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-next)
Change-Id: Ic2c2426db7693a06901c7893d481471f30de03b2
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-03-29 20:05:47 +00:00
Akhil P Oommen
72e14447dd msm: kgsl: Keep postamble packets in a privileged buffer
Postamble packets are executed in privileged mode by gpu. So we should keep
them in a privileged scratch buffer to block userspace access. For
targets with APRIV feature support, we can mark the preemption scratch
buffer as privileged too to avoid similar issues in future.

Change-Id: Ifda360dda251083f38dfde80ce1b5dc83daae902
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Kaushal Sanadhya <quic_ksanadhy@quicinc.com>
2023-03-29 10:13:50 -07:00
Matthias Schiffer
469e02cc6d BACKPORT: of: base: Skip CPU nodes with "fail"/"fail-..." status
Allow fully disabling CPU nodes using status = "fail".

This allows a bootloader to change the number of available CPUs (for
example when a common DTS is used for SoC variants with different numbers
of cores) without deleting the nodes altogether, which could require
additional fixups to avoid dangling phandle references.

Unknown status values (everything that is not "okay"/"ok", "disabled" or
"fail"/"fail-...") will continue to be interpreted like "disabled",
meaning that the CPU can be enabled during boot.

References:
- https://www.spinics.net/lists/devicetree-spec/msg01007.html
- https://github.com/devicetree-org/dt-schema/pull/61

Bug: 275500667
Change-Id: I0d0028c1d5f529c43f184556ac661c50fe026741
Link: https://lore.kernel.org/all/CAL_Jsq+1LsTBdVaODVfmB0eme2jMpNL4VgKk-OM7rQWyyF0Jbw@mail.gmail.com/
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Tested-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Link: https://lore.kernel.org/r/20211122114536.2981-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 4fdd0736a3b1634613d1d2eeb3328d27522052fb)
Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com>
2023-03-29 16:45:54 +00:00
Pietro Borrello
e0d8206f5d UPSTREAM: hid: bigben_probe(): validate report count
[ Upstream commit b94335f899542a0da5fafc38af8edcaf90195843 ]

bigben_probe() does not validate that the output report has the
needed report values in the first field.
A malicious device registering a report with one field and a single
value causes an head OOB write in bigben_worker() when
accessing report_field->value[1] to report_field->value[7].
Use hid_validate_values() which takes care of all the needed checks.

Bug: 268589017
Fixes: 256a90ed9e ("HID: hid-bigbenff: driver for BigBen Interactive PS3OFMINIPAD gamepad")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230211-bigben-oob-v1-1-d2849688594c@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I575c5d4c8a63a2065752a45c47b23cf725cc57ae
2023-03-29 15:04:53 +01:00
Pietro Borrello
7fd7972fc1 UPSTREAM: HID: bigben: use spinlock to safely schedule workers
[ Upstream commit 76ca8da989c7d97a7f76c75d475fe95a584439d7 ]

Use spinlocks to deal with workers introducing a wrapper
bigben_schedule_work(), and several spinlock checks.
Otherwise, bigben_set_led() may schedule bigben->worker after the
structure has been freed, causing a use-after-free.

Bug: 268589017
Fixes: 4eb1b01de5 ("HID: hid-bigbenff: fix race condition for scheduled work during removal")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230125-hid-unregister-leds-v4-3-7860c5763c38@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ia3f47b68264f6c492597b0b0603f6822dc624f2b
2023-03-29 15:04:44 +01:00
Pietro Borrello
1bba06f3e8 UPSTREAM: HID: bigben_worker() remove unneeded check on report_field
[ Upstream commit 27d2a2fd844ec7da70d19fabb482304fd1e0595b ]

bigben_worker() checks report_field to be non-NULL.
The check has been added in commit
918aa1ef104d ("HID: bigbenff: prevent null pointer dereference")
to prevent a NULL pointer crash.
However, the true root cause was a missing check for output
reports, patched in commit
c7bf714f8755 ("HID: check empty report_list in bigben_probe()"),
where the type-confused report list_entry was overlapping with
a NULL pointer, which was then causing the crash.

Bug: 268589017
Fixes: 918aa1ef104d ("HID: bigbenff: prevent null pointer dereference")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230125-hid-unregister-leds-v4-2-7860c5763c38@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ide36490e2e4482f6cf9af931bef052f172419e31
2023-03-29 15:04:36 +01:00
Pietro Borrello
aaffce1ef4 UPSTREAM: HID: bigben: use spinlock to protect concurrent accesses
[ Upstream commit 9fefb6201c4f8dd9f58c581b2a66e5cde2895ea2 ]

bigben driver has a worker that may access data concurrently.
Proct the accesses using a spinlock.

Bug: 268589017
Fixes: 256a90ed9e ("HID: hid-bigbenff: driver for BigBen Interactive PS3OFMINIPAD gamepad")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230125-hid-unregister-leds-v4-1-7860c5763c38@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I8b7a34cba4c79c26f3d1912c97a83820d88bd5a4
2023-03-29 15:04:17 +01:00
Anil Veshala Veshala
d47d2ad122 i2c: i2c-msm-geni: use dma coherent memory for scatter list
For debug purpose use dma coherent memory for scatter list.

Change-Id: I10f02a936faab16473b5d22362776a989a4f1c8f
Signed-off-by: Anil Veshala Veshala <quic_aveshala@quicinc.com>
2023-03-29 04:31:17 -07:00
qctecmdr
1b74ebcb72 Merge "dmaengine: gpi: add channel id check" 2023-03-29 03:54:47 -07:00
qctecmdr
05dadd41a8 Merge "i2c: i2c-msm-geni: handle gsi error conditions" 2023-03-29 03:54:45 -07:00
Tushar Nimkar
a65d6bea98 arm64: config: Enable CONFIG_PM_AUTOSLEEP for waipio_le
This change enables CONFIG_PM_AUTOSLEEP.

Change-Id: I32991f86571af54b2f7a3885545757df0d21fea4
Signed-off-by: Tushar Nimkar <quic_tnimkar@quicinc.com>
2023-03-29 00:23:28 -07:00
Umang Chheda
b228c90eb3 defconfig: Add changes to enable AP72200 regulator driver
Add changes to enable AP72200 regulator driver.

Change-Id: I388cdeaa0169ddd59092e679c3886b9245334db4
Signed-off-by: Umang Chheda <quic_uchheda@quicinc.com>
2023-03-29 00:00:44 -07:00
Umang Chheda
81bc153aeb regulator: Add changes to support AP72200 buck-boost regulator
Add driver for AP72200 buck-boost regulator by vendor
"Diodes Incorporated" so that it can output a specified
voltage between 2.6 to 5.14 V, which can be set via
"regulator-min-voltage" DT property.

Change-Id: If18aae6814e3e5a62f1ec2f611dacac7b035f9f0
Signed-off-by: Umang Chheda <quic_uchheda@quicinc.com>
2023-03-29 12:11:05 +05:30
qctecmdr
5da05cd6f1 Merge "msm: kgsl: Add support for VA-Minidump in hwsched path" 2023-03-28 20:48:22 -07:00
Hrishabh Rajput
2d1f9b1ffb defconfig: build.config: Add earlycon option to commandline
Enable early console for debug builds for Anorak target.
Also remove malformed early option 'earlycon' from build.config.anorak.

Change-Id: Ia9b50ebcff976fa56d00fc452c7c36986370e1d0
Signed-off-by: Hrishabh Rajput <quic_hrishabh@quicinc.com>
2023-03-28 23:52:11 +05:30
qctecmdr
04669c3ba9 Merge "soc: spcom: Addressing KASAN issue slab-out-of-bounds" 2023-03-28 08:30:18 -07:00
SIVA MULLATI
b6c1c7dcdf msm: kgsl: Add support for VA-Minidump in hwsched path
Include VA-Minidump support in hwsched path by dumping some
of the global hfi mem alloc entries and hfi mem globals.

Change-Id: Ic0b91079c5e389f991f42a6115fca7c9968b6737
Signed-off-by: SIVA MULLATI <quic_smullati@quicinc.com>
2023-03-28 07:04:46 -07:00
Jiantao Zhang
d1d2d17fe9 BACKPORT: USB: gadget: Fix use-after-free during usb config switch
In the process of switching USB config from rndis to other config,
if the hardware does not support the ->pullup callback, or the
hardware encounters a low probability fault, both of them may cause
the ->pullup callback to fail, which will then cause a system panic
(use after free).

The gadget drivers sometimes need to be unloaded regardless of the
hardware's behavior.

Analysis as follows:
=======================================================================
(1) write /config/usb_gadget/g1/UDC "none"

gether_disconnect+0x2c/0x1f8
rndis_disable+0x4c/0x74
composite_disconnect+0x74/0xb0
configfs_composite_disconnect+0x60/0x7c
usb_gadget_disconnect+0x70/0x124
usb_gadget_unregister_driver+0xc8/0x1d8
gadget_dev_desc_UDC_store+0xec/0x1e4

(2) rm /config/usb_gadget/g1/configs/b.1/f1

rndis_deregister+0x28/0x54
rndis_free+0x44/0x7c
usb_put_function+0x14/0x1c
config_usb_cfg_unlink+0xc4/0xe0
configfs_unlink+0x124/0x1c8
vfs_unlink+0x114/0x1dc

(3) rmdir /config/usb_gadget/g1/functions/rndis.gs4

panic+0x1fc/0x3d0
do_page_fault+0xa8/0x46c
do_mem_abort+0x3c/0xac
el1_sync_handler+0x40/0x78
0xffffff801138f880
rndis_close+0x28/0x34
eth_stop+0x74/0x110
dev_close_many+0x48/0x194
rollback_registered_many+0x118/0x814
unregister_netdev+0x20/0x30
gether_cleanup+0x1c/0x38
rndis_attr_release+0xc/0x14
kref_put+0x74/0xb8
configfs_rmdir+0x314/0x374

If gadget->ops->pullup() return an error, function rndis_close() will be
called, then it will causes a use-after-free problem.
=======================================================================

Fixes: 0a55187a1e ("USB: gadget core: Issue ->disconnect() callback from usb_gadget_disconnect()")
Signed-off-by: Jiantao Zhang <water.zhangjiantao@huawei.com>
Signed-off-by: TaoXue <xuetao09@huawei.com>
Link: https://lore.kernel.org/r/20221121130805.10735-1-water.zhangjiantao@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 273510696
Bug: 275027942
Change-Id: I702f324c5852d3b2448081b092fef464f8691989
(cherry picked from commit afdc12887f2b2ecf20d065a7d81ad29824155083)
[ray: Resolved minor conflict in drivers/usb/gadget/udc/core.c]
Signed-off-by: Ray Chi <raychi@google.com>
2023-03-28 12:57:14 +00:00
qctecmdr
c3a3075a6f Merge "dmaengine: gpi: use dma coherent memory for gpi channels" 2023-03-28 05:03:08 -07:00
Anil Veshala Veshala
9ebf533cc4 dmaengine: gpi: add channel id check
Gsi has two channels tx and rx, currently in SW defined as
two array of channels. In process events we are reading channel
id from event rings, with this channel id we are accessing
channel array elements. Error scenarios or corner cases we
are getting channel id more than 2, and we are accessing channel
array with received channel id which is causing out of memory
range access, hence we are seeing kernel panic with BRK handler.
To solve this added channel id check in process events.

Change-Id: I3200e1a2e282b4cefa0ff73569ffaf4149c2eca1
Signed-off-by: Anil Veshala Veshala <quic_aveshala@quicinc.com>
2023-03-28 04:41:32 -07:00
Mukesh Ojha
3982c7619e remoteproc: qcom_spss: Fix subdevice add order
The subdevice list should be populated in a particular order as
the state notifications have a priority. This change re-orders
the subdevice add calls to ensure higher priority subdevices are
present at the start of the list.

This change is inline with
 commit c9f2092072 ("remoteproc: qcom: pas: Fix subdevice add order").

Change-Id: Ic65a55e4b926f631af96644ad500833412a46d3d
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
2023-03-28 03:38:31 -07:00
Android Build Coastguard Worker
026be06d7a Snap for 9833931 from bdb42e7ea8 to android12-5.10-keystone-qcom-release
Change-Id: I7ac040d3ac53b75eef41ebe0766dfd072e886acb
2023-03-28 10:01:31 +00:00
rakegand
42108995d7 soc: spcom: Addressing KASAN issue slab-out-of-bounds
This change blocks access to channel name string,
in case channel name string length is more than permissible limits.

Change-Id: I48442f236b589f3691df6a37d3d86458347b4c9c
Signed-off-by: rakegand <quic_rakegand@quicinc.com>
2023-03-28 12:24:38 +05:30
deyaoren@google.com
bdb42e7ea8 Merge remote-tracking branch into HEAD
* keystone/mirror-android12-5.10-2023-03: (56 commits)
  UPSTREAM: ext4: refuse to create ea block when umounted
  UPSTREAM: ext4: optimize ea_inode block expansion
  UPSTREAM: ext4: allocate extended attribute value in vmalloc area
  UPSTREAM: usb: gadget: composite: Draw 100mA current if not configured
  UPSTREAM: usb: dwc3: gadget: Change condition for processing suspend event
  ANDROID: GKI: update xiaomi symbol list
  UPSTREAM: net/sched: tcindex: update imperfect hash filters respecting rcu
  FROMGIT: KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available()
  UPSTREAM: KVM: arm64: Allow KVM to be disabled from the command line
  ANDROID: ABI: Cuttlefish Symbol update
  Revert "ANDROID: dma-ops: Add restricted vendor hook"
  UPSTREAM: io_uring: ensure that io_init_req() passes in the right issue_flags
  FROMGIT: usb: gadget: configfs: Restrict symlink creation is UDC already binded
  UPSTREAM: io_uring: add missing lock in io_get_file_fixed
  ANDROID: ABI: Update oplus symbol list
  ANDROID: vendor_hooks: Add hooks for mutex and rwsem optimistic spin
  ANDROID: dma-buf: heaps: Don't lock unused dmabuf_page_pool mutex
  ANDROID: mm/filemap: Fix missing put_page() for speculative page fault
  UPSTREAM: KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS
  UPSTREAM: net: qrtr: combine nameservice into main module
  ...

Change-Id: I400a54d448388330bb27cae2aef0b159145bd614
2023-03-27 22:59:26 +00:00
qctecmdr
04a0f813d3 Merge "leds: leds-qti-flash: update initial configuration for external LED" 2023-03-27 15:26:18 -07:00
qctecmdr
8d0f45bbb3 Merge "leds: leds-qti-flash: Remove led_classdev_unregister()" 2023-03-27 04:33:15 -07:00
Akhil P Oommen
e22511952a msm: kgsl: Support perfcounter enable via gpu for hwsched
Enabling some perf counter groups needs sending commands
to GPU. Add support to send these commands via HFI for
HW-Sched to enable these perfcounters.

Change-Id: I3441c024cf3a4bc56998d27153201e6cf9236d26
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Hareesh Gundu <quic_hareeshg@quicinc.com>
2023-03-27 03:44:29 -07:00
qctecmdr
047374a076 Merge "qcom: llcc_perfmon: Add support for new configuration format" 2023-03-26 21:24:47 -07:00