Commit Graph

1149861 Commits

Author SHA1 Message Date
Lu Wang
701f85c2a1 ANDROID: abi_gki_aarch64_qcom: Update QCOM symbol list
Update QCOM symbol list for walt vendor hook.

Symbols added:
   __traceiter_android_rvh_before_do_sched_yield
   __tracepoint_android_rvh_before_do_sched_yield

Bug: 291683326
Signed-off-by: Lu Wang <quic_luwang@quicinc.com>
Change-Id: I3fe2fb40f3da4ff6079e64d7badb4e9e63ee6248
2023-07-24 10:27:40 +00:00
John Scheible
d51e21b394 ANDROID: ABI: Update pixel symbol list
1 function symbol(s) added
  'void iommu_detach_device(struct iommu_domain *, struct device *)'

Bug: 292121811
Change-Id: I7087f815af2a57d538484c66e0a4ab97e137c586
Signed-off-by: John Scheible <johnscheible@google.com>
2023-07-21 11:20:42 +00:00
lijun14
25a11995fb ANDROID: GKI: add ABI symbol for xiaomi
abi symbol(s) added :
__traceiter_android_rvh_before_do_sched_yield
__tracepoint_android_rvh_before_do_sched_yield

Bug: 291726037

Change-Id: I16278b0ca8eac03976543e27f21d82c3cec92af8
Signed-off-by: lijun14 <lijun14@xiaomi.corp-partner.google.com>
2023-07-20 20:37:31 +00:00
lijun14
7dd60ce804 ANDROID: vendor_hooks: add vendor hook to support SAGT
Add vendor hook of android_rvh_before_do_sched_yield

Bug: 291726037

Change-Id: I1f2d65739a297812f279b83085e3680e40d4cb6e
Signed-off-by: lijun14 <lijun14@xiaomi.corp-partner.google.com>
2023-07-20 20:37:31 +00:00
Miklos Szeredi
f930b82d16 FROMLIST: fuse: revalidate: don't invalidate if interrupted
If the LOOKUP request triggered from fuse_dentry_revalidate() is
interrupted, then the dentry will be invalidated, possibly resulting in
submounts being unmounted.

Reported-by: Xu Rongbo <xurongbo@baidu.com>
Fixes: 9e6268db49 ("[PATCH] FUSE - read-write operations")
Cc: <stable@vger.kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Bug: 282905757
Link: https://lore.kernel.org/all/CAJfpegswN_CJJ6C3RZiaK6rpFmNyWmXfaEpnQUJ42KCwNF5tWw@mail.gmail.com/
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:ae5b9259d42efa1bbd42d807fd3b3a991ddb51be)
Merged-In: I8c62f5aeeb450de78c6a38a6f8728c900a0fc9bd
Change-Id: I8c62f5aeeb450de78c6a38a6f8728c900a0fc9bd
2023-07-20 17:08:45 +00:00
Will McVicker
3a8999c683 ANDROID: GKI: Update pixel symbol list for thermal
Add the following symbol to allow vendor module to filter on-die tz genl event.
This helps avoid thermal-hal being woken up all the time by thermal genl
events, only the selected thermal_zone and cooling_device can send events from
kernel.

1 function symbol(s) added
  'int __traceiter_android_vh_enable_thermal_genl_check(void*, int, int, int*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_enable_thermal_genl_check'

Bug: 291846209
Change-Id: I763595ff1366196c6a16ff57d608042743fbe9fd
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-07-19 15:29:47 -07:00
davidchao
6ca2ff04a1 ANDROID: thermal: Add vendor thermal genl check
Add vendor enable_thermal_genl_check logic.
Filter on-die tz genl event.

To avoid thermal-hal being woken up all the time by thermal genl events,
only the selected thermal_zone and cooling_device can send events from
kernel.

Bug: 170682696
Bug: 291846209
Test: boot and thermal-hal can receive thermal genl events from kernel
Change-Id: Idb3f4b07a2a2740c01d8785910878bfe6edc832d
Signed-off-by: davidchao <davidchao@google.com>
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-07-19 15:23:51 -07:00
Will McVicker
62ef90de0d ANDROID: GKI: Update the pixel symbol list
These symbols are part of supporting Pixel devices on GKI kernels.

1 function symbol(s) added
  'struct gpio_desc* devm_gpiod_get_index_optional(struct device*, const char*,
       unsigned int, enum gpiod_flags)'

Bug: 279090118
Change-Id: I1bb36d65f928fac53e0a3dbdc2c0559349d5fc42
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-07-19 22:21:30 +00:00
Will McVicker
7bfd71d298 ANDROID: GKI: Update protected exports
Run `bazel run @//common:kernel_aarch64_abi_update_protected_exports` on
latest kernel to clean up the protected exports list. This is blocking
updating the ABI since this list needs to be accurate before updating
the ABI.

Bug: 287170531
Change-Id: I8173060087cad060314ae0e494e30b71052e1d8f
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-07-19 22:21:30 +00:00
Suren Baghdasaryan
4a207efbe0 FROMGIT: mm: add missing VM_FAULT_RESULT_TRACE name for VM_FAULT_COMPLETED
VM_FAULT_RESULT_TRACE should contain an element for every vm_fault_reason
to be used as flag_array inside trace_print_flags_seq().  The element for
VM_FAULT_COMPLETED is missing, add it.

