Commit Graph

1157802 Commits

Author SHA1 Message Date
Yan Zhai
c38ea4a131 BACKPORT: gso: fix dodgy bit handling for GSO_UDP_L4
Commit 1fd54773c267 ("udp: allow header check for dodgy GSO_UDP_L4
packets.") checks DODGY bit for UDP, but for packets that can be fed
directly to the device after gso_segs reset, it actually falls through
to fragmentation:

https://lore.kernel.org/all/CAJPywTKDdjtwkLVUW6LRA2FU912qcDmQOQGt2WaDo28KzYDg+A@mail.gmail.com/

This change restores the expected behavior of GSO_UDP_L4 packets.

Fixes: 1fd54773c267 ("udp: allow header check for dodgy GSO_UDP_L4 packets.")
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Change-Id: Id7ff0fac79fb0b4fabb62b09a905f27a5e8cfea7
(cherry picked from commit 9840036786d90cea11a90d1f30b6dc003b34ee67)
[lena: Resolved conflict in net/ipv6/udp_offload.c ]
Signed-off-by: Yan Zhai <yan@cloudflare.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-02-28 16:37:55 +00:00
chenweitao
34cf02fef9 ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_copy_process(void*, struct task_struct*, int, int)'

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

Bug: 325765508
Change-Id: I0642034f53faacd597a8233390f9a90dfe428791
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-28 11:27:13 +00:00
chenweitao
763647877c ANDROID: vendor_hooks: Add hook for trace_android_vh_copy_process
Add hook for trace_android_vh_copy_process, which gives the vendor a chance to monitor the total thread count of the system and the thread count under a particular process

Bug: 325765508
Change-Id: Ibeb8aa571d44997ac10623321cd00d1686bde033
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-28 11:27:13 +00:00
Seiya Wang
26d7216e1d ANDROID: GKI: Update symbol list for mtk
ABI impact

1 function symbol(s) added
  'void ktime_get_coarse_ts64(struct timespec64*)'

Add following symbols

clk_hw_register
clk_unregister
_dev_emerg
devm_devfreq_register_opp_notifier
dma_resv_wait_timeout
drm_kms_helper_poll_init
dummy_irq_chip
fasync_helper
__genphy_config_aneg
genphy_read_status
genphy_soft_reset
genphy_suspend
gpiod_get_optional
__irq_domain_alloc_fwnode
irq_domain_free_fwnode
kill_fasync
ktime_get_coarse_ts64
__mdiobus_read
mdiobus_read
__mdiobus_write
mdiobus_write
__of_mdiobus_register
phy_drivers_register
phy_drivers_unregister
phy_error
phy_get_pause
phy_init_hw
phy_read_mmd
phy_restore_page
phy_trigger_machine
phy_write_mmd
platform_get_ethdev_address
regmap_multi_reg_write
regmap_register_patch
report_iommu_fault
snd_soc_dapm_kcontrol_widget
snd_soc_dpcm_get_substream
snd_soc_get_enum_double
snd_soc_of_parse_audio_routing
snd_soc_pm_ops
snd_soc_put_enum_double
time64_to_tm
usb_role_switch_put
usb_scuttle_anchored_urbs
v4l2_async_nf_cleanup
v4l2_async_nf_init
v4l2_async_nf_parse_fwnode_endpoints
v4l2_async_nf_register
v4l2_async_nf_unregister
v4l2_async_register_subdev
v4l2_async_unregister_subdev
v4l2_fwnode_endpoint_parse
v4l2_m2m_ioctl_decoder_cmd
v4l2_m2m_ioctl_encoder_cmd
v4l2_m2m_ioctl_try_decoder_cmd
v4l2_m2m_ioctl_try_encoder_cmd
v4l2_m2m_last_buffer_done

Bug: 327123703
Signed-off-by: Seiya Wang <seiya.wang@mediatek.com>
Change-Id: I28528cf9ce295b979042e90382fcf49414cd899d
2024-02-28 00:39:06 +00:00
Vilas Bhat
ad49939193 FROMGIT: PM: runtime: add tracepoint for runtime_status changes
Existing runtime PM ftrace events (`rpm_suspend`, `rpm_resume`,
`rpm_return_int`) offer limited visibility into the exact timing of device
runtime power state transitions, particularly when asynchronous operations
are involved. When the `rpm_suspend` or `rpm_resume` functions are invoked
with the `RPM_ASYNC` flag, a return value of 0 i.e., success merely
indicates that the device power state request has been queued, not that
the device has yet transitioned.

A new ftrace event, `rpm_status`, is introduced. This event directly logs
the `power.runtime_status` value of a device whenever it changes providing
granular tracking of runtime power state transitions regardless of
synchronous or asynchronous `rpm_suspend` / `rpm_resume` usage.

Signed-off-by: Vilas Bhat <vilasbhat@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Bug: 325508361
(cherry picked from commit 015abee404760249a5c968b9ce29216b94b8ced1
 https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
 linux-next)
Change-Id: Iad7cae74c41b23b430331379c180b5e59bc32c40
Signed-off-by: Vilas Bhat <vilasbhat@google.com>
2024-02-28 00:31:46 +00:00
liyouzhi
e7d236d9c4 ANDROID: GKI: add allowed list file for xiaomi
1 function symbol(s) added
  'int nla_append(struct sk_buff*, int, const void*)'

Bug: 322928575
Signed-off-by: liyouzhi <liyouzhi@xiaomi.corp-partner.google.com>
Change-Id: I848e6d88448388b07392c6c2251033a0eb7c93fe
2024-02-28 00:23:20 +00:00
Pablo Neira Ayuso
1bb51799bf UPSTREAM: netfilter: nft_set_rbtree: skip end interval element from gc
commit 60c0c230c6f046da536d3df8b39a20b9a9fd6af0 upstream.

rbtree lazy gc on insert might collect an end interval element that has
been just added in this transactions, skip end interval elements that
are not yet active.

Bug: 325477234
Fixes: f718863aca46 ("netfilter: nft_set_rbtree: fix overlap expiration walk")
Cc: stable@vger.kernel.org
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1296c110c5)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I42f7bca418d47948292b15ace9f371b81ccd7fe8
2024-02-27 16:22:32 +00:00
Xiaojun Ji
d68f68a9d7 ANDROID: GKI: add symbol list file for moto
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

