Commit Graph

1150025 Commits

Author SHA1 Message Date
Di Shen
e3a72785da ANDROID: thermal: Add hook to enable/disable thermal power throttle
By default, thermal power throttle is always enable, but sometimes it
need to be disabled for a period of time, so add it to meet platform
thermal requirement.

Bug: 209386157

Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Signed-off-by: Di Shen <di.shen@unisoc.com>
Change-Id: If9c53a9669eec8e2821d837cfa3c660a9cfbf934
(cherry picked from commit 64999249d5fecc79805fd799bdf71bc5b554efc1)
2023-06-28 16:15:01 +00:00
Junki Min
05ba0cb850 ANDROID: ABI: Update symbol for Exynos SoC
Update symbols for Exynos DRM driver

1 function symbol(s) added
  'void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx*, struct list_head*, struct dma_fence*)'

Bug: 289006378
Change-Id: I9d45891bd1687ffc52b754501a57eca0ec67ae22
Signed-off-by: Junki Min <joonki.min@samsung.com>
2023-06-28 14:52:36 +00:00
Krishna Kurapati
251aa28d16 BACKPORT: FROMGIT: usb: gadget: udc: Handle gadget_connect failure during bind operation
In the event, gadget_connect call (which invokes pullup) fails,
propagate the error to udc bind operation which inturn sends the
error to configfs. The userspace can then retry enumeartion if
it chooses to.

Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230510075252.31023-3-quic_kriskura@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 275538389
(cherry picked from commit d34f9bafa78da2a561c67d9daf55fc4d1d80edf0 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
[wcheng: Fixed some merge conflicts in usb_udc_connect_control]
Change-Id: I3068fc6f679ec236fa700c4cb5dd56238dacb5ac
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-06-28 12:37:40 +00:00
Krishna Kurapati
5af5006061 FROMGIT: usb: dwc3: gadget: Bail out in pullup if soft reset timeout happens
If the core soft reset timeout happens, avoid setting up event
buffers and starting gadget as the writes to these registers
may not reflect when in reset and setting the run stop bit
can lead the controller to access wrong event buffer address
resulting in a crash.

Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20230510075252.31023-2-quic_kriskura@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 275538389
(cherry picked from commit 813f44d57e19ccaa7330e829bd913515be42719d https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: Ieb7fe9f6d0dc64814cf6f9b86d5ee188d07de537
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-06-28 12:37:40 +00:00
chenzhiwei
79b7e0db16 ANDROID: GKI: Update symbol list for xiaomi
Two new vendor hooks symbol relationship

2 function symbol(s) added
  'int __traceiter_android_vh_free_one_page_bypass(void *, struct page *, struct zone *, int, int, int, bool *)'
  'int __traceiter_android_vh_rmqueue_smallest_bypass(void *, struct page * *, struct zone *, int, int)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_free_one_page_bypass'
  'struct tracepoint __tracepoint_android_vh_rmqueue_smallest_bypass'

Bug: 286350069
Change-Id: Ic06582720b7b45a2c6728b604310f638fde29b31
Signed-off-by: chenzhiwei <chenzhiwei@xiaomi.corp-partner.google.com>
2023-06-28 12:31:36 +00:00
chenzhiwei
ff8496749d ANDROID: vendor_hooks: vendor hook for MM
2 Vendor hooks add:
    trace_android_vh_free_one_page_bypass
    trace_android_vh_rmqueue_smallest_bypass

Add vendor hook points in __free_one_page and __rmqueue to
manager some customized pages instead of freeing/allocating.

Bug: 286350069
Change-Id: If63e164c02a279f4f14ebd8603f49c58ba0fbc8a
Signed-off-by: chenzhiwei <chenzhiwei@xiaomi.corp-partner.google.com>
2023-06-28 12:31:36 +00:00
Di Shen
43d7226c5f ANDROID: add a symbol to unisoc symbol list
To implement the devfreq cooling device registration by
energy model, it should add devfreq_cooling_em_register
to symbol list.

1 function symbol(s) added
  'struct thermal_cooling_device* devfreq_cooling_em_register(struct devfreq*, struct devfreq_cooling_power*)'

Bug: 288934529

Signed-off-by: Di Shen <di.shen@unisoc.com>
Change-Id: I168a5bf1130edd7e53f107deb5c606fc98a95953
2023-06-27 11:22:10 +08:00
fengqi
51cb1e1cfd ANDROID: GKI: update symbol list file for xiaomi
INFO: ABI DIFFERENCES HAVE BEEN DETECTED!
INFO: 1 function symbol(s) added
  'struct device_node* of_find_all_nodes(struct device_node*)'

Bug: 288843707

Change-Id: Ic3c372473220a6407052cb5d1136601633359fe6
Signed-off-by: fengqi <fengqi@xiaomi.com>
2023-06-26 16:03:59 +00:00
Lee Jones
1499ddcb78 UPSTREAM: net/sched: cls_u32: Fix reference counter leak leading to overflow
[ Upstream commit 04c55383fa5689357bcdd2c8036725a55ed632bc ]

In the event of a failure in tcf_change_indev(), u32_set_parms() will
immediately return without decrementing the recently incremented
reference counter.  If this happens enough times, the counter will
rollover and the reference freed, leading to a double free which can be
used to do 'bad things'.

In order to prevent this, move the point of possible failure above the
point where the reference counter is incremented.  Also save any
meaningful return values to be applied to the return data at the
appropriate point in time.

This issue was caught with KASAN.

Bug: 273251569
Fixes: 705c709126 ("net: sched: cls_u32: no need to call tcf_exts_change for newly allocated struct")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 07f9cc229b)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I95524bfda9a08a40b3d54515e528419dba18dc55
2023-06-26 12:05:52 +00:00
Ulises Mendez Martinez
054ab3ab00 ANDROID: db845c: Fix build when using --kgdb
* CONFIG_WATCHDOG is disabled when compiling with
  --kgdb option, hence the list of modules produced is
  adjusted conditionally.

Bug: 270320056
Change-Id: I0eafb118836e6a31dc3b0392ab7d60b5597b9367
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
2023-06-26 11:45:17 +00:00
Wesley Cheng
a39af6210e FROMGIT: usb: host: xhci-plat: Set XHCI_STATE_REMOVING before resuming XHCI HC
There are situations during the xhci_resume() sequence, which allows for
re-initializing of the XHCI HC.  However, in case the HCD is being removed,
these operations may not be needed.  Set the removal state before issuing
the runtime PM get on the XHCI device, so that the XHCI resume routine will
know when to bypass the re-init logic.

Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Message-ID: <20230531222719.14143-3-quic_wcheng@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 285037166
(cherry picked from commit 18af4b5c97915a6daef9de28a30ae1d3786bc2ac https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing)
Change-Id: I59ca78320bb2705c8aed8a9823de5a955ff97b0c
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-06-23 16:22:19 -07:00
Wesley Cheng
50c99c83e2 FROMGIT: usb: host: xhci: Do not re-initialize the XHCI HC if being removed
During XHCI resume, if there was a host controller error detected the
routine will attempt to re-initialize the XHCI HC, so that it can return
back to an operational state.  If the XHCI host controller is being
removed, this sequence would be already handled within the XHCI halt path,
leading to a duplicate set of reg ops/calls.  In addition, since the XHCI
bus is being removed, the overhead added in restarting the HCD is
unnecessary.  Check for the XHC state before setting the reinit_xhc
parameter, which is responsible for triggering the restart.

Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Message-ID: <20230531222719.14143-2-quic_wcheng@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 285037166
(cherry picked from commit fb2ce17874cf3c3c183e5fd75144ffbe2313bf31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing)
Change-Id: Iaaf20e855930b67b356e34286991411f74af2d60
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-06-23 16:21:54 -07:00
Yifan Hong
fa9645687e FROMLIST: kheaders: dereferences the source tree
When the kernel is built inside a sandbox container,
a forest of symlinks to the source files may be
created in the container. In this case, the generated
kheaders.tar.xz should follow these symlinks
to access the source files, instead of packing
the symlinks themselves.

Test: manual (add kheaders_data.tar.xz to the output,
  then examine the contents)
Bug: 276339429
Fixes: b0acbba3f489 ("Revert "Revert "Revert "FROMLIST: kheaders: Follow symlinks to source files."""")
Link: https://lore.kernel.org/lkml/20230420010029.2702543-1-elsk@google.com/
Signed-off-by: Yifan Hong <elsk@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:28fa7afc424f3dc53358c0e9b080433d78f0cd54)
Merged-In: Ie4db22dfa13d05fdccb3ad8f4fae2fe3fead994e
Change-Id: Ie4db22dfa13d05fdccb3ad8f4fae2fe3fead994e
2023-06-23 09:09:00 +00:00
Jaegeuk Kim
21061b7d0f FROMLIST: f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue
This reverts commit 27161f13e3 "f2fs: avoid race in between read xattr & write xattr".

That introduced a deadlock case:

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

Let's take a look at the original issue back.

Thread A:                                       Thread B:
-f2fs_getxattr
   -lookup_all_xattrs
      -xnid = F2FS_I(inode)->i_xattr_nid;
                                                -f2fs_setxattr
                                                    -__f2fs_setxattr
                                                        -write_all_xattrs
                                                            -truncate_xattr_node
                                                                  ...  ...
                                                -write_checkpoint
                                                                  ...  ...
                                                -alloc_nid   <- nid reuse
          -get_node_page
              -f2fs_bug_on  <- nid != node_footer->nid

I think we don't need to truncate xattr pages eagerly which introduces lots of
data races without big benefits.

Bug: 280545073
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/linux-f2fs-devel/20230613233940.3643362-1-jaegeuk@kernel.org/T/#u
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Change-Id: Ifdbaf7defa50b479d82d2c945aa9d48e2e2317ed
2023-06-23 09:08:28 +00:00
Ulises Mendez Martinez
ec0fc55aa4 ANDROID: db845c: Local define for db845c targets
Generally DAMP is a best practice in Bazel, for this
specific case, it helps with:

* Better target discoverability and auto-completion.
* It's possible to use `select` for KGDB fixes later on
  without encountering name expectations broken.

Bug: 256196368
Bug: 270320056
Change-Id: I300404a9b2b4b7c6569145a942ecb445d23e8e9a
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
2023-06-23 09:08:01 +00:00
LongPing Wei
947e7c1d72 ANDROID: GKI: Update symbols to symbol list
1 function symbol(s) added
  'int cgroup_add_dfl_cftypes(struct cgroup_subsys*, struct cftype*)'

Bug: 287922632

Change-Id: I38cf93237bd78c7577ad948f9495d491d9f62389
Signed-off-by: LongPing Wei <weilongping@oppo.com>
2023-06-23 07:53:18 +00:00
LongPing Wei
9afd7b261a ANDROID: Export memcg functions to allow module to add new files
Export cgroup_add_dfl_cftypes to allow vendor module to expose additional files in the memory cgroup-v2 hierarchy.

Bug: 287922632

Change-Id: I103b983fbb46ff7a45cfc57f5657142a1bbd3d68
Signed-off-by: LongPing Wei <weilongping@oppo.com>
2023-06-23 07:53:18 +00:00
Ulises Mendez Martinez
32c2d42ee1 ANDROID: rockpi4: Fix build when using --kgdb
* CONFIG_WATCHDOG is disabled when compiling with
--kgdb option, hence the list of modules produced is
adjusted conditionally on its value.

Bug: 270320056
Change-Id: I4db55fdf6b91a65209d2e0ae3bbb5f384c7eca22
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
2023-06-22 13:00:37 +00:00
fengqi
275048c878 ANDROID: GKI: update symbol list file for xiaomi
INFO: ABI DIFFERENCES HAVE BEEN DETECTED!
INFO: 1 function symbol(s) added
  'int param_set_uint_minmax(const char*, const struct kernel_param*, unsigned int, unsigned int)'

Bug: 288308524

Change-Id: If5f11f762b6f870d8ab2d264eb0a4a2febe62e65
Signed-off-by: fengqi <fengqi@xiaomi.com>
2023-06-22 11:33:44 +00:00
Yifan Hong
64e4b4d31b ANDROID: kleaf: android/gki_system_dlkm_modules is generated.
modules.bzl is the source of truth for the list of GKI
modules. There is no need to keep two lists.

Test: TH
Bug: 287697703
Signed-off-by: Yifan Hong <elsk@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:a8a61755f67730af45d50f6173a4eedbcefa1c87)
Merged-In: I8953e92696833cf8ec27aa80724ec468c08736f1
Change-Id: I8953e92696833cf8ec27aa80724ec468c08736f1
2023-06-22 11:33:16 +00:00
John Scheible
734b06dabf ANDROID: ABI: Update pixel symbol list
1 function symbol(s) added
  'int __trace_bputs(unsigned long, const char*)'

Bug: 288168318
Change-Id: Ife295cef423cbc98f56f85c534bfc73100af6faf
Signed-off-by: John Scheible <johnscheible@google.com>
2023-06-21 20:59:51 +00:00
Paul Lawrence
9ea87136d1 ANDROID: fuse-bpf: Move FUSE_RELEASE to correct place
The existing fuse-bpf freeing logic would free the fuse_file struct
immediately. However, this would break readahead. Move freeing logic
to the same place as done in classic fuse.

Bug: 286287652
Test: fuse_test passes, android boots, cts tests run
Change-Id: If13519f0e956a8da0dc98e7ac4aed2036070e969
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2023-06-21 18:36:19 +00:00
Paul Lawrence
b8ef5bfbee ANDROID: fuse-bpf: Ensure bpf field can never be nulled
By putting and nulling fuse_inode's bpf field in fuse_evict_inode, we
left a race condition - this inode can still be active. Do not put the
bpf program until we are doing the final free in fuse_free_inode. This
was the root cause of the reported bug.

The backing inode cannot be put in fuse_free_inode, since put_inode can
sleep and this is called from an RCU handler. But the backing inode
cannot be freed until an RCU interval, so move the put_inode to the same
location as in overlayfs, which is destroy_inode.

Remove a path in fuse_handle_bpf_prog whereby bpf can be nulled out.
When we want to be able to null/change the bpf_prog in the future, we
will have to use a mutex or maybe RCU to protect existing users. But
until this time, ban this path.

Bug: 284450048
Test: fuse_test passes, Pixel 6 passes basic tests
Change-Id: Ie6844242f279a5b202eb021eac5a2dd3d08bf09d
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2023-06-21 18:36:19 +00:00
Jaskaran Singh
a97d54b54d ANDROID: GKI: Increase CMA areas to 32
Current usecases require more than 16 CMA areas. Hence increase the
number of CMA areas to 32.

Bug: 287582821
Change-Id: I50439ee2a3e16d62fdf6c77b99f4779f3af430d6
Signed-off-by: Pratyush Brahma <quic_pbrahma@quicinc.com>
Signed-off-by: Jaskaran Singh <quic_jasksing@quicinc.com>
2023-06-21 13:18:52 +00:00
Yifan Hong
d28f02c47b ANDROID: Delete MODULES_LIST from build configs.
They are controlled by kernel_images.modules_list, which is
set by define_common_kernels already.

The flags in build.configs has no effect.

Test: TH
Bug: 287697703
Signed-off-by: Yifan Hong <elsk@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:9bf4e4620ecc801c7eb824210595d9777b4a2ff8)
Merged-In: I1e322529476b4db67a1574393819900bdbd41311
Change-Id: I1e322529476b4db67a1574393819900bdbd41311
2023-06-21 11:18:02 +00:00
cathy.cai
97a56a07e9 ANDROID: ABI: Update symbols to unisoc whitelist
Update whitelist for the symbols used by the unisoc device and
update the ABI representation accordingly.

5 function symbol(s) added
  'void inet_proto_csum_replace4(__sum16*, struct sk_buff*, __be32, __be32, bool)'
  'struct nf_conntrack_tuple_hash* nf_conntrack_find_get(struct net*, const struct nf_conntrack_zone*, const struct nf_conntrack_tuple*)'
  'void nf_ct_destroy(struct nf_conntrack*)'
  'int pskb_trim_rcsum_slow(struct sk_buff*, unsigned int)'
  'struct rt6_info* rt6_lookup(struct net*, const struct in6_addr*, const struct in6_addr*, int, const struct sk_buff*, int)'

Bug: 287899373
Change-Id: I30fb1f57ef9eb4f4f72f64471bb71da23b2a9a90
Signed-off-by: canting cai <cathy.cai@unisoc.com>
2023-06-21 11:11:09 +00:00
Lee Jones
7668cef283 ANDROID: HID: Only utilise UHID provided exports if UHID is enabled
Commit "ANDROID: HID; Over-ride default maximum buffer size when using
UHID" provided a means for the UHID driver to offer an alternative
(smaller) report buffer size when dealing with user-space.  The method
used was an Android-only solution designed to prevent the KMI ABI from
being broken (nb: the upstream solution was cleaner, but broke the ABI).

Since this solution involved consuming resources exported by a
subordinate driver, that driver would have to be enabled for the export
to take place.  Since all of our default configs enable UHID, an issue
was not detected.  However, for more specific kernel configs, where HID
is enabled, but UHID is not, this leads to compile-time undefined symbol
errors:

  ld.lld: error: undefined symbol: uhid_hid_driver

This patch relies on the compiler to leave out unutilised sections of
the code if the associated resources are not available.

Bug: 260007429
Reported-by: Paul Lawrence <paullawrence@google.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I80b1aa7454c89d5c5e21f0268252ffb666efab97
2023-06-20 17:37:03 +00:00
Zheng Wang
1c4d2aa0c7 UPSTREAM: memstick: r592: Fix UAF bug in r592_remove due to race condition
[ Upstream commit 63264422785021704c39b38f65a78ab9e4a186d7 ]

In r592_probe, dev->detect_timer was bound with r592_detect_timer.
In r592_irq function, the timer function will be invoked by mod_timer.

If we remove the module which will call hantro_release to make cleanup,
there may be a unfinished work. The possible sequence is as follows,
which will cause a typical UAF bug.

Fix it by canceling the work before cleanup in r592_remove.

CPU0                  CPU1

                    |r592_detect_timer
r592_remove         |
  memstick_free_host|
  put_device;       |
  kfree(host);      |
                    |
                    | queue_work
                    |   &host->media_checker //use

Bug: 287729043
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Link: https://lore.kernel.org/r/20230307164338.1246287-1-zyytlz.wz@163.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 9a342d4eb9)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Idb15f593287ebaeec294b3e276126306fa6743ba
2023-06-19 14:56:51 +00:00
Darrick J. Wong
8aea35f109 UPSTREAM: xfs: verify buffer contents when we skip log replay
commit 22ed903eee23a5b174e240f1cdfa9acf393a5210 upstream.

syzbot detected a crash during log recovery:

XFS (loop0): Mounting V5 Filesystem bfdc47fc-10d8-4eed-a562-11a831b3f791
XFS (loop0): Torn write (CRC failure) detected at log block 0x180. Truncating head block from 0x200.
XFS (loop0): Starting recovery (logdev: internal)
==================================================================
BUG: KASAN: slab-out-of-bounds in xfs_btree_lookup_get_block+0x15c/0x6d0 fs/xfs/libxfs/xfs_btree.c:1813
Read of size 8 at addr ffff88807e89f258 by task syz-executor132/5074

CPU: 0 PID: 5074 Comm: syz-executor132 Not tainted 6.2.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106
 print_address_description+0x74/0x340 mm/kasan/report.c:306
 print_report+0x107/0x1f0 mm/kasan/report.c:417
 kasan_report+0xcd/0x100 mm/kasan/report.c:517
 xfs_btree_lookup_get_block+0x15c/0x6d0 fs/xfs/libxfs/xfs_btree.c:1813
 xfs_btree_lookup+0x346/0x12c0 fs/xfs/libxfs/xfs_btree.c:1913
 xfs_btree_simple_query_range+0xde/0x6a0 fs/xfs/libxfs/xfs_btree.c:4713
 xfs_btree_query_range+0x2db/0x380 fs/xfs/libxfs/xfs_btree.c:4953
 xfs_refcount_recover_cow_leftovers+0x2d1/0xa60 fs/xfs/libxfs/xfs_refcount.c:1946
 xfs_reflink_recover_cow+0xab/0x1b0 fs/xfs/xfs_reflink.c:930
 xlog_recover_finish+0x824/0x920 fs/xfs/xfs_log_recover.c:3493
 xfs_log_mount_finish+0x1ec/0x3d0 fs/xfs/xfs_log.c:829
 xfs_mountfs+0x146a/0x1ef0 fs/xfs/xfs_mount.c:933
 xfs_fs_fill_super+0xf95/0x11f0 fs/xfs/xfs_super.c:1666
 get_tree_bdev+0x400/0x620 fs/super.c:1282
 vfs_get_tree+0x88/0x270 fs/super.c:1489
 do_new_mount+0x289/0xad0 fs/namespace.c:3145
 do_mount fs/namespace.c:3488 [inline]
 __do_sys_mount fs/namespace.c:3697 [inline]
 __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3674
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f89fa3f4aca
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffd5fb5ef8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00646975756f6e2c RCX: 00007f89fa3f4aca
RDX: 0000000020000100 RSI: 0000000020009640 RDI: 00007fffd5fb5f10
RBP: 00007fffd5fb5f10 R08: 00007fffd5fb5f50 R09: 000000000000970d
R10: 0000000000200800 R11: 0000000000000206 R12: 0000000000000004
R13: 0000555556c6b2c0 R14: 0000000000200800 R15: 00007fffd5fb5f50
 </TASK>

The fuzzed image contains an AGF with an obviously garbage
agf_refcount_level value of 32, and a dirty log with a buffer log item
for that AGF.  The ondisk AGF has a higher LSN than the recovered log
item.  xlog_recover_buf_commit_pass2 reads the buffer, compares the
LSNs, and decides to skip replay because the ondisk buffer appears to be
newer.

Unfortunately, the ondisk buffer is corrupt, but recovery just read the
buffer with no buffer ops specified:

	error = xfs_buf_read(mp->m_ddev_targp, buf_f->blf_blkno,
			buf_f->blf_len, buf_flags, &bp, NULL);

Skipping the buffer leaves its contents in memory unverified.  This sets
us up for a kernel crash because xfs_refcount_recover_cow_leftovers
reads the buffer (which is still around in XBF_DONE state, so no read
verification) and creates a refcountbt cursor of height 32.  This is
impossible so we run off the end of the cursor object and crash.

Fix this by invoking the verifier on all skipped buffers and aborting
log recovery if the ondisk buffer is corrupt.  It might be smarter to
force replay the log item atop the buffer and then see if it'll pass the
write verifier (like ext4 does) but for now let's go with the
conservative option where we stop immediately.

Bug: 284409747
Link: https://syzkaller.appspot.com/bug?extid=7e9494b8b399902e994e
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reported-by: Danila Chernetsov <listdansp@mail.ru>
Link: https://lore.kernel.org/linux-xfs/20230601164439.15404-1-listdansp@mail.ru
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a2961463d7)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie5e156221966323a9cb7cc261b4ed17593cfaabd
2023-06-19 13:21:31 +00:00
Ruihan Li
04b6079eae UPSTREAM: bluetooth: Perform careful capability checks in hci_sock_ioctl()
commit 25c150ac103a4ebeed0319994c742a90634ddf18 upstream.

Previously, capability was checked using capable(), which verified that the
caller of the ioctl system call had the required capability. In addition,
the result of the check would be stored in the HCI_SOCK_TRUSTED flag,
making it persistent for the socket.

However, malicious programs can abuse this approach by deliberately sharing
an HCI socket with a privileged task. The HCI socket will be marked as
trusted when the privileged task occasionally makes an ioctl call.

This problem can be solved by using sk_capable() to check capability, which
ensures that not only the current task but also the socket opener has the
specified capability, thus reducing the risk of privilege escalation
through the previously identified vulnerability.

Bug: 286456284
Cc: stable@vger.kernel.org
Fixes: f81f5b2db8 ("Bluetooth: Send control open and close messages for HCI raw sockets")
Signed-off-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 47e6893a5b)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I9a4b20c7b1e9b4e6bbd6371264aec039770a52ff
2023-06-19 11:37:23 +00:00
Liam R. Howlett
8f5a220975 FROMLIST: maple_tree: Adjust node allocation on mas_rebalance()
mas_rebalance() is called to rebalance an insufficient node into a
single node or two sufficient nodes.  The preallocation estimate is
always too many in this case as the height of the tree will never grow
and there is no possibility to have a three way split in this case, so
revise the node allocation count.

Change-Id: I04ba0674da381c06d4f8077f9f59d64b7d1a8312
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Link: https://lore.kernel.org/all/20230612203953.2093911-9-Liam.Howlett@oracle.com/
Bug: 274059236
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-19 11:01:24 +00:00
Liam R. Howlett
e835ffdfbc FROMLIST: maple_tree: Reduce resets during store setup
mas_prealloc() may walk partially down the tree before finding that a
split or spanning store is needed.  When the write occurs, relax the
logic on resetting the walk so that partial walks will not restart, but
walks that have gone too far (a store that affects beyond the current
node) should be restarted.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>

Link: https://lore.kernel.org/all/20230612203953.2093911-16-Liam.Howlett@oracle.com/
Bug: 274059236
Change-Id: I87dedebae085f067b08caeaf1bd19bb343ff305f
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-19 11:01:24 +00:00
Liam R. Howlett
708234485a FROMLIST: BACKPORT: maple_tree: Refine mas_preallocate() node calculations
Calculate the number of nodes based on the pending write action instead
of assuming the worst case.

This addresses a performance regression introduced in platforms that
have longer allocation timing.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>

Link: https://lore.kernel.org/all/20230612203953.2093911-15-Liam.Howlett@oracle.com/
[surenb: replace mas_wr_new_end with mas_wr_node_size]

Bug: 274059236
Change-Id: I8fc22bca45fa005acf767722034a260242a4da52
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-19 11:01:24 +00:00
Suren Baghdasaryan
d766c8399b Revert "FROMLIST: BACKPORT: maple_tree: Refine mas_preallocate() node calculations"
This reverts commit 133fbad5bd.

Replacing the patch with a newer version improving performance:
https://lore.kernel.org/all/20230612203953.2093911-15-Liam.Howlett@oracle.com/

Bug: 274059236
Change-Id: I0a924698c908e00d2addb9b7c90e573e72c8ba59
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-19 11:01:24 +00:00
Will McVicker
0a859e781c ANDROID: GKI: Include kheaders in gki_system_dlkm_modules
This is needed to get the module on the system_dlkm image.

Bug: 276339429
Change-Id: Ib8c19d0d23f27bc3872e8d387b20cef07327c600
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-06-18 09:06:56 +00:00
Carlos Llamas
35fe0d393f ANDROID: 6/16/2023 KMI update
Set KMI_GENERATION=11 for 6/16 KMI update

function symbol changed from 'int __traceiter_android_rvh_schedule(void*, struct task_struct*, struct task_struct*, struct rq*)' to 'int __traceiter_android_rvh_schedule(void*, unsigned int, struct task_struct*, struct task_struct*, struct rq*)'
  CRC changed from 0x6be67582 to 0x5597e05e
  type changed from 'int(void*, struct task_struct*, struct task_struct*, struct rq*)' to 'int(void*, unsigned int, struct task_struct*, struct task_struct*, struct rq*)'
    parameter 2 type changed from 'struct task_struct*' to 'unsigned int'
    parameter 4 type changed from 'struct rq*' to 'struct task_struct*'
      pointed-to type changed from 'struct rq' to 'struct task_struct'
    parameter 5 of type 'struct rq*' was added

function symbol 'struct usb_hcd* __usb_create_hcd(const struct hc_driver*, struct device*, struct device*, const char*, struct usb_hcd*)' changed
  CRC changed from 0xab3fbd7 to 0x44b8d338

function symbol 'struct usb_phy* devm_usb_get_phy(struct device*, enum usb_phy_type)' changed
  CRC changed from 0x976fe01c to 0x3b6c04cd

function symbol 'struct usb_phy* devm_usb_get_phy_by_node(struct device*, struct device_node*, struct notifier_block*)' changed
  CRC changed from 0xaaf602d1 to 0x9225cdfb

... 25 omitted; 28 symbols have only CRC changes

type 'struct usb_phy' changed
  byte size changed from 360 to 392
  member 'u64 android_kabi_reserved0' was added
  member 'u64 android_kabi_reserved1' changed
    offset changed by 64
  member 'u64 android_kabi_reserved2' was added
  member 'u64 android_kabi_reserved3' was added
  member 'u64 android_kabi_reserved4' was added

Bug: 287162457
Change-Id: I82bd766a4ac81bb8fdaca4d95e95c8c413ac7485
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-06-16 20:49:51 +00:00
Dezhi Huang
fcc5e942e0 ANDROID: sched: Add parameter to android_rvh_schedule.
Checking whether the ui and render threads are preempted
during frame drawing,then adjusting the prority and core
selection if they are preempted,because we expect the
threads to be executed first.By introducing the
sched_mode parameter, we can check the prev thread
preemption status in the hook, and judging important
threads for executing business logic.

Bug: 285166029
Change-Id: I6af31dff4c9032940c7f1c991a25a49ebbeac7a8
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-06-16 20:18:45 +00:00
Greg Kroah-Hartman
d4dd4d9f19 ANDROID: GKI: provide more padding for struct usb_phy
There is at least one pending change for struct usb_phy that is not
going to make the ABI freeze deadline, but has already been submitted
upstream and is under active development.  So reserve a spot for that
new callback to be added, and provide a bit more buffer here to the
structure for any future LTS changes that might be coming in this area
of the kernel

Bug: 151154716
Cc: Stanley Chang <stanley_chang@realtek.com>
Change-Id: I992a46fa35502fd491ee24d503290119c9b9f655
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-16 20:18:33 +00:00
Vignesh Saravanaperumal
bb9c879726 ANDROID: GKI enable CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
Match by how many bytes or packets a connection has transferred so far, or by average bytes per packet.

Bug: 284571311
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I352bc42ab0da321e29a8cef1069565b7a5f182e7
(cherry picked from commit d80f39a5aed79ae81eb92f009829905da8e4f7a0)
2023-06-16 09:19:53 +00:00
Youngmin Nam
a7b1da66a2 FROMGIT: arm64: set __exception_irq_entry with __irq_entry as a default
filter_irq_stacks() is supposed to cut entries which are related irq entries
from its call stack.
And in_irqentry_text() which is called by filter_irq_stacks()
uses __irqentry_text_start/end symbol to find irq entries in callstack.

But it doesn't work correctly as without "CONFIG_FUNCTION_GRAPH_TRACER",
arm64 kernel doesn't include gic_handle_irq which is entry point of arm64 irq
between __irqentry_text_start and __irqentry_text_end as we discussed in below link.
https://lore.kernel.org/all/CACT4Y+aReMGLYua2rCLHgFpS9io5cZC04Q8GLs-uNmrn1ezxYQ@mail.gmail.com/#t

This problem can makes unintentional deep call stack entries especially
in KASAN enabled situation as below.

[ 2479.383395]I[0:launcher-loader: 1719] Stack depot reached limit capacity
[ 2479.383538]I[0:launcher-loader: 1719] WARNING: CPU: 0 PID: 1719 at lib/stackdepot.c:129 __stack_depot_save+0x464/0x46c
[ 2479.385693]I[0:launcher-loader: 1719] pstate: 624000c5 (nZCv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
[ 2479.385724]I[0:launcher-loader: 1719] pc : __stack_depot_save+0x464/0x46c
[ 2479.385751]I[0:launcher-loader: 1719] lr : __stack_depot_save+0x460/0x46c
[ 2479.385774]I[0:launcher-loader: 1719] sp : ffffffc0080073c0
[ 2479.385793]I[0:launcher-loader: 1719] x29: ffffffc0080073e0 x28: ffffffd00b78a000 x27: 0000000000000000
[ 2479.385839]I[0:launcher-loader: 1719] x26: 000000000004d1dd x25: ffffff891474f000 x24: 00000000ca64d1dd
[ 2479.385882]I[0:launcher-loader: 1719] x23: 0000000000000200 x22: 0000000000000220 x21: 0000000000000040
[ 2479.385925]I[0:launcher-loader: 1719] x20: ffffffc008007440 x19: 0000000000000000 x18: 0000000000000000
[ 2479.385969]I[0:launcher-loader: 1719] x17: 2065726568207475 x16: 000000000000005e x15: 2d2d2d2d2d2d2d20
[ 2479.386013]I[0:launcher-loader: 1719] x14: 5d39313731203a72 x13: 00000000002f6b30 x12: 00000000002f6af8
[ 2479.386057]I[0:launcher-loader: 1719] x11: 00000000ffffffff x10: ffffffb90aacf000 x9 : e8a74a6c16008800
[ 2479.386101]I[0:launcher-loader: 1719] x8 : e8a74a6c16008800 x7 : 00000000002f6b30 x6 : 00000000002f6af8
[ 2479.386145]I[0:launcher-loader: 1719] x5 : ffffffc0080070c8 x4 : ffffffd00b192380 x3 : ffffffd0092b313c
[ 2479.386189]I[0:launcher-loader: 1719] x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000022
[ 2479.386231]I[0:launcher-loader: 1719] Call trace:
[ 2479.386248]I[0:launcher-loader: 1719]  __stack_depot_save+0x464/0x46c
[ 2479.386273]I[0:launcher-loader: 1719]  kasan_save_stack+0x58/0x70
[ 2479.386303]I[0:launcher-loader: 1719]  save_stack_info+0x34/0x138
[ 2479.386331]I[0:launcher-loader: 1719]  kasan_save_free_info+0x18/0x24
[ 2479.386358]I[0:launcher-loader: 1719]  ____kasan_slab_free+0x16c/0x170
[ 2479.386385]I[0:launcher-loader: 1719]  __kasan_slab_free+0x10/0x20
[ 2479.386410]I[0:launcher-loader: 1719]  kmem_cache_free+0x238/0x53c
[ 2479.386435]I[0:launcher-loader: 1719]  mempool_free_slab+0x1c/0x28
[ 2479.386460]I[0:launcher-loader: 1719]  mempool_free+0x7c/0x1a0
[ 2479.386484]I[0:launcher-loader: 1719]  bvec_free+0x34/0x80
[ 2479.386514]I[0:launcher-loader: 1719]  bio_free+0x60/0x98
[ 2479.386540]I[0:launcher-loader: 1719]  bio_put+0x50/0x21c
[ 2479.386567]I[0:launcher-loader: 1719]  f2fs_write_end_io+0x4ac/0x4d0
[ 2479.386594]I[0:launcher-loader: 1719]  bio_endio+0x2dc/0x300
[ 2479.386622]I[0:launcher-loader: 1719]  __dm_io_complete+0x324/0x37c
[ 2479.386650]I[0:launcher-loader: 1719]  dm_io_dec_pending+0x60/0xa4
[ 2479.386676]I[0:launcher-loader: 1719]  clone_endio+0xf8/0x2f0
[ 2479.386700]I[0:launcher-loader: 1719]  bio_endio+0x2dc/0x300
[ 2479.386727]I[0:launcher-loader: 1719]  blk_update_request+0x258/0x63c
[ 2479.386754]I[0:launcher-loader: 1719]  scsi_end_request+0x50/0x304
[ 2479.386782]I[0:launcher-loader: 1719]  scsi_io_completion+0x88/0x160
[ 2479.386808]I[0:launcher-loader: 1719]  scsi_finish_command+0x17c/0x194
[ 2479.386833]I[0:launcher-loader: 1719]  scsi_complete+0xcc/0x158
[ 2479.386859]I[0:launcher-loader: 1719]  blk_mq_complete_request+0x4c/0x5c
[ 2479.386885]I[0:launcher-loader: 1719]  scsi_done_internal+0xf4/0x1e0
[ 2479.386910]I[0:launcher-loader: 1719]  scsi_done+0x14/0x20
[ 2479.386935]I[0:launcher-loader: 1719]  ufshcd_compl_one_cqe+0x578/0x71c
[ 2479.386963]I[0:launcher-loader: 1719]  ufshcd_mcq_poll_cqe_nolock+0xc8/0x150
[ 2479.386991]I[0:launcher-loader: 1719]  ufshcd_intr+0x868/0xc0c
[ 2479.387017]I[0:launcher-loader: 1719]  __handle_irq_event_percpu+0xd0/0x348
[ 2479.387044]I[0:launcher-loader: 1719]  handle_irq_event_percpu+0x24/0x74
[ 2479.387068]I[0:launcher-loader: 1719]  handle_irq_event+0x74/0xe0
[ 2479.387091]I[0:launcher-loader: 1719]  handle_fasteoi_irq+0x174/0x240
[ 2479.387118]I[0:launcher-loader: 1719]  handle_irq_desc+0x7c/0x2c0
[ 2479.387147]I[0:launcher-loader: 1719]  generic_handle_domain_irq+0x1c/0x28
[ 2479.387174]I[0:launcher-loader: 1719]  gic_handle_irq+0x64/0x158
[ 2479.387204]I[0:launcher-loader: 1719]  call_on_irq_stack+0x2c/0x54
[ 2479.387231]I[0:launcher-loader: 1719]  do_interrupt_handler+0x70/0xa0
[ 2479.387258]I[0:launcher-loader: 1719]  el1_interrupt+0x34/0x68
[ 2479.387283]I[0:launcher-loader: 1719]  el1h_64_irq_handler+0x18/0x24
[ 2479.387308]I[0:launcher-loader: 1719]  el1h_64_irq+0x68/0x6c
[ 2479.387332]I[0:launcher-loader: 1719]  blk_attempt_bio_merge+0x8/0x170
[ 2479.387356]I[0:launcher-loader: 1719]  blk_mq_attempt_bio_merge+0x78/0x98
[ 2479.387383]I[0:launcher-loader: 1719]  blk_mq_submit_bio+0x324/0xa40
[ 2479.387409]I[0:launcher-loader: 1719]  __submit_bio+0x104/0x138
[ 2479.387436]I[0:launcher-loader: 1719]  submit_bio_noacct_nocheck+0x1d0/0x4a0
[ 2479.387462]I[0:launcher-loader: 1719]  submit_bio_noacct+0x618/0x804
[ 2479.387487]I[0:launcher-loader: 1719]  submit_bio+0x164/0x180
[ 2479.387511]I[0:launcher-loader: 1719]  f2fs_submit_read_bio+0xe4/0x1c4
[ 2479.387537]I[0:launcher-loader: 1719]  f2fs_mpage_readpages+0x888/0xa4c
[ 2479.387563]I[0:launcher-loader: 1719]  f2fs_readahead+0xd4/0x19c
[ 2479.387587]I[0:launcher-loader: 1719]  read_pages+0xb0/0x4ac
[ 2479.387614]I[0:launcher-loader: 1719]  page_cache_ra_unbounded+0x238/0x288
[ 2479.387642]I[0:launcher-loader: 1719]  do_page_cache_ra+0x60/0x6c
[ 2479.387669]I[0:launcher-loader: 1719]  page_cache_ra_order+0x318/0x364
[ 2479.387695]I[0:launcher-loader: 1719]  ondemand_readahead+0x30c/0x3d8
[ 2479.387722]I[0:launcher-loader: 1719]  page_cache_sync_ra+0xb4/0xc8
[ 2479.387749]I[0:launcher-loader: 1719]  filemap_read+0x268/0xd24
[ 2479.387777]I[0:launcher-loader: 1719]  f2fs_file_read_iter+0x1a0/0x62c
[ 2479.387806]I[0:launcher-loader: 1719]  vfs_read+0x258/0x34c
[ 2479.387831]I[0:launcher-loader: 1719]  ksys_pread64+0x8c/0xd0
[ 2479.387857]I[0:launcher-loader: 1719]  __arm64_sys_pread64+0x48/0x54
[ 2479.387881]I[0:launcher-loader: 1719]  invoke_syscall+0x58/0x158
[ 2479.387909]I[0:launcher-loader: 1719]  el0_svc_common+0xf0/0x134
[ 2479.387935]I[0:launcher-loader: 1719]  do_el0_svc+0x44/0x114
[ 2479.387961]I[0:launcher-loader: 1719]  el0_svc+0x2c/0x80
[ 2479.387985]I[0:launcher-loader: 1719]  el0t_64_sync_handler+0x48/0x114
[ 2479.388010]I[0:launcher-loader: 1719]  el0t_64_sync+0x190/0x194
[ 2479.388038]I[0:launcher-loader: 1719] Kernel panic - not syncing: kernel: panic_on_warn set ...

So let's set __exception_irq_entry with __irq_entry as a default.
Applying this patch, we can see gic_hande_irq is included in Systemp.map as below.

* Before
ffffffc008010000 T __do_softirq
ffffffc008010000 T __irqentry_text_end
ffffffc008010000 T __irqentry_text_start
ffffffc008010000 T __softirqentry_text_start
ffffffc008010000 T _stext
ffffffc00801066c T __softirqentry_text_end
ffffffc008010670 T __entry_text_start

* After
ffffffc008010000 T __irqentry_text_start
ffffffc008010000 T _stext
ffffffc008010000 t gic_handle_irq
ffffffc00801013c t gic_handle_irq
ffffffc008010294 T __irqentry_text_end
ffffffc008010298 T __do_softirq
ffffffc008010298 T __softirqentry_text_start
ffffffc008010904 T __softirqentry_text_end
ffffffc008010908 T __entry_text_start

Change-Id: Ia0d35e33dbaabc9cb960a83fe4ea996132b6cff5
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20230424010436.779733-1-youngmin.nam@samsung.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 278156426
(cherry picked from commit f6794950f0e5ba37e3bbedda4d6ab0aad7395dd3
 git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
 for-next/misc)
2023-06-16 07:45:43 +00:00
fengqi
d73b3af21f ANDROID: GKI: update symbol list file for xiaomi
INFO: ABI DIFFERENCES HAVE BEEN DETECTED!
INFO: 8 function symbol(s) added
  'int tty_hung_up_p(struct file*)'
  'const char* tty_name(const struct tty_struct*)'
  'int tty_port_block_til_ready(struct tty_port*, struct tty_struct*, struct file*)'
  'void tty_port_close_end(struct tty_port*, struct tty_struct*)'
  'int tty_port_close_start(struct tty_port*, struct tty_struct*, struct file*)'
  'void tty_port_lower_dtr_rts(struct tty_port*)'
  'void tty_port_tty_set(struct tty_port*, struct tty_struct*)'
  'struct device* tty_register_device(struct tty_driver*, unsigned int, struct device*)'

Bug: 287182607

Change-Id: If8d7ee235d398c05c35fef05221618ddc49a87fe
Signed-off-by: fengqi <fengqi@xiaomi.com>
2023-06-15 14:00:39 +00:00
Matthias Maennich
73185e2d4e ANDROID: Remove all but top-level OWNERS
Now that the branch is used to create production GKI
images, need to institute ACK DrNo for all commits.

The DrNo approvers are in the android-mainline branch
at /OWNERS_DrNo.

Bug: 287162457
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: Id5bb83d7add5f314df6816c1c51b4bf2d8018e79
2023-06-15 09:54:33 +01:00
Matthias Maennich
1090306d3d ANDROID: Enable GKI Dr. No Enforcement
This locks down OWNERS approval to a small group to guard against
unintentional breakages.

Bug: 287162457
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I58ca467b1e7786e1ad0f6ad67c7a7a5845a91ec6
2023-06-15 09:54:33 +01:00
Carlos Llamas
16c18c497d ANDROID: 6/16/2023 KMI update
Set KMI_GENERATION=10 for 6/16 KMI update

function symbol changed from 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' to 'int devm_gh_rm_register_platform_ops(struct device*, const struct gh_rm_platform_ops*)'
  CRC changed from 0xec193d82 to 0xe82ea1f9
  type changed from 'int(struct device*, struct gh_rm_platform_ops*)' to 'int(struct device*, const struct gh_rm_platform_ops*)'
    parameter 2 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

function symbol changed from 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' to 'int gh_rm_register_platform_ops(const struct gh_rm_platform_ops*)'
  CRC changed from 0xc34a7803 to 0xfd11885c
  type changed from 'int(struct gh_rm_platform_ops*)' to 'int(const struct gh_rm_platform_ops*)'
    parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

function symbol changed from 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' to 'void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops*)'
  CRC changed from 0xc1f09d18 to 0x57f483b
  type changed from 'void(struct gh_rm_platform_ops*)' to 'void(const struct gh_rm_platform_ops*)'
    parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

function symbol 'int ___pskb_trim(struct sk_buff*, unsigned int)' changed
  CRC changed from 0xb8fdf4c6 to 0x45b20f13

function symbol 'struct sk_buff* __alloc_skb(unsigned int, gfp_t, int, int)' changed
  CRC changed from 0x34355489 to 0x19dd35ba

function symbol 'void __balance_callbacks(struct rq*)' changed
  CRC changed from 0x76a1a2f4 to 0x2af1f39a

... 886 omitted; 889 symbols have only CRC changes

type 'struct hci_dev' changed
  byte size changed from 6416 to 6464
  member 'struct mutex unregister_lock' was added
  106 members ('struct work_struct cmd_sync_cancel_work' .. 'u64 android_kabi_reserved4') changed
    offset changed by 384

type 'struct sock' changed
  member 'int sk_wait_pending' was added

type 'struct xhci_driver_overrides' changed
  byte size changed from 64 to 120
  member 'int(* address_device)(struct usb_hcd*, struct usb_device*)' was added
  member 'int(* bus_suspend)(struct usb_hcd*)' was added
  member 'int(* bus_resume)(struct usb_hcd*)' was added
  member 'u64 android_kabi_reserved1' was added
  member 'u64 android_kabi_reserved2' was added
  member 'u64 android_kabi_reserved3' was added
  member 'u64 android_kabi_reserved4' was added

type 'struct pneigh_entry' changed
  member changed from 'u8 key[0]' to 'u32 key[0]'
    offset changed from 232 to 256
    type changed from 'u8[0]' to 'u32[0]'
      element type changed from 'u8' = '__u8' = 'unsigned char' to 'u32' = '__u32' = 'unsigned int'
        resolved type changed from 'unsigned char' to 'unsigned int'

type 'struct usb_udc' changed
  byte size changed from 952 to 1048
  member 'bool allow_connect' was added
  member 'struct work_struct vbus_work' was added
  member 'struct mutex connect_lock' was added

type 'struct sk_psock' changed
  byte size changed from 392 to 472
  member changed from 'struct work_struct work' to 'struct delayed_work work'
    offset changed from 2176 to 2112
    type changed from 'struct work_struct' to 'struct delayed_work'
  member 'struct rcu_work rwork' changed
    offset changed by 640

type 'struct netns_sysctl_ipv6' changed
  member changed from 'bool skip_notify_on_dev_down' to 'int skip_notify_on_dev_down'
    type changed from 'bool' = '_Bool' to 'int'
      resolved type changed from '_Bool' to 'int'
  member 'u8 fib_notify_on_flag_change' changed
    offset changed by 24

type 'struct sk_psock_work_state' changed
  byte size changed from 16 to 8
  member 'struct sk_buff* skb' was removed
  2 members ('u32 len' .. 'u32 off') changed
    offset changed by -64

Bug: 287162457
Change-Id: I438a8aa2c6a38dd5d575493b2735fe4d4403a971
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-06-14 23:24:57 +00:00
Elliot Berman
fcc32be061 ANDROID: virt: gunyah: Sync with latest platform ops
Const-ify the gh_rm_platform_ops.

Syncs with the latest version of the platform ops:

https://lore.kernel.org/all/20230613172054.3959700-15-quic_eberman@quicinc.com/

INFO: function symbol changed from 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' to 'int devm_gh_rm_register_platform_ops(struct device*, const struct gh_rm_platform_ops*)'
  CRC changed from 0xc4b20ef4 to 0x7fe0042f
  type changed from 'int(struct device*, struct gh_rm_platform_ops*)' to 'int(struct device*, const struct gh_rm_platform_ops*)'
    parameter 2 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

function symbol changed from 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' to 'int gh_rm_register_platform_ops(const struct gh_rm_platform_ops*)'
  CRC changed from 0xc34a7803 to 0xfd11885c
  type changed from 'int(struct gh_rm_platform_ops*)' to 'int(const struct gh_rm_platform_ops*)'
    parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

function symbol changed from 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' to 'void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops*)'
  CRC changed from 0xc1f09d18 to 0x57f483b
  type changed from 'void(struct gh_rm_platform_ops*)' to 'void(const struct gh_rm_platform_ops*)'
    parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*'
      pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops'
        qualifier const added

Bug: 287037804
Change-Id: Iff37610b721c344ac8c6b1737830f6d1e8674d34
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-06-14 23:05:19 +00:00
Badhri Jagan Sridharan
69a3ec73e4 FROMGIT: usb: gadget: udc: core: Prevent soft_connect_store() race
usb_udc_connect_control(), soft_connect_store() and
usb_gadget_deactivate() can potentially race against each other to invoke
usb_gadget_connect()/usb_gadget_disconnect(). To prevent this, guard
udc->started, gadget->allow_connect, gadget->deactivate and
gadget->connect with connect_lock so that ->pullup() is only invoked when
the gadget is bound, started and not deactivated. The routines
usb_gadget_connect_locked(), usb_gadget_disconnect_locked(),
usb_udc_connect_control_locked(), usb_gadget_udc_start_locked(),
usb_gadget_udc_stop_locked() are called with this lock held.

An earlier version of this commit was reverted due to the crash reported in
https://lore.kernel.org/all/ZF4BvgsOyoKxdPFF@francesco-nb.int.toradex.com/.
commit 16737e78d190 ("usb: gadget: udc: core: Offload usb_udc_vbus_handler processing")
addresses the crash reported.

Cc: stable@vger.kernel.org
Fixes: 628ef0d273 ("usb: udc: add usb_udc_vbus_handler")
Change-Id: I33b56f9eee28059a7e113d6c8081ab6653a03c33
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Message-ID: <20230609010227.978661-2-badhri@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 286d9975a838d0a54da049765fa1d1fb96b89682
https: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ usb-linus)
2023-06-14 23:03:53 +00:00
Badhri Jagan Sridharan
18b677ffae FROMGIT: usb: gadget: udc: core: Offload usb_udc_vbus_handler processing
usb_udc_vbus_handler() can be invoked from interrupt context by irq
handlers of the gadget drivers, however, usb_udc_connect_control() has
to run in non-atomic context due to the following:
a. Some of the gadget driver implementations expect the ->pullup
   callback to be invoked in non-atomic context.
b. usb_gadget_disconnect() acquires udc_lock which is a mutex.

Hence offload invocation of usb_udc_connect_control()
to workqueue.

UDC should not be pulled up unless gadget driver is bound. The new flag
"allow_connect" is now set by gadget_bind_driver() and cleared by
gadget_unbind_driver(). This prevents work item to pull up the gadget
even if queued when the gadget driver is already unbound.

Cc: stable@vger.kernel.org
Fixes: 1016fc0c09 ("USB: gadget: Fix obscure lockdep violation for udc_mutex")
Change-Id: Idbe00846fc5394397567024c3081381ddec7cfae
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Message-ID: <20230609010227.978661-1-badhri@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 50966da807c81c5eb3bdfd392990fe0bba94d1ee
https: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ usb-linus)
2023-06-14 23:03:53 +00:00
Johan Hovold
a1741f9c45 UPSTREAM: Bluetooth: fix debugfs registration
commit fe2ccc6c29d53e14d3c8b3ddf8ad965a92e074ee upstream.

Since commit ec6cef9cd9 ("Bluetooth: Fix SMP channel registration for
unconfigured controllers") the debugfs interface for unconfigured
controllers will be created when the controller is configured.

There is however currently nothing preventing a controller from being
configured multiple time (e.g. setting the device address using btmgmt)
which results in failed attempts to register the already registered
debugfs entries:

	debugfs: File 'features' in directory 'hci0' already present!
	debugfs: File 'manufacturer' in directory 'hci0' already present!
	debugfs: File 'hci_version' in directory 'hci0' already present!
	...
	debugfs: File 'quirk_simultaneous_discovery' in directory 'hci0' already present!

Add a controller flag to avoid trying to register the debugfs interface
more than once.

Fixes: ec6cef9cd9 ("Bluetooth: Fix SMP channel registration for unconfigured controllers")
Cc: stable@vger.kernel.org      # 4.0
Change-Id: I495feabe66fa2b294ff72fbb5dfd1bd869b1ad83
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e5ae01fd46)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-14 23:02:42 +00:00
Zhengping Jiang
d890debdaf UPSTREAM: Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER
[ Upstream commit 1857c19941c87eb36ad47f22a406be5dfe5eff9f ]

When the HCI_UNREGISTER flag is set, no jobs should be scheduled. Fix
potential race when HCI_UNREGISTER is set after the flag is tested in
hci_cmd_sync_queue.

Fixes: 0b94f2651f ("Bluetooth: hci_sync: Fix queuing commands when HCI_UNREGISTER is set")
Change-Id: I565a2ad87dc2ce4fd62ee0d09a5d28342fec8ad3
Signed-off-by: Zhengping Jiang <jiangzp@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 17aac12002)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-14 23:02:42 +00:00
Eric Dumazet
855c5479cb UPSTREAM: net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
[ Upstream commit edf2e1d2019b2730d6076dbe4c040d37d7c10bbe ]

skip_notify_on_dev_down ctl table expects this field
to be an int (4 bytes), not a bool (1 byte).

Because proc_dou8vec_minmax() was added in 5.13,
this patch converts skip_notify_on_dev_down to an int.

Following patch then converts the field to u8 and use proc_dou8vec_minmax().

Fixes: 7c6bb7d2fa ("net/ipv6: Add knob to skip DELROUTE message on device down")
Change-Id: I99875fad5012906099456fafa88e42e7f02133cf
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 76e38e6e1b)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-14 23:02:42 +00:00