Link: https://lkml.kernel.org/r/20230630211957.1341547-3-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Hillf Danton <hdanton@sina.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michel Lespinasse <michel@lespinasse.org>
Cc: Minchan Kim <minchan@google.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 4669552b64a6cf9ba2b48cf719879867efadcd8b
https: //git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 161210518
Change-Id: Icef851c27ab1ea8e85c7fccc26b26480b9c42443
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-07-19 18:50:41 +00:00
Suren Baghdasaryan
77ae3e7bb8 FROMGIT: swap: remove remnants of polling from read_swap_cache_async
Patch series "Per-VMA lock support for swap and userfaults", v7.

When per-VMA locks were introduced in [1] several types of page faults
would still fall back to mmap_lock to keep the patchset simple.  Among
them are swap and userfault pages.  The main reason for skipping those
cases was the fact that mmap_lock could be dropped while handling these
faults and that required additional logic to be implemented.  Implement
the mechanism to allow per-VMA locks to be dropped for these cases.

First, change handle_mm_fault to drop per-VMA locks when returning
VM_FAULT_RETRY or VM_FAULT_COMPLETED to be consistent with the way
mmap_lock is handled.  Then change folio_lock_or_retry to accept vm_fault
and return vm_fault_t which simplifies later patches.  Finally allow swap
and uffd page faults to be handled under per-VMA locks by dropping per-VMA
and retrying, the same way it's done under mmap_lock.  Naturally, once VMA
lock is dropped that VMA should be assumed unstable and can't be used.

This patch (of 6):

Commit [1] introduced IO polling support duding swapin to reduce swap read
latency for block devices that can be polled.  However later commit [2]
removed polling support.  Therefore it seems safe to remove do_poll
parameter in read_swap_cache_async and always call swap_readpage with
synchronous=false waiting for IO completion in folio_lock_or_retry.

[1] commit 23955622ff ("swap: add block io poll in swapin path")
[2] commit 9650b453a3 ("block: ignore RWF_HIPRI hint for sync dio")

Link: https://lkml.kernel.org/r/20230630211957.1341547-1-surenb@google.com
Link: https://lkml.kernel.org/r/20230630211957.1341547-2-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Suggested-by: "Huang, Ying" <ying.huang@intel.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michel Lespinasse <michel@lespinasse.org>
Cc: Minchan Kim <minchan@google.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 4296c6a817b421061d6e0b9c654c7d4d5a038a5b
https: //git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 161210518
Change-Id: I3d647ba4d6093f4e3db2c4ff759e5ce59b45b0e1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-07-19 18:48:39 +00:00
Jens Axboe
a5e46b0f3c UPSTREAM: io_uring/poll: serialize poll linked timer start with poll removal
Commit ef7dfac51d upstream.

We selectively grab the ctx->uring_lock for poll update/removal, but
we really should grab it from the start to fully synchronize with
linked timeouts. Normally this is indeed the case, but if requests
are forced async by the application, we don't fully cover removal
and timer disarm within the uring_lock.

Make this simpler by having consistent locking state for poll removal.

Bug: 290270326
Cc: stable@vger.kernel.org # 6.1+
Reported-by: Querijn Voet <querijnqyn@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 24f473769e)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I6632b7d78493b0dfc0fb26204d34823045c03f72
2023-07-19 09:24:48 +01:00
Daniel Rosenberg
6c695fad68 ANDROID: fuse-bpf: Add partial flock support
This adds passthrough support for flock on fuse-bpf files. It does not
give any control via a bpf filter. The flock will act as though it was
taken on the lower file.

Bug: 289882899
Test: fuse_test -t32 (flock_test)
Change-Id: Iba0b9630766cedbd3195532c5e929891593cfe30
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2023-07-18 17:21:43 +00:00
Lee Jones
9b655e9328 ANDROID: Incremental fs: Allocate data buffer based on input request size
Presently the data buffer used to return the per-UID timeout description
is created based on information provided by the user.  It is expected
that the user populates a variable called 'timeouts_array_size' which is
heavily scrutinised to ensure the value provided is appropriate i.e.
smaller than the largest possible value but large enough to contain all
of the data we wish to pass back.

The issue is that the aforementioned scrutiny is imposed on a different
variable to the one expected.  Contrary to expectation, the data buffer
is actually being allocated to the size specified in a variable named
'timeouts_array_size_out'.  A variable originally designed to only
contain the output information i.e. the size of the data actually copied
to the user for consumption.  This value is also user provided and is
not given the same level of scrutiny as the former.

The fix in this case is simple.  Ignore 'timeouts_array_size_out' until
it is time to populate (over-write) it ourselves and use
'timeouts_array_size' to shape the buffer as intended.

Bug: 281547360
Change-Id: I95e12879a33a2355f9e4bc0ce2bfc3f229141aa8
Signed-off-by: Lee Jones <joneslee@google.com>
(cherry picked from commit 5a4d20a3eb4e651f88ed2f1f08cee066639ca801)
2023-07-18 17:21:16 +00:00
Bob Peterson
facf08fa5f UPSTREAM: gfs2: Don't deref jdesc in evict
[ Upstream commit 504a10d9e4 ]

On corrupt gfs2 file systems the evict code can try to reference the
journal descriptor structure, jdesc, after it has been freed and set to
NULL. The sequence of events is:

init_journal()
...
fail_jindex:
   gfs2_jindex_free(sdp); <------frees journals, sets jdesc = NULL
      if (gfs2_holder_initialized(&ji_gh))
         gfs2_glock_dq_uninit(&ji_gh);