Bug: 289423315
Bug: 326600530
Change-Id: I2f12145513148dced06d9d0ac3bf01dd92863662
Signed-off-by: Xiaojun Ji <jixj@motorola.com>
2024-02-27 13:30:12 +00:00
Peter Wang
7114c782ec UPSTREAM: scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR
If command timeout happens and cq complete IRQ is raised at the same time,
ufshcd_mcq_abort clears lprb->cmd and a NULL pointer deref happens in the
ISR. Error log:

ufshcd_abort: Device abort task at tag 18
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000108
pc : [0xffffffe27ef867ac] scsi_dma_unmap+0xc/0x44
lr : [0xffffffe27f1b898c] ufshcd_release_scsi_cmd+0x24/0x114

Fixes: f1304d442077 ("scsi: ufs: mcq: Added ufshcd_mcq_abort()")
Cc: stable@vger.kernel.org
Change-Id: I20d67f4bda2a83a7dc5c63e63b32232ff6401597
(cherry picked from commit 27900d7119c464b43cd9eac69c85884d17bae240)
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20231106075117.8995-1-peter.wang@mediatek.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-02-26 17:25:00 +00:00
Peter Wang
db23405211 UPSTREAM: scsi: ufs: core: Remove dev cmd clock scaling busy
If a dev command times out, clk_scaling.active_reqs is not decreased which
causes abnormal clock scaling.

It is complicated to handle different dev command timeout cases in both
legacy mode and MCQ mode. Besides, dev cmds are rarely used and the busy
time is short.

Remove clock scaling busy window for dev cmds like we do for UIC or TM cmds
which don't update busy window either.

