Commit Graph
821802 Commits
Author SHA1 Message Date
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
Linus Torvalds c1bdf6583f gup: document and work around "COW can break either way" issue
commit 17839856fd588f4ab6b789f482ed3ffd7c403e1f upstream.

Doing a "get_user_pages()" on a copy-on-write page for reading can be
ambiguous: the page can be COW'ed at any time afterwards, and the
direction of a COW event isn't defined.

Yes, whoever writes to it will generally do the COW, but if the thread
that did the get_user_pages() unmapped the page before the write (and
that could happen due to memory pressure in addition to any outright
action), the writer could also just take over the old page instead.

End result: the get_user_pages() call might result in a page pointer
that is no longer associated with the original VM, and is associated
with - and controlled by - another VM having taken it over instead.

So when doing a get_user_pages() on a COW mapping, the only really safe
thing to do would be to break the COW when getting the page, even when
only getting it for reading.

At the same time, some users simply don't even care.

For example, the perf code wants to look up the page not because it
cares about the page, but because the code simply wants to look up the
physical address of the access for informational purposes, and doesn't
really care about races when a page might be unmapped and remapped
elsewhere.

This adds logic to force a COW event by setting FOLL_WRITE on any
copy-on-write mapping when FOLL_GET (or FOLL_PIN) is used to get a page
pointer as a result.

The current semantics end up being:

 - __get_user_pages_fast(): no change. If you don't ask for a write,
   you won't break COW. You'd better know what you're doing.

 - get_user_pages_fast(): the fast-case "look it up in the page tables
   without anything getting mmap_sem" now refuses to follow a read-only
   page, since it might need COW breaking.  Which happens in the slow
   path - the fast path doesn't know if the memory might be COW or not.

 - get_user_pages() (including the slow-path fallback for gup_fast()):
   for a COW mapping, turn on FOLL_WRITE for FOLL_GET/FOLL_PIN, with
   very similar semantics to FOLL_FORCE.

If it turns out that we want finer granularity (ie "only break COW when
it might actually matter" - things like the zero page are special and
don't need to be broken) we might need to push these semantics deeper
into the lookup fault path.  So if people care enough, it's possible
that we might end up adding a new internal FOLL_BREAK_COW flag to go
with the internal FOLL_COW flag we already have for tracking "I had a
COW".

Alternatively, if it turns out that different callers might want to
explicitly control the forced COW break behavior, we might even want to
make such a flag visible to the users of get_user_pages() instead of
using the above default semantics.

But for now, this is mostly commentary on the issue (this commit message
being a lot bigger than the patch, and that patch in turn is almost all
comments), with that minimal "enable COW breaking early" logic using the
existing FOLL_WRITE behavior.

[ It might be worth noting that we've always had this ambiguity, and it
  could arguably be seen as a user-space issue.

  You only get private COW mappings that could break either way in
  situations where user space is doing cooperative things (ie fork()
  before an execve() etc), but it _is_ surprising and very subtle, and
  fork() is supposed to give you independent address spaces.

  So let's treat this as a kernel issue and make the semantics of
  get_user_pages() easier to understand. Note that obviously a true
  shared mapping will still get a page that can change under us, so this
  does _not_ mean that get_user_pages() somehow returns any "stable"
  page ]

[surenb: backport notes
	Replaced (gup_flags | FOLL_WRITE) with write=1 in gup_pgd_range.
	Removed FOLL_PIN usage in should_force_cow_break since it's missing in
	the earlier kernels.]

Change-Id: I6ae007f29a538767fddccf3306264e892f9134ab
Reported-by: Jann Horn <jannh@google.com>
Tested-by: Christoph Hellwig <hch@lst.de>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kirill Shutemov <kirill@shutemov.name>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[surenb: backport to 4.19 kernel]
Cc: stable@vger.kernel.org # 4.19.x
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 5e24029791
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2022-07-22 14:44:55 +05:30
qctecmdr 98ad83cce8 Merge "msm: ipa3: add check in odl pipe cleanup" 2022-07-21 12:06:22 -07:00
qctecmdr b2239da075 Merge "ipa3: Changes to call disable datapth API before stop channel" 2022-07-21 12:06:22 -07:00
qctecmdr 461cde04ca Merge "msm: disp: dp: add aux dp support by usb mode" 2022-07-21 12:06:21 -07:00
qctecmdr 225a5b2319 Merge "tz_log : use file->private_data to get tz_id for debugfs" 2022-07-21 12:06:19 -07:00
qctecmdr 6c9b8414bf Merge "msm: adsprpc: Handle out of bounds access" 2022-07-21 07:11:41 -07:00
qctecmdr 2f9d195596 Merge "HID: check for valid USB device for many HID drivers" 2022-07-21 07:11:38 -07:00
Rakesh Kota 84a85d8919 power: qpnp-fg-gen4: Update msoc on every FVSS soc update
There is possibility of a momentary SOC jump after we
exit the FVSS loop. Fix this by updating the msoc
on every FVSS soc update to make sure the soc value in
hardware tracks the FVSS scaled value.

Change-Id: I7a5638551615cc0d6da7171b05ffb2496cac4381
Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>
2022-07-18 21:21:32 +05:30