Commit Graph

1157819 Commits

Author SHA1 Message Date
Chao Yu
cc322f7dee FROMGIT: f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic
verify_blkaddr() will trigger panic once we inject fault into
f2fs_is_valid_blkaddr(), fix to remove this unnecessary f2fs_bug_on().

Fixes: 18792e64c8 ("f2fs: support fault injection for f2fs_is_valid_blkaddr()")
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Bug: 313549450
(cherry picked from commit b896e302f79678451a94769ddd9e52e954c64fbb
 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: Ibffad271c17efd219099f07aab54ac080cae4fba
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-03-04 18:26:14 +00:00
Chao Yu
33d3b7311b FROMGIT: f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode
In reserve_compress_blocks(), we update blkaddrs of dnode in prior to
inc_valid_block_count(), it may cause inconsistent status bewteen
i_blocks and blkaddrs once inc_valid_block_count() fails.

To fix this issue, it needs to reverse their invoking order.

Fixes: c75488fb4d ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS")
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Bug: 313549450
(cherry picked from commit 54607494875edd636aff3c21ace3ad9a7da758a9
 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I74a5d1d47246d39b1ed0131c714c6a2a2bfab6cf
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-03-04 18:26:14 +00:00
Sheng Yong
ba28d24cea FROMGIT: f2fs: compress: fix to check unreleased compressed cluster
Compressed cluster may not be released due to we can fail in
release_compress_blocks(), fix to handle reserved compressed
cluster correctly in reserve_compress_blocks().

Fixes: 4c8ff7095b ("f2fs: support data compression")
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Bug: 313549450
(cherry picked from commit eb8fbaa53374e0a2d4381190abfe708481517bbb
 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I2a4223efb548a921a8f28f45798709743e38e899
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-03-04 18:26:14 +00:00
Chao Yu
0c3d1c94c4 FROMGIT: f2fs: compress: fix to cover normal cluster write with cp_rwsem
When we overwrite compressed cluster w/ normal cluster, we should
not unlock cp_rwsem during f2fs_write_raw_pages(), otherwise data
will be corrupted if partial blocks were persisted before CP & SPOR,
due to cluster metadata wasn't updated atomically.

Fixes: 4c8ff7095b ("f2fs: support data compression")
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Bug: 313549450
(cherry picked from commit fd244524c2cf07b5f4c3fe8abd6a99225c76544b
 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I231eef3eb7ee5a105ad929718a6d1d67f4950dd2
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-03-04 18:26:14 +00:00
Chao Yu
02a1ce0cf2 FROMGIT: f2fs: compress: fix to guarantee persisting compressed blocks by CP
If data block in compressed cluster is not persisted with metadata
during checkpoint, after SPOR, the data may be corrupted, let's
guarantee to write compressed page by checkpoint.

Fixes: 4c8ff7095b ("f2fs: support data compression")
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Bug: 313549450
(cherry picked from commit 8a430dd49e9cb021372b0ad91e60aeef9c6ced00
 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: Ie52d0bc7d89ec3111f1f6e8140555358620e875c
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-03-04 18:26:14 +00:00
Eric Biggers
139e9a0f9d ANDROID: remove LTO check from build.config.gki.aarch64.fips140
Don't check the "LTO" variable in build.config.gki.aarch64.fips140,
since fips140.ko no longer depends on LTO.  Also, Kleaf doesn't set the
"LTO" variable anyway; it was specific to build.sh.

Bug: 188620248
Change-Id: I213faa4c8c1a23898c08da121b0a5dc602b7218a
Signed-off-by: Eric Biggers <ebiggers@google.com>
2024-03-04 11:19:25 +00:00
Eric Biggers
e61a6ec29a ANDROID: add symbol list for fips140 module
Add the missing fips140_abi build target.  Then, create the fips140
symbol list by running the following command:

    tools/bazel run //common:fips140_abi_update_symbol_list

Then, update the stg file by running:

    tools/bazel run //common:kernel_aarch64_abi_dist
    tools/bazel run //common:kernel_aarch64_abi_update_symbol_list
    tools/bazel run //common:kernel_aarch64_abi_update

INFO: 36 function symbol(s) added
  'int __traceiter_android_vh_aes_decrypt(void*, const struct crypto_aes_ctx*, u8*, const u8*, int*)'
  'int __traceiter_android_vh_aes_encrypt(void*, const struct crypto_aes_ctx*, u8*, const u8*, int*)'
  'int __traceiter_android_vh_aes_expandkey(void*, struct crypto_aes_ctx*, const u8*, unsigned int, int*)'
  'int __traceiter_android_vh_sha256(void*, const u8*, unsigned int, u8*, int*)'
  'int aead_register_instance(struct crypto_template*, struct aead_instance*)'
  'int ahash_register_instance(struct crypto_template*, struct ahash_instance*)'
  'struct crypto_rng* crypto_alloc_rng(const char*, u32, u32)'
  'const char* crypto_attr_alg_name(struct rtattr*)'
  'int crypto_check_attr_type(struct rtattr**, u32, u32*)'
  'int crypto_cipher_setkey(struct crypto_cipher*, const u8*, unsigned int)'
  'void crypto_drop_spawn(struct crypto_spawn*)'
  'struct crypto_sync_skcipher* crypto_get_default_null_skcipher()'
  'int crypto_grab_aead(struct crypto_aead_spawn*, struct crypto_instance*, const char*, u32, u32)'
  'int crypto_grab_ahash(struct crypto_ahash_spawn*, struct crypto_instance*, const char*, u32, u32)'
  'int crypto_grab_shash(struct crypto_shash_spawn*, struct crypto_instance*, const char*, u32, u32)'
  'int crypto_grab_skcipher(struct crypto_skcipher_spawn*, struct crypto_instance*, const char*, u32, u32)'
  'int crypto_grab_spawn(struct crypto_spawn*, struct crypto_instance*, const char*, u32, u32)'
  'int crypto_inst_setname(struct crypto_instance*, const char*, struct crypto_alg*)'
  'void crypto_put_default_null_skcipher()'
  'int crypto_register_aeads(struct aead_alg*, int)'
  'int crypto_register_ahashes(struct ahash_alg*, int)'
  'int crypto_register_algs(struct crypto_alg*, int)'
  'int crypto_register_shashes(struct shash_alg*, int)'
  'int crypto_register_skciphers(struct skcipher_alg*, int)'
  'int crypto_register_templates(struct crypto_template*, int)'
  'void crypto_remove_spawns(struct crypto_alg*, struct list_head*, struct crypto_alg*)'
  'int crypto_rng_reset(struct crypto_rng*, const u8*, unsigned int)'
  'bool crypto_shash_alg_has_setkey(struct shash_alg*)'
  'struct crypto_tfm* crypto_spawn_tfm(struct crypto_spawn*, u32, u32)'
  'void* crypto_spawn_tfm2(struct crypto_spawn*)'
  'void crypto_unregister_shashes(struct shash_alg*, int)'
  'void crypto_unregister_skciphers(struct skcipher_alg*, int)'
  'void crypto_unregister_templates(struct crypto_template*, int)'
  'bool rng_is_initialized()'
  'void shash_free_singlespawn_instance(struct shash_instance*)'
  'int shash_register_instance(struct crypto_template*, struct shash_instance*)'

6 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_aes_decrypt'
  'struct tracepoint __tracepoint_android_vh_aes_encrypt'
  'struct tracepoint __tracepoint_android_vh_aes_expandkey'
  'struct tracepoint __tracepoint_android_vh_sha256'
  'struct list_head crypto_alg_list'
  'struct rw_semaphore crypto_alg_sem'

Bug: 188620248
Change-Id: I95931f8f3710a4f0a5b642e1c9f7299b72616972
Signed-off-by: Eric Biggers <ebiggers@google.com>
2024-03-04 11:16:37 +00:00
Andre Ding
09ca5740fb ANDROID: abi_gki_aarch64_qcom: Update symbol list
Symbols updated to QCOM abi symbol list for Toshiba EMAC:
  clk_unregister_fixed_rate
  get_phy_device
  __hw_addr_sync_dev
  netdev_features_change
  pcie_capability_read_dword
  phy_device_free
  phy_device_register
  phy_loopback
  phy_lookup_setting
  phy_restart_aneg

Bug: 325987248
Change-Id: I0f4a1070283f2e9c98df4de9da0660e572a7826e
Signed-off-by: Andre Ding <quic_shuangxi@quicinc.com>
2024-03-01 14:01:47 +08:00
Dongyun Liu
0832777c62 ANDROID: GKI: Update symbol list for transsion
18 function symbol(s) added
  'int __traceiter_android_rvh_delayacct_init(void *, void *)'
  'int __traceiter_android_rvh_delayacct_tsk_free(void *, struct task_struct *)'
  'int __traceiter_android_rvh_delayacct_tsk_init(void *, struct task_struct *)'
  'int __traceiter_android_vh_delayacct_add_tsk(void *, struct taskstats *, struct task_struct *, int *)'
  'int __traceiter_android_vh_delayacct_blkio_end(void *, struct task_struct *)'
  'int __traceiter_android_vh_delayacct_blkio_start(void *, void *)'
  'int __traceiter_android_vh_delayacct_blkio_ticks(void *, struct task_struct *, __u64 *)'
  'int __traceiter_android_vh_delayacct_freepages_end(void *, void *)'
  'int __traceiter_android_vh_delayacct_freepages_start(void *, void *)'
  'int __traceiter_android_vh_delayacct_thrashing_end(void *, bool *)'
  'int __traceiter_android_vh_delayacct_thrashing_start(void *, bool *)'
  'int __traceiter_android_vh_delayacct_swapin_start(void *, void *)'
  'int __traceiter_android_vh_delayacct_swapin_end(void *, void *)'
  'int __traceiter_android_vh_delayacct_compact_start(void *, void *)'
  'int __traceiter_android_vh_delayacct_compact_end(void *, void *)'
  'int __traceiter_android_vh_delayacct_wpcopy_start(void *, void *)'
  'int __traceiter_android_vh_delayacct_wpcopy_end(void *, void *)
  'void set_delayacct_enabled(bool)'

17 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_delayacct_init'
  'struct tracepoint __tracepoint_android_rvh_delayacct_tsk_free'
  'struct tracepoint __tracepoint_android_rvh_delayacct_tsk_init'
  'struct tracepoint __tracepoint_android_vh_delayacct_add_tsk'
  'struct tracepoint __tracepoint_android_vh_delayacct_blkio_end'
  'struct tracepoint __tracepoint_android_vh_delayacct_blkio_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_blkio_ticks'
  'struct tracepoint __tracepoint_android_vh_delayacct_freepages_end'
  'struct tracepoint __tracepoint_android_vh_delayacct_freepages_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_thrashing_end'
  'struct tracepoint __tracepoint_android_vh_delayacct_thrashing_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_swapin_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_swapin_end'
  'struct tracepoint __tracepoint_android_vh_delayacct_compact_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_compact_end'
  'struct tracepoint __tracepoint_android_vh_delayacct_wpcopy_start'
  'struct tracepoint __tracepoint_android_vh_delayacct_wpcopy_end'

Bug: 327566572
Bug: 310129610
Bug: 314931189
Change-Id: I82b8eb372d6a9193f70d8e2ddb1a2ef2b9b6e4e4
Signed-off-by: Dongyun Liu <dongyun.liu@transsion.com>
(cherry picked from commit 34d95b5fde142fadf010bf1156228c09ec951cce)
(cherry picked from commit ab6f88aebe)
2024-02-29 21:10:10 +00:00
Dongyun Liu
35bb2c8c5f ANDROID: Add vendor_hooks to workaround CONFIG_TASK_DELAY_ACCT
CONFIG_TASK_DELAY_ACCT cannot be enabled since `struct task_struct`
is KMI frozen. Instead, use vendor hooks to allow delay accounting
to be implemented in a vendor module.

Bug: 327566572
Bug: 310129610
Bug: 314931189

Change-Id: If814d7834889fe162aba3dd97e935289127ca3ae
Signed-off-by: Dongyun Liu <dongyun.liu@transsion.com>
(cherry picked from commit bb57557246d39dba8a66df7f43983fe1ec71bff6)
(cherry picked from commit 896cff8734)
2024-02-29 21:10:10 +00:00
Bart Van Assche
70fdaa07de Revert "ANDROID: Build null_blk and scsi_debug as kernel modules"
Revert commit 9b476ebe99 in preparation of making this a
Pixel-specific change. A disadvantage of building null_blk and
scsi_debug as kernel modules for all vendors is that this causes these
kernel modules to be loaded by the init process during boot and there is
no vendor-independent mechanism for preventing kernel modules to be
loaded.

Bug: 323406846
Change-Id: I6e7bcdd9fd06194bbc134ee52251b6ae9a3c1477
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-02-29 10:22:01 -08:00
Greg Kroah-Hartman
30edcedb44 Revert "interconnect: Fix locking for runpm vs reclaim"
This reverts commit ee42bfc791 which is
commit af42269c35 upstream.

It is reported to cause crashes, so revert it for now.

Bug: 326555421
Change-Id: I2fb3626c306e0444f4e0eb42a95488e688942ba9
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-02-29 10:43:15 +00:00
xiaofeng
4289e1348e ANDROID: GKI: Update symbol list for xiaomi
1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_update_cpus_allowed'

Bug: 323765868
Change-Id: I5c97bea49cee20e2c2b22aa4d1627bdff226ce4a
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2024-02-28 18:04:33 +00:00
Sai Harshini Nimmala
77277e4ba4 ANDROID: sched/cpuset: Add vendor hook to change tasks affinity
Vendors might want to change tasks affinity settings when they are
moving from one cpuset into the other. Add vendor hook to give control
to vendor to implement what they need.

This reverts commit a42f6e7d0aa0("Revert "ANDROID: sched/cpuset: Add
vendor hook to change tasks affinity"") to effectively bring back the
original change.

Bug: 323765868
Change-Id: I47c1ee0dabda491732932c653bd80e95ee550791
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2024-02-28 18:04:33 +00:00
lfc
18c75fa402 ANDROID: ABI: Update oplus symbol list
INFO: 1 function symbol(s) added
  'int __traceiter_android_vh_binder_buffer_release(void*, struct binder_proc*, struct binder_thread*, struct binder_buffer*, bool)'

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

Bug: 327307900

Change-Id: I6bca73bc3edb2d1deadc38daec96baa486f15929
Signed-off-by: Fuchun Liao <lfc@oppo.com>
2024-02-28 17:37:25 +00:00
Fuchun Liao
56e0cf4e39 ANDROID: binder: Add vendor hook to fix priority restore
When cpu loading is high, the task maybe preempted after restoring the
sched priority in trace_android_vh_binder_free_buf(). This means that
node->has_async_transaction can't be cleared immediately and the work
isn't added to the proc->todo queue as soon as possible.

To fix this we add a new hook trace_android_vh_binder_buffer_release()
to restore the priority after node->has_async_transaction has been
updated and the node->work has been added to the proc->todo queue.

Note: the old trace_android_vh_binder_free_buf() hook is kept to avoid
breaking KMI but is not extrictly needed.

Bug: 327307900
Fixes: 0eb66ec39ca8 ("ANDROID: vendor_hooks: Add hooks for binder")
Change-Id: I8126c79c9c68faa3ce0cd87ce83e2591bd61d5dd
Signed-off-by: Fuchun Liao <lfc@oppo.com>
[cmllamas: fix-up commit log and variable naming]
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-28 17:37:25 +00:00
Greg Kroah-Hartman
c73814520d Revert "interconnect: Teach lockdep about icc_bw_lock order"
This reverts commit 0db211ec0f which is
commit 1361917030 upstream.

It is reported to cause crashes, so revert it for now.

Bug: 326555421
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3dd7744a9b706a959cbed3a793be668147dfcb9a
2024-02-28 17:12:32 +00:00
Yan Zhai
c38ea4a131 BACKPORT: gso: fix dodgy bit handling for GSO_UDP_L4
Commit 1fd54773c2 ("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: 1fd54773c2 ("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 9840036786)
[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: f718863aca ("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: f1304d4420 ("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 e774e4eca6)
(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
a2dd0233cb ("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 ba5efd8544)
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 4fdc7e4658)
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