Change-Id: I2f25dc5032126778ac99b6a79bd78f9578dd730c
(cherry picked from commit e66413faa5b55800ad42a570aad674aed634c5e6)
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20231004062454.29165-1-peter.wang@mediatek.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-02-26 17:25:00 +00:00
Dylan Chang
c622e98ddc ANDROID: ABI: Update symbol list for Nothing
Update symbol list for Nothing

 39 function symbol(s) added
  'int __bh_read(struct buffer_head*, blk_opf_t, bool)'
  'int __fs_parse(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'ssize_t __generic_file_write_iter(struct kiocb*, struct iov_iter*)'
  'int bh_uptodate_or_lock(struct buffer_head*)'
  'int block_truncate_page(struct address_space*, loff_t, get_block_t*)'
  'int block_write_begin(struct address_space*, loff_t, unsigned int, struct page**, get_block_t*)'
  'int block_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'int block_write_full_page(struct page*, get_block_t*, struct writeback_control*)'
  'void clear_nlink(struct inode*)'
  'struct dentry* d_find_alias(struct inode*)'
  'void discard_new_inode(struct inode*)'
  'int fs_param_is_string(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'int fs_param_is_u32(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'sector_t generic_block_bmap(struct address_space*, sector_t, get_block_t*)'
  'struct dentry* generic_fh_to_dentry(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'struct dentry* generic_fh_to_parent(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'int generic_file_fsync(struct file*, loff_t, loff_t, int)'
  'int generic_permission(struct user_namespace*, struct inode*, int)'
  'int generic_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'int generic_writepages(struct address_space*, struct writeback_control*)'
  'int get_tree_bdev(struct fs_context*, int(*)(struct super_block*, struct fs_context*))'
  'void iget_failed(struct inode*)'
  'struct inode* ilookup(struct super_block*, unsigned long)'
  'loff_t inode_get_bytes(struct inode*)'
  'int inode_needs_sync(struct inode*)'
  'void inode_nohighmem(struct inode*)'
  'void inode_set_bytes(struct inode*, loff_t)'
  'struct backing_dev_info* inode_to_bdi(struct inode*)'
  'int insert_inode_locked(struct inode*)'
  'void invalidate_inode_buffers(struct inode*)'
  'size_t iov_iter_zero(size_t, struct iov_iter*)'
  'void kfree_link(void*)'
  'int mpage_writepages(struct address_space*, struct writeback_control*, get_block_t*)'
  'int posix_acl_chmod(struct user_namespace*, struct inode*, umode_t)'
  'void set_bh_page(struct buffer_head*, struct page*, unsigned long)'
  'void setattr_copy(struct user_namespace*, struct inode*, const struct iattr*)'
  'int sync_blockdev_nowait(struct block_device*)'
  'int sync_mapping_buffers(struct address_space*)'
  'int utf8_to_utf32(const u8*, int, unicode_t*)'

1 variable symbol(s) added
  'int overflowgid'

Bug: 326180449
Change-Id: Ibb533a3f1691080251d9fd61cf27d569b28b0e7c
Signed-off-by: Dylan Chang <dylan.chang@nothing.tech>
2024-02-26 10:13:28 +00:00
Chris Goldsworthy
8c0f917473 ANDROID: abi_gki_aarch64_qcom: Export trace_android_vh_try_fixup_sea
Add the underlying symbols for trace_android_vh_try_fixup_sea.

Bug: 320358381
Change-Id: I0fa34513d1cd503159abfef0eb6fe50284f21316
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2024-02-23 09:40:54 +00:00
Chris Goldsworthy
9be763fb64 ANDROID: arm64: Call fixup_exception() within do_sea()
path_lookupat() is capable of safely reading unampped VAs. If an
unmapped VA is read whilst the function is being called, the resulting
page fault will get re-directed to __do_page_fault(), which will call
fixup_exception() to handle the aforementioned unmapped VA read.

Now, for an OS running in a VM, let's say that memory was still mapped
at S1 but lent to another VM (i.e. unmapped at S2 for the given VM).
The reading of an unmapped VA in path_lookupat() still needs to be
handled. For hypervisors that inject an abort leading to a do_sea()
call, call fixup_exception() from do_sea() if
trace_android_vh_try_fixup_sea() indicates that we can do so.

Bug: 320358381
Change-Id: I0aedcd954f08e3011b27524f9a7b038debbb246d
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2024-02-23 09:40:54 +00:00
Sajid Dalvi
d6b58cc171 ANDROID: PCI: dwc: Wait for the link only if it has been started
In dw_pcie_host_init() regardless of whether the link has been
started or not, the code waits for the link to come up. Even in
cases where start_link() is not defined the code ends up spinning
in a loop for 1 second. Since in some systems dw_pcie_host_init()
gets called during probe, this one second loop for each pcie
interface instance ends up extending the boot time.

Wait for the link up in only if the start_link() is defined.

The patch submitted to the upstream kernel (see link below) was not
accepted due to no upstream user.

The change here is a simplified version of that patch, which will wait
for a link only if start_link ops has been defined.

Bug: 315052790
Link: https://lore.kernel.org/all/20240112093006.2832105-1-ajayagarwal@google.com/
Change-Id: I4e8d00f6195062728417e41ddd51072880676920
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
2024-02-22 22:46:51 +00:00
Will McVicker
a7f647f49d ANDROID: Update the Pixel symbol list and GKI ABI
1 function symbol(s) added
  'int __traceiter_android_rvh_ufs_complete_init(void*, struct ufs_hba*)'

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

Bug: 269652215
Change-Id: I2ed5dbcded52eab567e89aa4dec8750662074c76
Signed-off-by: Will McVicker <willmcvicker@google.com>
2024-02-20 16:52:15 -08:00
Konstantin Vyshetsky
eef88095dc ANDROID: scsi: ufs: add complete init vendor hook
Currently the core UFS driver does not have a vops to notify when the
device is operational. This commit introduces a hook, which serves to
notify device completing initialization and is ready to accept I/O.

This is required by the FIPS140-2 [1] self integrity test of inline
encryption engine, which must run whenever the host controller is reset.
The code requires sleeping while waiting for I/O to complete and allocating
some memory dynamically, which requires the vendor hook to be restricted.

[1] https://csrc.nist.gov/publications/detail/fips/140/2/final

Bug: 185809932
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
(cherry picked from commit e774e4eca69ce8ab60df04b27f524b586ab74f17)
(cherry picked from https://android-review.googlesource.com/q/commit:c0f24579002c3fb0e404f223f8574c7f4fdac200)
Merged-In: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
Change-Id: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
2024-02-20 16:46:28 -08:00
Taylor Nelms
81d55bc3b9 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - drm_mode_sort
  - of_get_drm_panel_display_mode

1 function symbol(s) added
  'int of_get_drm_panel_display_mode(struct device_node*, struct drm_display_mode*, u32*)'

Bug: 197774385
Change-Id: I146bca3e0474e44aaecd5711027c5387ccb00f1e
Signed-off-by: Taylor Nelms <tknelms@google.com>
2024-02-20 21:06:25 +00:00
Will Song
92432f07d6 ANDROID: GKI: Update the ABI symbol list
Adding the following symbols:
- devfreq_remove_governor

Test: Build
Bug: 325161541
Change-Id: I76dd0eed62685b71fd95f758fd9b401da87e4df2
Signed-off-by: Will Song <jinpengsong@google.com>
2024-02-14 21:39:25 +00:00
David Stevens
b86713e341 UPSTREAM: virtio: Add support for no-reset virtio PCI PM
If a virtio_pci_device supports native PCI power management and has the
No_Soft_Reset bit set, then skip resetting and reinitializing the device
when suspending and restoring the device. This allows system-wide low
power states like s2idle to be used in systems with stateful virtio
devices that can't simply be re-initialized (e.g. virtio-fs).

Signed-off-by: David Stevens <stevensd@chromium.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Bug: 318540621
Change-Id: Ifc60f72a6a6bd256fa14e291e615c7514dcb4d7d
(cherry picked from commit dff4fa0e57856045359440d05af9e9b7f7048f52)
Signed-off-by: Philip Chen <philipchen@google.com>
(cherry picked from commit a7dcf250aeb8e2a572774a0e51fc0432875b6661)
2024-02-14 00:31:36 +00:00
Pablo Neira Ayuso
7dc3b2e49e UPSTREAM: netfilter: nf_tables: check if catch-all set element is active in next generation
commit b1db244ffd041a49ecc9618e8feb6b5c1afcdaa7 upstream.

When deactivating the catch-all set element, check the state in the next
generation that represents this transaction.

This bug uncovered after the recent removal of the element busy mark
a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API").

Bug: 323034444
Fixes: aaa31047a6 ("netfilter: nftables: add catch-all set element support")
Cc: stable@vger.kernel.org
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a372f1d01b)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I40ac92a33db48a2709079d27d7d529946ba297c7
2024-02-13 21:31:22 +00:00
John Fastabend
8d4d76a2bd UPSTREAM: net: tls, update curr on splice as well
commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.

The curr pointer must also be updated on the splice similar to how
we do this for other copy types.

Bug: 322282717
Fixes: d829e9c411 ("tls: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Reported-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20231206232706.374377-2-john.fastabend@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ba5efd8544fa62ae85daeb36077468bf2ce974ab)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If942207e6338993096c9fbc8ce4c23a6bbecaf2e
2024-02-13 21:30:01 +00:00
Mike McTernan
9e2b775333 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - kthread_set_per_cpu

1 function symbol(s) added
  'void kthread_set_per_cpu(struct task_struct*, int)'

Bug: 274202992
Change-Id: I5802ade7fe64e3c4e3132a322a70b809cd9d007a
Signed-off-by: Mike McTernan <mikemcternan@google.com>
2024-02-13 20:15:25 +00:00
Philip Chen
5a1f8b6b46 ANDROID: Add pci_read_config_word to virtual device symbol list
Commit a7dcf250aeb8 ("UPSTREAM: virtio: Add support for no-reset virtio
PCI PM") requires pci_read_config_word.

Bug: 318540621
Change-Id: I8fbf7a49dc395b6ed2946fa6834625c63b4223af
Signed-off-by: Philip Chen <philipchen@google.com>
2024-02-13 19:56:45 +00:00
Arve Hjønnevåg
e356cae969 ANDROID: Export kthread_set_per_cpu
kthread_create_on_cpu no longer marks the created thread as a per cpu
thread, so the affinity might get lost on suspend or other hotplug
events.

Export kthread_set_per_cpu so a module that needs a kthread to stay on a
specific cpu can accomplish that.

Bug: 274202992
Change-Id: Iaafc12f93f341f9e0586cb051b7f1c941f140866
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 4fdc7e4658212c096bd19fe7196296955942f7e5)
2024-02-13 18:56:33 +00:00
Carlos Llamas
81c922621d ANDROID: GKI: fix ABI breakage in struct ipv6_devconf
The following list of commits, which are in the 6.1.57 release, add a
new field in struct ipv6_devconf and this breaks the abi. Fix this by
using one of the reserved slots for upstream changes and update the stg
file to preserve the build.

  b691264274 ("net: release reference to inet6_dev pointer")
  bad004c384 ("net: change accept_ra_min_rtr_lft to affect all RA lifetimes")
  ec4162bb70 ("net: add sysctl accept_ra_min_rtr_lft")

type 'struct ipv6_devconf' changed
  member 'union { struct { __s32 accept_ra_min_lft; u32 padding; }; struct { u64 android_kabi_reserved1; }; union { }; }' was added
  member 'u64 android_kabi_reserved1' was removed

Bug: 320243175
Change-Id: Icddcad574f3c29f6d3e63b10f8c7e51bdf46fe7f
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:51:29 +00:00
Carlos Llamas
20131b787f Reapply "net: release reference to inet6_dev pointer"
This reverts commit d9fef973fe.

Bug: 320243175
Change-Id: I4627e1097dddbb697597cbb51e4ba9f4f1af61da
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:24:27 +00:00
Carlos Llamas
c2c0273029 Reapply "net: change accept_ra_min_rtr_lft to affect all RA lifetimes"
This reverts commit ee96408e49.

Bug: 320243175
Change-Id: If51722d74fe9b326d69c96c0cdfca43db6e33b93
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:24:14 +00:00
Carlos Llamas
a8053aadca Reapply "net: add sysctl accept_ra_min_rtr_lft"
This reverts commit c8da9c614c.

Bug: 320243175
Change-Id: Ia31692230f2f5cbd2ac349edcb2be320497c52f3
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:23:48 +00:00
Carlos Llamas
fc6c1b3acb ANDROID: GKI: explicit include of stringify.h
The android_kabi.h header file uses the __stringify() macro without
explicitly including its definition via linux/stringify.h. This can
result in build breaking when using the ANDROID_KABI_USE macro:

  common/include/linux/ipv6.h:83:2: error: expected ')'
  ANDROID_KABI_USE(1, struct { __s32 accept_ra_min_lft; u32 padding; });
  ^
  [...]
  common/include/linux/android_kabi.h:44:24: note: expanded from macro '__ANDROID_KABI_CHECK_SIZE_ALIGN'
      __FILE__ ":" __stringify(__LINE__) ": "          \
                   ^

To fix this let android_kabi.h include stringify.h explicitly instead of
relying on includes of previous unrelated header files.

Bug: 324437514
Change-Id: I16cced44e723871b2e1a92b312e60f38e41fea70
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:22:19 +00:00
Gao Xiang
8481b97df5 BACKPORT: erofs: fix infinite loop due to a race of filling compressed_bvecs
I encountered a race issue after lengthy (~594647 sec) stress tests on
a 64k-page arm64 VM with several 4k-block EROFS images.  The timing
is like below:

z_erofs_try_inplace_io                  z_erofs_fill_bio_vec
  cmpxchg(&compressed_bvecs[].page,
          NULL, ..)
                                        [access bufvec]
  compressed_bvecs[] = *bvec;

Previously, z_erofs_submit_queue() just accessed bufvec->page only, so
other fields in bufvec didn't matter.  After the subpage block support
is landed, .offset and .end can be used too, but filling bufvec isn't
an atomic operation which can cause inconsistency.

Let's use a spinlock to keep the atomicity of each bufvec.

Fixes: 192351616a9d ("erofs: support I/O submission for sub-page compressed blocks")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Link: https://lore.kernel.org/r/20240125120039.3228103-1-hsiangkao@linux.alibaba.com

Bug: 324640522
(cherry picked from commit cc4b2dd95f0d1eba8c691b36e8f4d1795582f1ff
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ master)

[dhavale: introduced spinlock in struct erofs_workgroup, upstream has a
change where atomic is replaced by lockref but pulling that and related
changes will cause unnecessary churn. Adding spinlock keeps the spirit
of the change in-tact by fixing the race. Also updated commit message
as we are not using lockref.]

Change-Id: Id20a0a433277ab71d46bce48c81824564d1b391d
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2024-02-12 20:56:13 +00:00
Prakruthi Deepak Heragu
886c9d1fc2 ANDROID: arm64: virt: Invalidate tlb once the balloon before reporting/inflating
Instead of invalidating the tlb of the guest every page it relinquishes,
invalidate once before the host is informed about the free pages.

Bug: 315173520
Change-Id: I8450fd552a27dfc791efa15e884982aeedaa3234
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
2024-02-12 17:25:48 +00:00
Prakruthi Deepak Heragu
4aedc102c3 ANDROID: arm64: virt: Make the page_relinquish call generic
Move out the kvm specific page_relinquish call and introduce a generic
hypervisor_ops structure. Based on the hypervisor running underneath the
guest, populate the operations to make specific hypercalls.

Bug: 315173520
Change-Id: I93d5a92553a04d56811b0666dec6eacc1ca168e7
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
2024-02-12 17:25:48 +00:00
Konrad Dybcio
d3f73f0452 UPSTREAM: drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks
[ Upstream commit 3d07a411b4faaf2b498760ccf12888f8de529de0 ]

This helper has been introduced to avoid programmer errors (missing
_put calls leading to dangling refcnt) when using pm_runtime_get, use it.

While at it, start checking the return value.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 5c82902844 ("drm/msm/dsi: Split PHY drivers to separate files")
Patchwork: https://patchwork.freedesktop.org/patch/543350/
Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-1-a11a751f34f0@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Bug: 146449535
Change-Id: I13c0463e50475f3a432818108bc48dd6482c3c7c
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2024-02-08 18:38:26 +00:00
Konrad Dybcio
df2fe1add7 UPSTREAM: drm/msm/dsi: Enable runtime PM
commit 6ab502bc1cf3147ea1d8540d04b83a7a4cb6d1f1 upstream.

Some devices power the DSI PHY/PLL through a power rail that we model
as a GENPD. Enable runtime PM to make it suspendable.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/543352/
Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-2-a11a751f34f0@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 146449535
Change-Id: I7cde481b64be594e5b4aa7fe7d9378d25f2e39b3
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2024-02-08 18:18:06 +00:00
Ard Biesheuvel
6053d8ffd4 UPSTREAM: arm64: scs: Disable LTO for SCS patching code
Full LTO takes the '-mbranch-protection=none' passed to the compiler
when generating the dynamic shadow call stack patching code as a hint to
stop emitting PAC instructions altogether. (Thin LTO appears unaffected
by this)

Work around this by disabling LTO for the compilation unit, which
appears to convince the linker that it should still use PAC in the rest
of the kernel..

Fixes: 3b619e22c460 ("arm64: implement dynamic shadow call stack for Clang")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20240123133052.1417449-6-ardb+git@google.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit d104a6fef3fec137d8d44961224ab76edbd6cbc7)
Bug: 317883735
Change-Id: Ic4bdb0a6e527f8cb2745282b81945aa7b7231502
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2024-02-07 10:37:36 +00:00
Bo Ye
696293ef72 ANDROID: GKI: Update symbol list for mtk
Add following symbols

 1 function symbol(s) added
   'bool usb_check_bulk_endpoints(const struct usb_interface*, const u8*)'

Bug: 323718720
Change-Id: I0835786fb503e6e65f21116fa2b5d7e8fb83978d
Signed-off-by: Bo Ye <bo.ye@mediatek.com>
2024-02-07 00:59:58 +00:00
Daniel Rosenberg
6338e41509 BACKPORT: f2fs: Restrict max filesize for 16K f2fs
Blocks are tracked by u32, so the max permitted filesize is
(U32_MAX + 1) * BLOCK_SIZE. Additionally, in order to support crypto
data unit sizes of 4K with a 16K block with IV_INO_LBLK_{32,64}, we must
further restrict max filesize to (U32_MAX + 1) * 4096. This does not
affect 4K blocksize f2fs as the natural limit for files are well below
that.

Fixes: cf46c5872022 ("BACKPORT: Support Block Size == Page Size")
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Change-Id: I8697e37841e1882a3f613e9aab1857ad7e4c3f2f
Bug: 248132568
(cherry picked from commit a6a010f5def544af3efcfe21683905a712b60536)
2024-02-07 00:14:26 +00:00
Daniel Rosenberg
8c8bcbdf0b BACKPORT: f2fs: Support Block Size == Page Size
This allows f2fs to support cases where the block size = page size for
both 4K and 16K block sizes. Other sizes should work as well, should the
need arise. This does not currently support 4K Block size filesystems if
the page size is 16K.

Change-Id: Ifab03cddeec1389a6a3fb64174063ffccbb93072
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Bug: 248132568
(cherry picked from commit 8b8e202be3264fc33464f8dc319e0c1563ac89d8)
(fixed minor conflict in fs/f2fs/inode.c)
2024-02-07 00:14:26 +00:00
Andre Ding
eb20497d6d ANDROID: abi_gki_aarch64_qcom: Update symbol list
The Marvell phy AQR113c requires below symbols to enhance debugging.
  genphy_c45_an_config_aneg
  genphy_c45_check_and_restart_aneg
  genphy_c45_pma_setup_forced
  genphy_c45_read_status
  phy_modify_mmd_changed
  phy_resolve_aneg_linkmode
  phy_set_max_speed

Bug: 324005886
Change-Id: Ie20cbecbc01c885eab701416ee499f0f1dc2dd66
Signed-off-by: Andre Ding <quic_shuangxi@quicinc.com>
2024-02-06 22:49:47 +00:00
Dmitry Baryshkov
1e6c1ca9a2 UPSTREAM: usb: typec: tcpm: fix the PD disabled case
If the PD is disabled for the port, port->pds will be left as NULL,
which causes the following crash during caps intilisation. Fix the
crash.

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Call trace:
 tcpm_register_port+0xaec/0xc44
 qcom_pmic_typec_probe+0x1a4/0x254
 platform_probe+0x68/0xc0
 really_probe+0x148/0x2ac
 __driver_probe_device+0x78/0x12c
 driver_probe_device+0xd8/0x160
Bluetooth: hci0: QCA Product ID   :0x0000000a
 __device_attach_driver+0xb8/0x138
 bus_for_each_drv+0x80/0xdc
Bluetooth: hci0: QCA SOC Version  :0x40020150
 __device_attach+0x9c/0x188
 device_initial_probe+0x14/0x20
 bus_probe_device+0xac/0xb0
 deferred_probe_work_func+0x8c/0xc8
 process_one_work+0x1ec/0x51c
 worker_thread+0x1ec/0x3e4
 kthread+0x120/0x124
 ret_from_fork+0x10/0x20

Fixes: cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240113-pmi632-typec-v2-5-182d9aa0a5b3@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

BUG: 206108037
(cherry picked from commit f2e5d3de7e1fbf24483e7f996e519b3ebc3935a1)
Change-Id: If3e81f4bc7c22830d8b0e8400b6e2fc8719a7f6b
Signed-off-by: Kyle Tso <kyletso@google.com>
2024-02-06 02:20:19 +00:00
Florian Westphal
ba97ad7b91 UPSTREAM: netfilter: nf_tables: reject QUEUE/DROP verdict parameters
commit f342de4e2f33e0e39165d8639387aa6c19dff660 upstream.

This reverts commit e0abdadcc6.

core.c:nf_hook_slow assumes that the upper 16 bits of NF_DROP
verdicts contain a valid errno, i.e. -EPERM, -EHOSTUNREACH or similar,
or 0.

Due to the reverted commit, its possible to provide a positive
value, e.g. NF_ACCEPT (1), which results in use-after-free.

Its not clear to me why this commit was made.

NF_QUEUE is not used by nftables; "queue" rules in nftables
will result in use of "nft_queue" expression.

If we later need to allow specifiying errno values from userspace
(do not know why), this has to call NF_DROP_GETERR and check that
"err <= 0" holds true.

Bug: 323034288
Fixes: e0abdadcc6 ("netfilter: nf_tables: accept QUEUE/DROP verdict parameters")
Cc: stable@vger.kernel.org
Reported-by: Notselwyn <notselwyn@pwning.tech>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8e34430e33)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie6c699cea6f92cd4a7642f196d5f5cbffe268a6d
2024-02-05 13:05:13 +00:00
chenweitao
76f0396b57 ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_binder_detect_low_async_space_locked(void*, int, size_t*, int, bool*)'

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

Bug: 322915513
Change-Id: I99867fc9a643b50ba607d948a228c02bc30df424
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-02 19:36:14 +00:00
chenyuwen
016b640235 ANDROID: fuse: Fix the issue of fuse_dentry_canonical_path
The d_canonical_path is added for Android. The another fuse daemon
such as ntfs.3g do not implement it. The fsnotify can not work when
using those fuse daemon.

Fixes: aca265111a ("ANDROID: fuse: Add support for d_canonical_path")
Change-Id: I4244431fa1520b5bc33e07da456b3062b635dc5c
Signed-off-by: chenyuwen <chenyuwen1@meizu.com>
2024-02-02 10:03:33 +00:00
Qais Yousef
5eb1cbb384 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - cpufreq_driver_test_flags

Bug: 322549912
Change-Id: If11bb96309537e0ee20aaf609dc2cf4ae6324078
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-02-01 23:58:58 +00:00
Qais Yousef
b53c3cb351 ANDROID: Export cpufreq_driver_test_flags()
The function is required by out of tree cpufreq governors.

Bug: 322549912
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: Ib62bb957d72878a56cbbd955447b372cdad3b92c
2024-02-01 23:58:58 +00:00
Bart Van Assche
9b476ebe99 ANDROID: Build null_blk and scsi_debug as kernel modules
Both kernel modules are important for testing block layer and SCSI core
performance and functionality. Hence enable these in the kernel
configuration.

Bug: 323406846
Change-Id: I23cee78cd7d4e5f891395624a6bed01cffee4aa8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-02-01 23:53:56 +00:00
Will McVicker
01472f3af1 ANDROID: GKI: Update the pixel symbol list
2 function symbol(s) added
  'int __traceiter_android_rvh_ufs_reprogram_all_keys(void*, struct ufs_hba*, int*)'
  'int __traceiter_dwc3_readl(void*, void*, u32, u32)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_ufs_reprogram_all_keys'
  'struct tracepoint __tracepoint_dwc3_readl'

Bug: 269652215
Change-Id: Id48d7d9770551c84f226f43de751eea48ae3eb7d
Signed-off-by: Will McVicker <willmcvicker@google.com>
2024-02-01 23:52:29 +00:00
Ray Chi
fbcd29ac45 ANDROID: usb: dwc3: export tracepoint for dwc3 read/write
There are two tracepoints in dwc3_readl() and dwc3_writel().
This patch will export the tracepoints so that vendor modules
can use them.

Bug: 184920962
Signed-off-by: Ray Chi <raychi@google.com>
Change-Id: I1170d853be1fa1c47afbba133567b1996418d8e8
2024-02-01 23:52:29 +00:00
Eric Biggers
0123832f68 ANDROID: scsi: ufs: add vendor hook to override key reprogramming
Some hardware has a way to restore all keyslots at once that is
significantly faster than restoring each keyslot individually, as is
done by blk_ksm_reprogram_all_keys().  Add a hook
"android_rvh_ufs_reprogram_all_keys" that allows overriding the
restoration of all keyslots after UFS reset.  This may sleep, so this
must be a "restricted" Android vendor hook rather than a regular one.

Note that currently this functionality can't be upstreamed, as support
for the hardware that needs it would need to be upstreamed first.

(cherry picked from commit e2e063f5074e2e14a96875e5e5670314a41e1c34)

Bug: 162257402
Bug: 181905172
Bug: 241106918
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Kenny Root <kroot@google.com>
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
2024-02-01 23:52:29 +00:00
chenweitao
7ce117301e ANDROID: vendor_hooks: Add hook for binder_detect_low_async_space_locked
Add hook for binder_detect_low_async_space_locked, which gives the vendor a choice whether or not this alloc new buf should go on or not

Bug: 322915513
Change-Id: Ie7f1567dae6dee0fb22b014cd1eacc3308ccb205
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-01 18:31:21 +00:00