fail:
   iput(sdp->sd_jindex); <--references jdesc in evict_linked_inode
      evict()
         gfs2_evict_inode()
            evict_linked_inode()
               ret = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks);
<------references the now freed/zeroed sd_jdesc pointer.

The call to gfs2_trans_begin is done because the truncate_inode_pages
call can cause gfs2 events that require a transaction, such as removing
journaled data (jdata) blocks from the journal.

This patch fixes the problem by adding a check for sdp->sd_jdesc to
function gfs2_evict_inode. In theory, this should only happen to corrupt
gfs2 file systems, when gfs2 detects the problem, reports it, then tries
to evict all the system inodes it has read in up to that point.

Bug: 289870854
Reported-by: Yang Lan <lanyang0908@gmail.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 5ae4a618a1)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I501e8631e1b60479023f5e6ad957540f9e10bcd5
2023-07-18 09:59:12 +01:00
Will Deacon
a16d62a296 ANDROID: KVM: arm64: Fix MMU context save/restore over TLB invalidation
The 'mmu' parameter to enter_vmid_context() represents the target MMU
to switch to, so we should stash away the current MMU for restoration
by exit_vmid_context() rather than the one we're about to switch to!

Bug: 291568386
Fixes: 47318559bc ("ANDROID: KVM: arm64: Support TLB invalidation in guest context")
Tested-by: Mostafa Saleh <smostafa@google.com>
Reported-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I5d76c159424e32a6d70c598d0007f98ea80c1db4
2023-07-17 15:39:29 +00:00
Yang Yang
7f0f58f97b ANDROID: Update symbol list for VIVO
15 function symbol(s) added
  'int __sbitmap_queue_get(struct sbitmap_queue*)'
  'bool blk_bio_list_merge(struct request_queue*, struct list_head*, struct bio*, unsigned int)'
  'int blk_mq_debugfs_rq_show(struct seq_file*, void*)'
  'void blk_mq_run_hw_queue(struct blk_mq_hw_ctx*, bool)'
  'void sbitmap_add_wait_queue(struct sbitmap_queue*, struct sbq_wait_state*, struct sbq_wait*)'
  'bool sbitmap_any_bit_set(const struct sbitmap*)'
  'void sbitmap_del_wait_queue(struct sbq_wait*)'
  'int sbitmap_init_node(struct sbitmap*, unsigned int, int, gfp_t, int, bool, bool)'
  'void sbitmap_queue_clear(struct sbitmap_queue*, unsigned int, unsigned int)'
  'int sbitmap_queue_init_node(struct sbitmap_queue*, unsigned int, int, bool, gfp_t, int)'
  'void sbitmap_queue_resize(struct sbitmap_queue*, unsigned int)'
  'void sbitmap_queue_show(struct sbitmap_queue*, struct seq_file*)'
  'struct list_head* seq_list_next(void*, struct list_head*, loff_t*)'
  'struct list_head* seq_list_start(struct list_head*, loff_t)'
  'int timer_reduce(struct timer_list*, unsigned long)'

Bug: 291519378
Change-Id: Ifcd031f72f6ce45eb25b1b2398cc9f6e5231d82e
Signed-off-by: Yang Yang <yang.yang@vivo.com>
2023-07-17 15:23:02 +00:00
Bumyong Lee
1b7f110278 ANDROID: add initial symbol list file for ExynosAuto SoCs
This commit is for adding initial symbol list form ExynosAuto SoCs.
"abi_gki_aarch64_exynosauto" is generated from minimal configs for build.

Bug: 291172090
Signed-off-by: Bumyong Lee <bumyong.lee@samsung.com>
Change-Id: I9114e0ec6881d7d5bdbe61e505e21a379801f69d
2023-07-17 15:19:52 +00:00
Daniel Mentz
f6707f352b ANDROID: sched: Export sched_domains_mutex for lockdep
If CONFIG_LOCKDEP is enabled, export `sched_domains_mutex` as it is
indirectly accessed by the macro `for_each_domain()`. This allows
vendors to call the `for_each_domain()` macro with CONFIG_LOCKDEP
enabled via the GKI_BUILD_CONFIG_FRAGMENT.

Bug: 176254015
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: Ia9f2989de41b2224c63855f2fd129cbeeac4f195
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit 7171a5de98)
(cherry picked from commit e2cdae06e2)
2023-07-15 01:15:00 +00:00
Jiss Jose
a24911abfd ANDROID: Update symbol for Exynos SoC
Added symbol list for exynos mmc driver

1 function symbol(s) added
  'int device_property_read_string_array(struct device*, const char*, const char**, size_t)'

Bug: 291187964
Change-Id: I79c289861ae01304d5da5c5887227e11330f1175
Signed-off-by: Jiss Jose <jiss.jose@samsung.com>
2023-07-14 13:27:18 +05:30
Junki Min
5e7421101f ANDROID: ABI: Update symbol for Exynos SoC
Update symbols for Exynos DRM/GPU driver

5 function symbol(s) added
  'int __traceiter_android_vh_meminfo_proc_show(void*, struct seq_file*)'
  'void copy_highpage(struct page*, struct page*)'
  'void mark_page_accessed(struct page*)'
  'void ttm_bo_unmap_virtual(struct ttm_buffer_object*)'
  'int ttm_bo_wait(struct ttm_buffer_object*, bool, bool)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_meminfo_proc_show'

Bug: 290865075
Change-Id: I0ed0a853902e0ca277e3ea061a2124a48de17100
Signed-off-by: Junki Min <joonki.min@samsung.com>
2023-07-13 23:11:20 +00:00
Chun-Hung Wu
270ca05882 ANDROID: Update symbol list for mtk
1 function symbol(s) added
  'bool sk_capable(const struct sock*, int)'

This symbol is needed by bluetooth.ko.

Bug: 290584277
Change-Id: I9d8b42057d263f451caa36b7d176bdf2560cce38
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2023-07-13 21:59:10 +00:00
Dezhi Huang
47e02fe1ef UPSTREAM: dma-remap: use kvmalloc_array/kvfree for larger dma memory remap
If dma_direct_alloc() alloc memory in size of 64MB, the inner function
dma_common_contiguous_remap() will allocate 128KB memory by invoking
the function kmalloc_array(). and the kmalloc_array seems to fail to try
to allocate 128KB mem.

Call trace:
[14977.928623] qcrosvm: page allocation failure: order:5, mode:0x40cc0
[14977.928638] dump_backtrace.cfi_jt+0x0/0x8
[14977.928647] dump_stack_lvl+0x80/0xb8
[14977.928652] warn_alloc+0x164/0x200
[14977.928657] __alloc_pages_slowpath+0x9f0/0xb4c
[14977.928660] __alloc_pages+0x21c/0x39c
[14977.928662] kmalloc_order+0x48/0x108
[14977.928666] kmalloc_order_trace+0x34/0x154
[14977.928668] __kmalloc+0x548/0x7e4
[14977.928673] dma_direct_alloc+0x11c/0x4f8
[14977.928678] dma_alloc_attrs+0xf4/0x138
[14977.928680] gh_vm_ioctl_set_fw_name+0x3c4/0x610 [gunyah]
[14977.928698] gh_vm_ioctl+0x90/0x14c [gunyah]
[14977.928705] __arm64_sys_ioctl+0x184/0x210

work around by doing kvmalloc_array instead.

Signed-off-by: Gao Xu <gaoxu2@hihonor.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

Bug: 279161171
(cherry picked from commit 51ff97d54f)
Change-Id: I665c0a2b06f5a97cef297c1d5a6618373b513299
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-07-13 20:31:00 +00:00
Liujie Xie
22e008d6d5 ANDROID: vendor_hooks: Supplement the missing hook call point.
As a supplement to commit 6c1c1552e6
("ANDROID: vendor_hook: add hooks to protect locking-tsk in cpu scheduler").
In rwsem read, we missed a lock-holding scenario, add it now.

Bug: 290868674

Change-Id: I718dd942b24b330a79283fc241dcbf47cc34c0c5
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2023-07-13 15:51:22 +00:00
lambert wang
214e6f268b ANDROID: GKI: Add WWAN as GKI protected module
CONFIG_WWAN=m : WWAN driver core. This driver provides
a common framework for WWAN drivers.

Required to integrate modem devices with WWAN subsystem.

Selects CONFIG_WWAN_DEBUGFS=y; override to disable it
until it is required in the future.

Bug: 287170531
Change-Id: I18517a7aca17cfb5bdbb7ad0399fcb92c575a48e
Signed-off-by: lambert wang <lambert.wang@mediatek.com>
2023-07-13 15:23:46 +00:00
Xiaopeng Bai
8726a2d930 ANDROID: GKI: regmap: Add regmap vendor hook for of_syscon_register
For global registers access, UNISOC have one special method called set/clear
mechanism that would avoid using hardware spinlock. But now regmap framework
does not support our set/clear mechanism, so add vendor hook to support
this feature.

Bug: 228907258
Signed-off-by: Xiaopeng Bai <xiaopeng.bai@unisoc.com>
Change-Id: I9a6651f07a048ffebd5c2d8e369a4e7b374bc182
(cherry picked from commit 53e342c183)
2023-07-13 02:22:21 +00:00
Andrey Konovalov
7c2b6c7b56 UPSTREAM: kasan: suppress recursive reports for HW_TAGS
KASAN suppresses reports for bad accesses done by the KASAN reporting
code.  The reporting code might access poisoned memory for reporting
purposes.

Software KASAN modes do this by suppressing reports during reporting via
current->kasan_depth, the same way they suppress reports during accesses
to poisoned slab metadata.

Hardware Tag-Based KASAN does not use current->kasan_depth, and instead
resets pointer tags for accesses to poisoned memory done by the reporting
code.

Despite that, a recursive report can still happen:

1. On hardware with faulty MTE support. This was observed by Weizhao
   Ouyang on a faulty hardware that caused memory tags to randomly change
   from time to time.

2. Theoretically, due to a previous MTE-undetected memory corruption.

A recursive report can happen via:

1. Accessing a pointer with a non-reset tag in the reporting code, e.g.
   slab->slab_cache, which is what Weizhao Ouyang observed.

2. Theoretically, via external non-annotated routines, e.g. stackdepot.

To resolve this issue, resetting tags for all of the pointers in the
reporting code and all the used external routines would be impractical.

Instead, disable tag checking done by the CPU for the duration of KASAN
reporting for Hardware Tag-Based KASAN.

Without this fix, Hardware Tag-Based KASAN reporting code might deadlock.

[andreyknvl@google.com: disable preemption instead of migration, fix comment typo]
  Link: https://lkml.kernel.org/r/d14417c8bc5eea7589e99381203432f15c0f9138.1680114854.git.andreyknvl@google.com
Link: https://lkml.kernel.org/r/59f433e00f7fa985e8bf9f7caf78574db16b67ab.1678491668.git.andreyknvl@google.com
Fixes: 2e903b9147 ("kasan, arm64: implement HW_TAGS runtime")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reported-by: Weizhao Ouyang <ouyangweizhao@zeku.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit c6a690e0c9)
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: Ifc5daf66f57dd16e85de73257cc0966565836269
2023-07-12 21:18:49 +00:00
Andrey Konovalov
c0226bf0c7 UPSTREAM: kasan, arm64: add arch_suppress_tag_checks_start/stop
Add two new tagging-related routines arch_suppress_tag_checks_start/stop
that suppress MTE tag checking via the TCO register.

These rouines are used in the next patch.

[andreyknvl@google.com: drop __ from mte_disable/enable_tco names]
  Link: https://lkml.kernel.org/r/7ad5e5a9db79e3aba08d8f43aca24350b04080f6.1680114854.git.andreyknvl@google.com
Link: https://lkml.kernel.org/r/75a362551c3c54b70ae59a3492cabb51c105fa6b.1678491668.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Weizhao Ouyang <ouyangweizhao@zeku.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit 0d3c9468be)
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: I6aa222a78aa299280f334a4a216bc7719af5a2ef
2023-07-12 21:18:49 +00:00
Vincenzo Frascino
da926e6077 UPSTREAM: arm64: mte: rename TCO routines
The TCO related routines are used in uaccess methods and
load_unaligned_zeropad() but are unrelated to both even if the naming
suggest otherwise.

Improve the readability of the code moving the away from uaccess.h and
pre-pending them with "mte".

[andreyknvl@google.com: drop __ from mte_disable/enable_tco names]
  Link: https://lkml.kernel.org/r/74d26337b2360733956114069e96ff11c296a944.1680114854.git.andreyknvl@google.com
Link: https://lkml.kernel.org/r/a48e7adce1248c0f9603a457776d59daa0ef734b.1678491668.git.andreyknvl@google.com
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Weizhao Ouyang <ouyangweizhao@zeku.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit 2cc029a084)
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: Icb37f3338fd99204bc1029f7cf8e1165a311a2fa
2023-07-12 21:18:49 +00:00
Andrey Konovalov
553be6e70d BACKPORT: kasan, arm64: rename tagging-related routines
(Backport: no real conflicts, neighboring lines changed.)

Rename arch_enable_tagging_sync/async/asymm to
arch_enable_tag_checks_sync/async/asymm, as the new name better reflects
their function.

Also rename kasan_enable_tagging to kasan_enable_hw_tags for the same
reason.

Link: https://lkml.kernel.org/r/069ef5b77715c1ac8d69b186725576c32b149491.1678491668.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Weizhao Ouyang <ouyangweizhao@zeku.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit 0eafff1c5a)
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: Idbb7c99b798843dd8909528cc29d2fe883108b9f
2023-07-12 21:18:49 +00:00
Andrey Konovalov
b39a3be50a UPSTREAM: kasan: drop empty tagging-related defines
mm/kasan/kasan.h provides a number of empty defines for a few
arch-specific tagging-related routines, in case the architecture code
didn't define them.

The original idea was to simplify integration in case another architecture
starts supporting memory tagging.  However, right now, if any of those
routines are not provided by an architecture, Hardware Tag-Based KASAN
won't work.

Drop the empty defines, as it would be better to get compiler errors
rather than runtime crashes when adding support for a new architecture.

Also drop empty hw_enable_tagging_sync/async/asymm defines for
!CONFIG_KASAN_HW_TAGS case, as those are only used in mm/kasan/hw_tags.c.

Link: https://lkml.kernel.org/r/bc919c144f8684a7fd9ba70c356ac2a75e775e29.1678491668.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com> [arm64]
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Weizhao Ouyang <ouyangweizhao@zeku.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit e34f1e2ee0)
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: I22911baac04cc56db2a08250e8eb47a0d4ee6128
2023-07-12 21:18:49 +00:00
Jindong Yue
44ee9eef21 ANDROID: usb: xhci-plat: Fix double-free in xhci_plat_remove
Remove the duplicate usb_put_hcd(shared_hcd) to fix following
warning when unplugging the usb mouse.

 ------------[ cut here ]------------
 refcount_t: underflow; use-after-free.
 WARNING: CPU: 4 PID: 153 at lib/refcount.c:28 refcount_warn_saturate+0xf8/0x138
 Call trace:
  refcount_warn_saturate+0xf8/0x138
  usb_put_hcd+0xbc/0xc4
  xhci_plat_remove+0x124/0x1e4
  platform_remove+0x40/0x78

Bug: 290507071
Fixes: 90ab8e7f98 ("ANDROID: usb: host: add xhci hooks for USB offload")
Change-Id: Id840b6dcb69600658557c7a33e59c318f66160f5
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2023-07-12 20:00:33 +00:00
YOUNGJIN JOO
55679fd0a8 ANDROID: ABI: update symbol list for galaxy
7 function symbol(s) added
  'struct fwnode_handle* __irq_domain_alloc_fwnode(unsigned int, int, const char *, phys_addr_t*)'
  'struct clk* devm_clk_get_optional_enabled(struct device*, const char*)'
  'void irq_domain_free_fwnode(struct fwnode_handle*)'
  'int phy_connect_direct(struct net_device*, struct phy_device*, void(*)(struct net_device*), phy_interface_t)'
  'struct phy_device* phy_find_first(struct mii_bus*)'
  'void phy_get_pause(struct phy_device*, bool*, bool*)'
  'int platform_get_ethdev_address(struct device*, struct net_device*)'

1 variable symbol(s) added
  'struct irq_chip dummy_irq_chip'

Bug: 290659898
Change-Id: I2f5e38013090ab9c5c6391de16d9b94802179ca5
Signed-off-by: YOUNGJIN JOO <youngjin79.joo@samsung.com>
2023-07-12 18:35:14 +00:00
wang qiankun
30807bebbf ANDROID: GKI: update the ABI symbol list
INFO: ABI DIFFERENCES HAVE BEEN DETECTED!
INFO: 1 function symbol(s) added
  'void cpufreq_update_policy(unsigned int)'

Bug: 290900322
Change-Id: Idcebf20a17a642e2b08021772a45003797062edd
Signed-off-by: wang qiankun <wangqiankun3@xiaomi.corp-partner.google.com>
2023-07-12 16:50:43 +00:00
Jiss Jose
f3c6324daa ANDROID: ABI: Update symbol for Exynos SoC
Update symbols for Exynos GIC 400 based SOC

1 function symbol(s) added
  'int __traceiter_android_vh_gic_set_affinity(void*, struct irq_data*, const struct cpumask*, bool, u8*, void*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_gic_set_affinity'

Bug: 290727714
Change-Id: Ie8adc70d83a9db13aa1a6befa655ec7d675baf81
Signed-off-by: Jiss Jose <jiss.jose@samsung.com>
2023-07-11 15:44:08 +05:30
tianming.wang
c75c8311c8 ANDROID: GKI: ABI: update whitelist for the kmsg_dump and native_hang symbols used by unisoc for kernel6.1
Add the symbols needed by kmsg_dump to abi_gki_aarch64_unisoc, and node_states needs to be updated to google
symbols list:
kmsg_dump_get_buffer,
kmsg_dump_rewind,
kmsg_dump_register,
kmsg_dump_unregister.
filp_open_block,
get_zeroed_page,
mem_section,
node_states

Add the symbols needed by native_hang_monitor to abi_gki_aarch64_unisoc
access_process_vm,
down,
find_get_pid,
find_task_by_vpid,
mas_find,
put_pid,
send_sig_info,
up

1 variable symbol(s) added
  'nodemask_t node_states[6]'

Bug: 290548918
Change-Id: I18f2c399ca0b6ad01ad9f1a976064d1c14af6577
Signed-off-by: tianming.wang <tianming.wang@unisoc.com>
2023-07-10 23:17:05 +00:00
cathy.cai
0a2e9dd65c ANDROID: ABI: Update symbols to unisoc whitelist for ims_bridge module
Update whitelist for the symbols used by the unisoc device in abi_gki_aarch64_unisoc.
It mainly includes the whitelist of ims_bridge module.

9 function symbol(s) added
  'void icmp6_send(struct sk_buff*, u8, u8, __u32, const struct in6_addr*,
const struct inet6_skb_parm*)'
  '__be32 inet_select_addr(const struct net_device*, __be32, int)'
  'int ip6_find_1stfragopt(struct sk_buff*, u8**)'
  'struct dst_entry* ip6_route_output_flags(struct net*, const struct sock*, struct flowi6*,
int)'
  'int ipv6_dev_get_saddr(struct net*, const struct net_device*, const struct in6_addr*,
unsigned int, struct in6_addr*)'
  '__be32 ipv6_select_ident(struct net*, const struct in6_addr*, const struct in6_addr*)'
  'bool nf_ct_get_tuplepr(const struct sk_buff*, unsigned int, u_int16_t, struct net*,
struct nf_conntrack_tuple*)'
  'bool nf_ct_invert_tuple(struct nf_conntrack_tuple*, const struct nf_conntrack_tuple*)'
  'struct xfrm_state_afinfo* xfrm_state_afinfo_get_rcu(unsigned int)'

Bug: 289163929
Change-Id: I247dddb13459e2b1ac0159ce57f664f3f71ea661
Signed-off-by: canting cai <cathy.cai@unisoc.com>
2023-07-07 18:12:22 +00:00
Shreyas K K
fc9c1ccbbf ANDROID: abi_gki_aarch64_qcom: Add drm_plane_from_index and drm_gem_prime_export
In qualcomm display drivers, we need to call this function to interface
with the drm drivers. Add it to the symbol list.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added
function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added
variable

2 function symbol(s) added
  'struct dma_buf* drm_gem_prime_export(struct drm_gem_object*, int)'
  'struct drm_plane* drm_plane_from_index(struct drm_device*, int)'

Bug: 289882890

Change-Id: Ie93e84725eb58337f7c96b277a597c96a80b4940
Signed-off-by: Shreyas K K <quic_shrekk@quicinc.com>
2023-07-07 16:02:03 +00:00
Chaitanya Pratapa
c480e4e576 ANDROID: abi_gki_aarch64_qcom: Update symbol list
Symbols added:
   gic_nonsecure_priorities
   iommu_map_atomic
   __traceiter_android_vh_check_hibernation_swap
   __traceiter_android_vh_free_task
   __traceiter_android_vh_ignore_dmabuf_vmap_bounds
   __traceiter_android_vh_init_aes_encrypt
   __tracepoint_android_vh_check_hibernation_swap
   __tracepoint_android_vh_free_task
   __tracepoint_android_vh_ignore_dmabuf_vmap_bounds
   __tracepoint_android_vh_init_aes_encrypt

Bug: 290105632
Change-Id: Idd163544f3349e0a6f47ac97e9d62c73742f1a8a
Signed-off-by: Chaitanya Pratapa <quic_cpratapa@quicinc.com>
2023-07-07 01:22:44 +00:00
Eric Biggers
8ecaef4d4b UPSTREAM: fsverity: reject FS_IOC_ENABLE_VERITY on mode 3 fds
Commit 56124d6c87 ("fsverity: support enabling with tree block size <
PAGE_SIZE") changed FS_IOC_ENABLE_VERITY to use __kernel_read() to read
the file's data, instead of direct pagecache accesses.

An unintended consequence of this is that the
'WARN_ON_ONCE(!(file->f_mode & FMODE_READ))' in __kernel_read() became
reachable by fuzz tests.  This happens if FS_IOC_ENABLE_VERITY is called
on a fd opened with access mode 3, which means "ioctl access only".

Arguably, FS_IOC_ENABLE_VERITY should work on ioctl-only fds.  But
ioctl-only fds are a weird Linux extension that is rarely used and that
few people even know about.  (The documentation for FS_IOC_ENABLE_VERITY
even specifically says it requires O_RDONLY.)  It's probably not
worthwhile to make the ioctl internally open a new fd just to handle
this case.  Thus, just reject the ioctl on such fds for now.

Fixes: 56124d6c87 ("fsverity: support enabling with tree block size < PAGE_SIZE")
Reported-by: syzbot+51177e4144d764827c45@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=2281afcbbfa8fdb92f9887479cc0e4180f1c6b28
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230406215106.235829-1-ebiggers@kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
(cherry picked from commit 0483913921)
Change-Id: I3043d7295d59c05f487c05258cb6bb0113357c6e
2023-07-07 00:48:25 +00:00
Eric Biggers
d5feaf8163 UPSTREAM: fsverity: explicitly check for buffer overflow in build_merkle_tree()
The new Merkle tree construction algorithm is a bit fragile in that it
may overflow the 'root_hash' array if the tree actually generated does
not match the calculated tree parameters.

This should never happen unless there is a filesystem bug that allows
the file size to change despite deny_write_access(), or a bug in the
Merkle tree logic itself.  Regardless, it's fairly easy to check for
buffer overflow here, so let's do so.

This is a robustness improvement only; this case is not currently known
to be reachable.  I've added a Fixes tag anyway, since I recommend that
this be included in kernels that have the mentioned commit.

Fixes: 56124d6c87 ("fsverity: support enabling with tree block size < PAGE_SIZE")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230328041505.110162-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
(cherry picked from commit 39049b69ec)
Change-Id: I248fd8686a806f0099bed1ac83d52362af3e194e
2023-07-07 00:48:25 +00:00
Di Shen
711f5d5bfe ANDROID: update unisoc symbol list
2 function symbol(s) added
  'struct thermal_zone_device* thermal_zone_device_register_with_trips(const char*, struct thermal_trip*, int, int, void*, struct thermal_zone_device_ops*, struct thermal_zone_params*, int, int)'
  'int thermal_zone_unbind_cooling_device(struct thermal_zone_device*, int, struct thermal_cooling_device*)'

Bug: 290155471

Signed-off-by: Di Shen <di.shen@unisoc.com>
Change-Id: I393758dcbe86897d6c7e9923ebccffd00ebc2d34
2023-07-07 00:46:51 +00:00
rong.wu
dde9b1794c ANDROID: update symbol for unisoc whitelist
Add symbols for unisoc kernel6.1 driver

12 function symbol(s) added
  'int devm_extcon_register_notifier_all(struct device*, struct extcon_dev*, struct notifier_block*)'
  'void orderly_poweroff(bool)'
  'void typec_altmode_attention(struct typec_altmode*, u32)'
  'int typec_altmode_notify(struct typec_altmode*, unsigned long, void*)'
  'void typec_altmode_update_active(struct typec_altmode*, bool)'
  'int typec_altmode_vdm(struct typec_altmode*, u32, const u32*, int)'
  'int typec_find_power_role(const char*)'
  'struct typec_altmode* typec_match_altmode(struct typec_altmode**, size_t, u16, u8)'
  'struct typec_altmode* typec_partner_register_altmode(struct typec_partner*, const struct typec_altmode_desc*)'
  'struct typec_altmode* typec_port_register_altmode(struct typec_port*, const struct typec_altmode_desc*)'
  'int typec_set_mode(struct typec_port*, int)'
  'void typec_unregister_altmode(struct typec_altmode*)'

Bug: 289971968
Change-Id: Ieeaee083d5537fe7b71796b6fb1a212510de2c11
Signed-off-by: rong.wu <rong.wu@unisoc.com>
2023-07-07 00:46:02 +00:00
Jaegeuk Kim
dfd6ca2517 UPSTREAM: f2fs: fix deadlock in i_xattr_sem and inode page lock
Thread #1:

[122554.641906][   T92]  f2fs_getxattr+0xd4/0x5fc
    -> waiting for f2fs_down_read(&F2FS_I(inode)->i_xattr_sem);

[122554.641927][   T92]  __f2fs_get_acl+0x50/0x284
[122554.641948][   T92]  f2fs_init_acl+0x84/0x54c
[122554.641969][   T92]  f2fs_init_inode_metadata+0x460/0x5f0
[122554.641990][   T92]  f2fs_add_inline_entry+0x11c/0x350
    -> Locked dir->inode_page by f2fs_get_node_page()

[122554.642009][   T92]  f2fs_do_add_link+0x100/0x1e4
[122554.642025][   T92]  f2fs_create+0xf4/0x22c
[122554.642047][   T92]  vfs_create+0x130/0x1f4

Thread #2:

[123996.386358][   T92]  __get_node_page+0x8c/0x504
    -> waiting for dir->inode_page lock

[123996.386383][   T92]  read_all_xattrs+0x11c/0x1f4
[123996.386405][   T92]  __f2fs_setxattr+0xcc/0x528
[123996.386424][   T92]  f2fs_setxattr+0x158/0x1f4
    -> f2fs_down_write(&F2FS_I(inode)->i_xattr_sem);

[123996.386443][   T92]  __f2fs_set_acl+0x328/0x430
[123996.386618][   T92]  f2fs_set_acl+0x38/0x50
[123996.386642][   T92]  posix_acl_chmod+0xc8/0x1c8
[123996.386669][   T92]  f2fs_setattr+0x5e0/0x6bc
[123996.386689][   T92]  notify_change+0x4d8/0x580
[123996.386717][   T92]  chmod_common+0xd8/0x184
[123996.386748][   T92]  do_fchmodat+0x60/0x124
[123996.386766][   T92]  __arm64_sys_fchmodat+0x28/0x3c

Bug: 280545073
Fixes: 27161f13e3 "f2fs: avoid race in between read xattr & write xattr"
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 82d8a4f642421ece594542e1fabc689dcb094b1a)
Change-Id: Iec383216e1887e11c69374d28e4ecdedda133919
2023-07-06 19:32:34 +00:00
wangshuai12
a3d8701485 ANDROID: GKI: update xiaomi symbol list
ABI DIFFERENCES HAVE BEEN DETECTED!
6 function symbol(s) added
  'void bio_associate_blkg_from_css(struct bio*, struct cgroup_subsys_state*)'
  'void blk_mq_run_hw_queues(struct request_queue*, bool)'
  'void blk_stat_disable_accounting(struct request_queue*)'
  'struct io_cq* ioc_find_get_icq(struct request_queue*)'
  'void* kmem_cache_alloc_node(struct kmem_cache*, gfp_t, int)'

Bug: 289749222

Change-Id: Ia51bdf658ce180938890b7ea80f9c060baaef992
Signed-off-by: wangshuai12 <wangshuai12@xiaomi.corp-partner.google.com>
2023-07-06 18:51:22 +00:00
Jaegeuk Kim
dfc69fd81c Revert "FROMLIST: f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue"
This reverts commit 21061b7d0f.

Let's use the upstream version.

Bug: 280545073
Bug: 279916414
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Idcdc94d6bd6b6272535a49c8639517ef1bddb246
2023-07-05 17:21:39 -07:00
John Scheible
2e2b1f4982 ANDROID: ABI: Update pixel symbol list
3 function symbol(s) added
  'unsigned long alloc_iova_fast(struct iova_domain*, unsigned long, unsigned long, bool)'
  'void free_iova_fast(struct iova_domain*, unsigned long, unsigned long)'
  'int iova_domain_init_rcaches(struct iova_domain*)'

Bug: 288454198
Change-Id: Ib0dc3f0f7186eda7279ca3efefb0e41452845ecd
Signed-off-by: John Scheible <johnscheible@google.com>
2023-07-05 18:56:04 +00:00
Ulises Mendez Martinez
b57cdabd55 ANDROID: Set arch attribute for allmodconfig builds
* This sets arch attribute for two builds:
  * kernel_x86_64_allmodconfig
  * kernel_arm_allmodconfig

Bug: 272164611
Change-Id: Ica02082ef53e1b08523b47b879716e94330fe5c4
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
2023-07-05 16:30:56 +00:00
Zheng Wang
f63b2625af UPSTREAM: usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
[ Upstream commit 2b947f8769 ]

In renesas_usb3_probe, role_work is bound with renesas_usb3_role_work.
renesas_usb3_start will be called to start the work.

If we remove the driver which will call usbhs_remove, there may be
an unfinished work. The possible sequence is as follows:

CPU0                  			CPU1

                    			 renesas_usb3_role_work
renesas_usb3_remove
usb_role_switch_unregister
device_unregister
kfree(sw)
//free usb3->role_sw
                    			 usb_role_switch_set_role
                    			 //use usb3->role_sw

The usb3->role_sw could be freed under such circumstance and then
used in usb_role_switch_set_role.

This bug was found by static analysis. And note that removing a
driver is a root-only operation, and should never happen in normal
case. But the root user may directly remove the device which
will also trigger the remove function.

Fix it by canceling the work before cleanup in the renesas_usb3_remove.

Bug: 289003615
Fixes: 39facfa01c ("usb: gadget: udc: renesas_usb3: Add register of usb role switch")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20230320062931.505170-1-zyytlz.wz@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit df23805209)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I79a1dbeba9a90ee5daf94648ef6a32207b283561
2023-07-04 15:24:34 +00:00
Venkata Rao Kakani
dc8c661b99 ANDROID: ABI: Add to QCOM symbols list
Symbols updated to QCOM abi symbol list:
  fwnode_get_phy_node
  phylink_expects_phy

Bug: 288516849
Change-Id: I3b86d0b864011b118fff9da3c4afb02e62abf4d7
Signed-off-by: Venkata Rao Kakani <quic_vkakani@quicinc.com>
2023-07-04 14:28:26 +00:00