6.1.154-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 6.1.154-rc1 review
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.1.154-rc1
Herbert Xu <[email protected]>
crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg
David Howells <[email protected]>
crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES
Krzysztof Kozlowski <[email protected]>
ASoC: qcom: q6apm-lpass-dais: Fix NULL pointer dereference if source graph failed
Srinivas Kandagatla <[email protected]>
ASoC: q6apm-lpass-dai: close graph on prepare errors
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6apm-lpass-dai: close graphs before opening a new one
Hans de Goede <[email protected]>
net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer
Philipp Zabel <[email protected]>
net: rfkill: gpio: add DT support
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: connect: catch IO errors on listen side
Matthieu Baerts (NGI0) <[email protected]>
mptcp: propagate shutdown to subflows when possible
Mathias Nyman <[email protected]>
xhci: dbc: Fix full DbC transfer ring after several reconnects
Mathias Nyman <[email protected]>
xhci: dbc: decouple endpoint allocation from initialization
Johan Hovold <[email protected]>
phy: ti: omap-usb2: fix device leak at unbind
Rob Herring <[email protected]>
phy: Use device_get_match_data()
Krzysztof Kozlowski <[email protected]>
phy: broadcom: ns-usb3: fix Wvoid-pointer-to-enum-cast warning
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: userspace pm: validate deny-join-id0 flag
Matthieu Baerts (NGI0) <[email protected]>
mptcp: pm: nl: announce deny-join-id0 flag
Stefan Metzmacher <[email protected]>
smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
Herbert Xu <[email protected]>
crypto: af_alg - Set merge to zero early in af_alg_sendmsg
David Howells <[email protected]>
crypto: af_alg: Indent the loop in af_alg_sendmsg()
Qi Xi <[email protected]>
drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path
Loic Poulain <[email protected]>
drm: bridge: anx7625: Fix NULL pointer dereference with early IRQ
Colin Ian King <[email protected]>
ASoC: SOF: Intel: hda-stream: Fix incorrect variable used in error message
Charles Keepax <[email protected]>
ASoC: wm8974: Correct PLL rate rounding
Charles Keepax <[email protected]>
ASoC: wm8940: Correct typo in control name
Jens Axboe <[email protected]>
io_uring: include dying ring in task_work "should cancel" state
Jens Axboe <[email protected]>
io_uring: backport io_should_terminate_tw()
Praful Adiga <[email protected]>
ALSA: hda/realtek: Fix mute led for HP Laptop 15-dw4xx
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: avoid spurious errors on TCP disconnect
Håkon Bugge <[email protected]>
rds: ib: Increment i_fastreg_wrs before bailing out
Maciej S. Szmigiero <[email protected]>
KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active
Thomas Fourier <[email protected]>
mmc: mvsdio: Fix dma_unmap_sg() nents value
Mohammad Rafi Shaik <[email protected]>
ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S
Mohammad Rafi Shaik <[email protected]>
ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S interface
Qu Wenruo <[email protected]>
btrfs: tree-checker: fix the incorrect inode ref size check
Eugene Koira <[email protected]>
iommu/vt-d: Fix __domain_mapping()'s usage of switch_to_super_page()
Tao Cui <[email protected]>
LoongArch: Check the return value when creating kobj
Huacai Chen <[email protected]>
LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled
H. Nikolaus Schaller <[email protected]>
power: supply: bq27xxx: restrict no-battery detection to bq27000
H. Nikolaus Schaller <[email protected]>
power: supply: bq27xxx: fix error return in case of no bq27000 hdq battery
Nathan Chancellor <[email protected]>
nilfs2: fix CFI failure when accessing /sys/fs/nilfs2/features/*
Stefan Metzmacher <[email protected]>
ksmbd: smbdirect: verify remaining_data_length respects max_fragmented_recv_size
Namjae Jeon <[email protected]>
ksmbd: smbdirect: validate data_offset and data_length field of smb_direct_data_transfer
Duoming Zhou <[email protected]>
octeontx2-pf: Fix use-after-free bugs in otx2_sync_tstamp()
Duoming Zhou <[email protected]>
cnic: Fix use-after-free bugs in cnic_delete_task
Alexey Nepomnyashih <[email protected]>
net: liquidio: fix overflow in octeon_init_instr_queue()
Tariq Toukan <[email protected]>
Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set"
Jakub Kicinski <[email protected]>
tls: make sure to abort the stream if headers are bogus
Kuniyuki Iwashima <[email protected]>
tcp: Clear tcp_sk(sk)->fastopen_rsk in tcp_disconnect().
Hangbin Liu <[email protected]>
bonding: don't set oif to bond dev when getting NS target destination
Maciej Fijalkowski <[email protected]>
i40e: remove redundant memory barrier when cleaning Tx descs
Yeounsu Moon <[email protected]>
net: natsemi: fix rx_dropped double accounting on netif_rx() failure
Matthieu Baerts (NGI0) <[email protected]>
mptcp: set remote_deny_join_id0 on SYN recv
Jamie Bainbridge <[email protected]>
qed: Don't collect too many protection override GRC elements
Ioana Ciornei <[email protected]>
dpaa2-switch: fix buffer pool seeding for control traffic
Miaoqian Lin <[email protected]>
um: virtio_uml: Fix use-after-free after put_device in probe
Filipe Manana <[email protected]>
btrfs: fix invalid extref key setup when replaying dentry
Chen Ridong <[email protected]>
cgroup: split cgroup_destroy_wq into 3 workqueues
Geert Uytterhoeven <[email protected]>
pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch
Liao Yuanhong <[email protected]>
wifi: mac80211: fix incorrect type for ret
Lachlan Hodges <[email protected]>
wifi: mac80211: increase scan_ies_len for S1G
Takashi Sakamoto <[email protected]>
ALSA: firewire-motu: drop EPOLLOUT from poll return values as write is not supported
-------------
Diffstat:
Makefile | 4 +- arch/loongarch/include/asm/acenv.h | 7 +- arch/loongarch/kernel/env.c | 2 + arch/um/drivers/virtio_uml.c | 6 +- arch/x86/kvm/svm/svm.c | 3 +- crypto/af_alg.c | 112 ++++++++------------- drivers/gpu/drm/bridge/analogix/anx7625.c | 6 +- .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 +- drivers/iommu/intel/iommu.c | 7 +- drivers/mmc/host/mvsdio.c | 2 +- drivers/net/bonding/bond_main.c | 1 - drivers/net/ethernet/broadcom/cnic.c | 3 +- .../net/ethernet/cavium/liquidio/request_manager.c | 2 +- .../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 - .../net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 - drivers/net/ethernet/natsemi/ns83820.c | 13 ++- drivers/net/ethernet/qlogic/qed/qed_debug.c | 7 +- drivers/pcmcia/omap_cf.c | 8 +- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 9 +- drivers/phy/marvell/phy-berlin-usb.c | 7 +- drivers/phy/ralink/phy-ralink-usb.c | 10 +- drivers/phy/rockchip/phy-rockchip-pcie.c | 11 +- drivers/phy/rockchip/phy-rockchip-usb.c | 10 +- drivers/phy/ti/phy-omap-control.c | 9 +- drivers/phy/ti/phy-omap-usb2.c | 24 +++-- drivers/phy/ti/phy-ti-pipe3.c | 14 +-- drivers/power/supply/bq27xxx_battery.c | 4 +- drivers/usb/host/xhci-dbgcap.c | 94 ++++++++++++----- fs/btrfs/tree-checker.c | 4 +- fs/btrfs/tree-log.c | 2 +- fs/nilfs2/sysfs.c | 4 +- fs/nilfs2/sysfs.h | 8 +- fs/smb/client/smbdirect.c | 4 +- fs/smb/server/transport_rdma.c | 26 +++-- include/crypto/if_alg.h | 10 +- include/uapi/linux/mptcp.h | 6 +- io_uring/io_uring.c | 13 ++- io_uring/io_uring.h | 13 +++ io_uring/poll.c | 3 +- io_uring/timeout.c | 2 +- kernel/cgroup/cgroup.c | 43 ++++++-- net/ipv4/tcp.c | 5 + net/mac80211/driver-ops.h | 2 +- net/mac80211/main.c | 7 +- net/mptcp/pm_netlink.c | 7 ++ net/mptcp/protocol.c | 15 +++ net/mptcp/subflow.c | 4 + net/rds/ib_frmr.c | 20 ++-- net/rfkill/rfkill-gpio.c | 22 +++- net/tls/tls.h | 1 + net/tls/tls_strp.c | 14 ++- net/tls/tls_sw.c | 3 +- sound/firewire/motu/motu-hwdep.c | 2 +- sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/wm8940.c | 2 +- sound/soc/codecs/wm8974.c | 8 +- sound/soc/qcom/qdsp6/audioreach.c | 1 + sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 36 +++++-- sound/soc/sof/intel/hda-stream.c | 2 +- tools/testing/selftests/net/mptcp/mptcp_connect.c | 11 +- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 7 ++ tools/testing/selftests/net/mptcp/userspace_pm.sh | 14 ++- 64 files changed, 440 insertions(+), 272 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/61 ALSA: firewire-motu: drop EPOLLOUT from poll return values as write is not supported
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <[email protected]>
[ Upstream commit aea3493246c474bc917d124d6fb627663ab6bef0 ]
The ALSA HwDep character device of the firewire-motu driver incorrectly returns EPOLLOUT in poll(2), even though the driver implements no operation for write(2). This misleads userspace applications to believe write() is allowed, potentially resulting in unnecessarily wakeups.
This issue dates back to the driver's initial code added by a commit 71c3797779d3 ("ALSA: firewire-motu: add hwdep interface"), and persisted when POLLOUT was updated to EPOLLOUT by a commit a9a08845e9ac ('vfs: do bulk POLL* -> EPOLL* replacement("").').
This commit fixes the bug.
--- sound/firewire/motu/motu-hwdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/firewire/motu/motu-hwdep.c +1 -1
@@ -111,7 +111,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file, events =0 ;spin_unlock_irq (&motu->lock); -return events |EPOLLOUT ; +return events; }static int hwdep_get_info (struct snd_motu *motu,void __user *arg)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 2/61 wifi: mac80211: increase scan_ies_len for S1G
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lachlan Hodges <[email protected]>
[ Upstream commit 7e2f3213e85eba00acb4cfe6d71647892d63c3a1 ]
Currently the S1G capability element is not taken into account for the scan_ies_len, which leads to a buffer length validation failure in ieee80211_prep_hw_scan() and subsequent WARN in __ieee80211_start_scan(). This prevents hw scanning from functioning. To fix ensure we accommodate for the S1G capability length.
--- net/mac80211/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/mac80211/main.c +6 -1
@@ -945,7 +945,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)int result, i;enum nl80211_band band;int channels, max_bitrates; -bool supp_ht, supp_vht, supp_he, supp_eht; +bool supp_ht, supp_vht, supp_he, supp_eht, supp_s1g;struct cfg80211_chan_def dflt_chandef = {}; if (ieee80211_hw_check(hw, QUEUE_CONTROL) &&
@@ -1061,6 +1061,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) supp_vht = false; supp_he = false; supp_eht = false; + supp_s1g = false;for (band =0 ; band <NUM_NL80211_BANDS ; band++) {struct ieee80211_supported_band *sband;
@@ -1097,6 +1098,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) max_bitrates = sband->n_bitrates; supp_ht = supp_ht || sband->ht_cap.ht_supported; supp_vht = supp_vht || sband->vht_cap.vht_supported; + supp_s1g = supp_s1g || sband->s1g_cap.s1g;for (i =0 ; i < sband->n_iftype_data; i++) {const struct ieee80211_sband_iftype_data *iftd;
@@ -1219,6 +1221,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) local->scan_ies_len +=2 +sizeof (struct ieee80211_vht_cap ); +if (supp_s1g) + local->scan_ies_len +=2 +sizeof (struct ieee80211_s1g_cap ); +/* * HE cap element is variable in size - set len to allow max size */ if (supp_he) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 3/61 wifi: mac80211: fix incorrect type for ret
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liao Yuanhong <[email protected]>
[ Upstream commit a33b375ab5b3a9897a0ab76be8258d9f6b748628 ]
The variable ret is declared as a u32 type, but it is assigned a value of -EOPNOTSUPP. Since unsigned types cannot correctly represent negative values, the type of ret should be changed to int.
--- net/mac80211/driver-ops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/driver-ops.h +1 -1
@@ -1216,7 +1216,7 @@ drv_get_ftm_responder_stats(struct ieee80211_local *local,struct ieee80211_sub_if_data *sdata, struct cfg80211_ftm_responder_stats *ftm_stats) { - u32 ret = -EOPNOTSUPP; + int ret = -EOPNOTSUPP; if (local->ops->get_ftm_responder_stats) ret = local->ops->get_ftm_responder_stats(&local->hw,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 4/61 pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit d1dfcdd30140c031ae091868fb5bed084132bca1 ]
As described in the added code comment, a reference to .exit.text is ok for drivers registered via platform_driver_probe(). Make this explicit to prevent the following section mismatch warning
WARNING: modpost: drivers/pcmcia/omap_cf: section mismatch in reference: omap_cf_driver+0x4 (section: .data) -> omap_cf_remove (section: .exit.text)
that triggers on an omap1_defconfig + CONFIG_OMAP_CF=m build.
--- drivers/pcmcia/omap_cf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/pcmcia/omap_cf.c +7 -1
@@ -305,7 +305,13 @@ static int __exit omap_cf_remove(struct platform_device *pdev)return 0 ; } -static struct platform_driver omap_cf_driver = { +/* +* omap_cf_remove() lives in .exit.text. For drivers registered via +* platform_driver_probe() this is ok because they cannot get unbound at +* runtime. So mark the driver struct with __refdata to prevent modpost +* triggering a section mismatch warning. +*/ +static struct platform_driver omap_cf_driver__refdata = { .driver = { .name = driver_name, },
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 5/61 cgroup: split cgroup_destroy_wq into 3 workqueues
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <[email protected]>
[ Upstream commit 79f919a89c9d06816dbdbbd168fa41d27411a7f9 ]
A hung task can occur during [1] LTP cgroup testing when repeatedly mounting/unmounting perf_event and net_prio controllers with systemd.unified_cgroup_hierarchy=1. The hang manifests in cgroup_lock_and_drain_offline() during root destruction.
Related case:cgroup_fj_function_perf_event cgroup_fj_function.sh perf_event cgroup_fj_function_net_prio cgroup_fj_function.sh net_prio
Call Trace: cgroup_lock_and_drain_offline+0x14c/0x1e8 cgroup_destroy_root+0x3c/0x2c0 css_free_rwork_fn+0x248/0x338 process_one_work+0x16c/0x3b8 worker_thread+0x22c/0x3b0 kthread+0xec/0x100 ret_from_fork+0x10/0x20
Root Cause:
CPU0 CPU1
mount perf_event umount net_prio
cgroup1_get_tree cgroup_kill_sb
rebind_subsystems // root destruction enqueues
// cgroup_destroy_wq
// kill all perf_event css
// one perf_event css A is dying
// css A offline enqueues cgroup_destroy_wq
// root destruction will be executed first
css_free_rwork_fn
cgroup_destroy_root
cgroup_lock_and_drain_offline
// some perf descendants are dying
// cgroup_destroy_wq max_active = 1
// waiting for css A to dieProblem scenario:
1. CPU0 mounts perf_event (rebind_subsystems)
2. CPU1 unmounts net_prio (cgroup_kill_sb), queuing root destruction work
3. A dying perf_event CSS gets queued for offline after root destruction
4. Root destruction waits for offline completion, but offline work is blocked behind root destruction in cgroup_destroy_wq (max_active=1)
Solution:
Split cgroup_destroy_wq into three dedicated workqueues:cgroup_offline_wq – Handles CSS offline operations cgroup_release_wq – Manages resource release cgroup_free_wq – Performs final memory deallocation
This separation eliminates blocking in the CSS free path while waiting for offline operations to complete.
[1] https://github.com/linux-test-project/ltp/blob/master/runtest/controllers
--- kernel/cgroup/cgroup.c | 43 +++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-)
kernel/cgroup/cgroup.c +36 -7
@@ -123,8 +123,31 @@ DEFINE_PERCPU_RWSEM(cgroup_threadgroup_rwsem);* of concurrent destructions. Use a separate workqueue so that cgroup * destruction work items don't end up filling up max_active of system_wq * which may lead to deadlock. +* +* A cgroup destruction should enqueue work sequentially to: +* cgroup_offline_wq: use for css offline work +* cgroup_release_wq: use for css release work +* cgroup_free_wq: use for free work +* +* Rationale for using separate workqueues: +* The cgroup root free work may depend on completion of other css offline +* operations. If all tasks were enqueued to a single workqueue, this could +* create a deadlock scenario where: +* - Free work waits for other css offline work to complete. +* - But other css offline work is queued after free work in the same queue. +* +* Example deadlock scenario with single workqueue (cgroup_destroy_wq): +* 1. umount net_prio +* 2. net_prio root destruction enqueues work to cgroup_destroy_wq (CPUx) +* 3. perf_event CSS A offline enqueues work to same cgroup_destroy_wq (CPUx) +* 4. net_prio cgroup_destroy_root->cgroup_lock_and_drain_offline. +* 5. net_prio root destruction blocks waiting for perf_event CSS A offline, +* which can never complete as it's behind in the same queue and +* workqueue's max_active is 1. */ -static struct workqueue_struct *cgroup_destroy_wq; +static struct workqueue_struct *cgroup_offline_wq; +static struct workqueue_struct *cgroup_release_wq; +static struct workqueue_struct *cgroup_free_wq;/* generate an array of cgroup subsystem pointers */ #define SUBSYS (_x) [_x ## _cgrp_id] = &_x ## _cgrp_subsys,
@@ -5444,7 +5467,7 @@ static void css_release_work_fn(struct work_struct *work)cgroup_unlock ();INIT_RCU_WORK (&css->destroy_rwork, css_free_rwork_fn); -queue_rcu_work (cgroup_destroy_wq, &css->destroy_rwork); +queue_rcu_work (cgroup_free_wq, &css->destroy_rwork); }static void css_release (struct percpu_ref *ref)
@@ -5453,7 +5476,7 @@ static void css_release(struct percpu_ref *ref) container_of(ref, struct cgroup_subsys_state, refcnt);INIT_WORK (&css->destroy_work, css_release_work_fn); -queue_work (cgroup_destroy_wq, &css->destroy_work); +queue_work (cgroup_release_wq, &css->destroy_work); } static void init_and_link_css(struct cgroup_subsys_state *css,
@@ -5575,7 +5598,7 @@ static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, err_free_css:list_del_rcu (&css->rstat_css_node);INIT_RCU_WORK (&css->destroy_rwork, css_free_rwork_fn); -queue_rcu_work (cgroup_destroy_wq, &css->destroy_rwork); +queue_rcu_work (cgroup_free_wq, &css->destroy_rwork);return ERR_PTR (err); }
@@ -5811,7 +5834,7 @@ static void css_killed_ref_fn(struct percpu_ref *ref)if (atomic_dec_and_test (&css->online_cnt)) {INIT_WORK (&css->destroy_work, css_killed_work_fn); -queue_work (cgroup_destroy_wq, &css->destroy_work); +queue_work (cgroup_offline_wq, &css->destroy_work); } }
@@ -6183,8 +6206,14 @@ static int __init cgroup_wq_init(void)* We would prefer to do this in cgroup_init() above, but that * is called before init_workqueues(): so leave this until after. */ - cgroup_destroy_wq =alloc_workqueue ("cgroup_destroy" ,0 ,1 ); -BUG_ON (!cgroup_destroy_wq); + cgroup_offline_wq =alloc_workqueue ("cgroup_offline" ,0 ,1 ); +BUG_ON (!cgroup_offline_wq); + + cgroup_release_wq =alloc_workqueue ("cgroup_release" ,0 ,1 ); +BUG_ON (!cgroup_release_wq); + + cgroup_free_wq =alloc_workqueue ("cgroup_free" ,0 ,1 ); +BUG_ON (!cgroup_free_wq);return 0 ; }core_initcall (cgroup_wq_init);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 6/61 btrfs: fix invalid extref key setup when replaying dentry
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit b62fd63ade7cb573b114972ef8f9fa505be8d74a ]
The offset for an extref item's key is not the object ID of the parent dir, otherwise we would not need the extref item and would use plain ref items. Instead the offset is the result of a hash computation that uses the object ID of the parent dir and the name associated to the entry. So fix this by setting the key offset at replay_one_name() to be the result of calling btrfs_extref_hash().
--- fs/btrfs/tree-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-log.c +1 -1
@@ -1934,7 +1934,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans, search_key.objectid = log_key.objectid; search_key.type =BTRFS_INODE_EXTREF_KEY ; - search_key.offset = key->objectid; + search_key.offset =btrfs_extref_hash (key->objectid, name.name, name.len); ret =backref_in_log (root->log_root, &search_key, key->objectid, &name);if (ret <0 ) { goto out;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 7/61 um: virtio_uml: Fix use-after-free after put_device in probe
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
[ Upstream commit 7ebf70cf181651fe3f2e44e95e7e5073d594c9c0 ]
When register_virtio_device() fails in virtio_uml_probe(), the code sets vu_dev->registered = 1 even though the device was not successfully registered.
This can lead to use-after-free or other issues.
--- arch/um/drivers/virtio_uml.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/um/drivers/virtio_uml.c +4 -2
@@ -1229,10 +1229,12 @@ static int virtio_uml_probe(struct platform_device *pdev)device_set_wakeup_capable (&vu_dev->vdev.dev, true); rc =register_virtio_device (&vu_dev->vdev); -if (rc) +if (rc) {put_device (&vu_dev->vdev.dev); +return rc; + } vu_dev->registered =1 ; -return rc; +return 0 ; error_init:os_close_file (vu_dev->sock);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 8/61 dpaa2-switch: fix buffer pool seeding for control traffic
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ioana Ciornei <[email protected]>
[ Upstream commit 2690cb089502b80b905f2abdafd1bf2d54e1abef ]
Starting with commit c50e7475961c ("dpaa2-switch: Fix error checking in dpaa2_switch_seed_bp()"), the probing of a second DPSW object errors out like below.
fsl_dpaa2_switch dpsw.1: fsl_mc_driver_probe failed: -12 fsl_dpaa2_switch dpsw.1: probe with driver fsl_dpaa2_switch failed with error -12
The aforementioned commit brought to the surface the fact that seeding buffers into the buffer pool destined for control traffic is not successful and an access violation recoverable error can be seen in the MC firmware log:
[E, qbman_rec_isr:391, QBMAN] QBMAN recoverable event 0x1000000
This happens because the driver incorrectly used the ID of the DPBP object instead of the hardware buffer pool ID when trying to release buffers into it.
This is because any DPSW object uses two buffer pools, one managed by the Linux driver and destined for control traffic packet buffers and the other one managed by the MC firmware and destined only for offloaded traffic. And since the buffer pool managed by the MC firmware does not have an external facing DPBP equivalent, any subsequent DPBP objects created after the first DPSW will have a DPBP id different to the underlying hardware buffer ID.
The issue was not caught earlier because these two numbers can be identical when all DPBP objects are created before the DPSW objects are. This is the case when the DPL file is used to describe the entire DPAA2 object layout and objects are created at boot time and it's also true for the first DPSW being created dynamically using ls-addsw.
Fix this by using the buffer pool ID instead of the DPBP id when releasing buffers into the pool.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +1 -1
@@ -2680,7 +2680,7 @@ static int dpaa2_switch_setup_dpbp(struct ethsw_core *ethsw)dev_err (dev,"dpsw_ctrl_if_set_pools() failed\n" ); goto err_get_attr; } - ethsw->bpid = dpbp_attrs.id; + ethsw->bpid = dpbp_attrs.bpid;return 0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 9/61 qed: Dont collect too many protection override GRC elements
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamie Bainbridge <[email protected]>
[ Upstream commit 56c0a2a9ddc2f5b5078c5fb0f81ab76bbc3d4c37 ]
In the protection override dump path, the firmware can return far too many GRC elements, resulting in attempting to write past the end of the previously-kmalloc'ed dump buffer.
This will result in a kernel panic with reason:
BUG: unable to handle kernel paging request at ADDRESS
where "ADDRESS" is just past the end of the protection override dump buffer. The start address of the buffer is:
p_hwfn->cdev->dbg_features[DBG_FEATURE_PROTECTION_OVERRIDE].dump_buf
and the size of the buffer is buf_size in the same data structure.
The panic can be arrived at from either the qede Ethernet driver path:
[exception RIP: qed_grc_dump_addr_range+0x108]
qed_protection_override_dump at ffffffffc02662ed [qed] qed_dbg_protection_override_dump at ffffffffc0267792 [qed] qed_dbg_feature at ffffffffc026aa8f [qed] qed_dbg_all_data at ffffffffc026b211 [qed] qed_fw_fatal_reporter_dump at ffffffffc027298a [qed] devlink_health_do_dump at ffffffff82497f61 devlink_health_report at ffffffff8249cf29 qed_report_fatal_error at ffffffffc0272baf [qed] qede_sp_task at ffffffffc045ed32 [qede] process_one_work at ffffffff81d19783
or the qedf storage driver path:
[exception RIP: qed_grc_dump_addr_range+0x108]
qed_protection_override_dump at ffffffffc068b2ed [qed] qed_dbg_protection_override_dump at ffffffffc068c792 [qed] qed_dbg_feature at ffffffffc068fa8f [qed] qed_dbg_all_data at ffffffffc0690211 [qed] qed_fw_fatal_reporter_dump at ffffffffc069798a [qed] devlink_health_do_dump at ffffffff8aa95e51 devlink_health_report at ffffffff8aa9ae19 qed_report_fatal_error at ffffffffc0697baf [qed] qed_hw_err_notify at ffffffffc06d32d7 [qed] qed_spq_post at ffffffffc06b1011 [qed] qed_fcoe_destroy_conn at ffffffffc06b2e91 [qed] qedf_cleanup_fcport at ffffffffc05e7597 [qedf] qedf_rport_event_handler at ffffffffc05e7bf7 [qedf] fc_rport_work at ffffffffc02da715 [libfc] process_one_work at ffffffff8a319663
Resolve this by clamping the firmware's return value to the maximum number of legal elements the firmware should return.
--- drivers/net/ethernet/qlogic/qed/qed_debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_debug.c +4 -3
@@ -4461,10 +4461,11 @@ static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn, goto out; } -/* Add override window info to buffer */ +/* Add override window info to buffer, preventing buffer overflow */ override_window_dwords = -qed_rd (p_hwfn, p_ptt,GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW ) * -PROTECTION_OVERRIDE_ELEMENT_DWORDS ; +min (qed_rd (p_hwfn, p_ptt,GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW ) * +PROTECTION_OVERRIDE_ELEMENT_DWORDS , +PROTECTION_OVERRIDE_DEPTH_DWORDS );if (override_window_dwords) { addr =BYTES_TO_DWORDS (GRC_REG_PROTECTION_OVERRIDE_WINDOW ); offset += qed_grc_dump_addr_range(p_hwfn,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 10/61 mptcp: set remote_deny_join_id0 on SYN recv
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
[ Upstream commit 96939cec994070aa5df852c10fad5fc303a97ea3 ]
When a SYN containing the 'C' flag (deny join id0) was received, this piece of information was not propagated to the path-manager.
Even if this flag is mainly set on the server side, a client can also tell the server it cannot try to establish new subflows to the client's initial IP address and port. The server's PM should then record such info when received, and before sending events about the new connection.
--- net/mptcp/subflow.c | 4 ++++ 1 file changed, 4 insertions(+)
net/mptcp/subflow.c +4 -0
@@ -773,6 +773,10 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, goto fallback; owner =mptcp_sk (ctx->conn); + +if (mp_opt.deny_join_id0) +WRITE_ONCE (owner->pm.remote_deny_join_id0, true); +mptcp_pm_new_connection (owner, child,1 );/* with OoO packets we can reach here without ingress
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 11/61 net: natsemi: fix `rx_dropped` double accounting on `netif_rx()` failure
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yeounsu Moon <[email protected]>
[ Upstream commit 93ab4881a4e2b9657bdce4b8940073bfb4ed5eab ]
netif_rx() already increments rx_dropped core stat when it fails. The driver was also updating ndev->stats.rx_dropped in the same path. Since both are reported together via ip -s -s command, this resulted in drops being counted twice in user-visible stats.
Keep the driver update on if (unlikely(!skb)), but skip it after netif_rx() errors.
--- drivers/net/ethernet/natsemi/ns83820.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/ethernet/natsemi/ns83820.c +6 -7
@@ -820,7 +820,7 @@ static void rx_irq(struct net_device *ndev)struct ns83820 *dev =PRIV (ndev);struct rx_info *info = &dev->rx_info;unsigned next_rx; -int rx_rc, len; +int len;u32 cmdsts;__le32 *desc;unsigned long flags;
@@ -881,8 +881,10 @@ static void rx_irq(struct net_device *ndev)if (likely (CMDSTS_OK & cmdsts)) {#endif skb_put (skb, len); -if (unlikely (!skb)) +if (unlikely (!skb)) { + ndev->stats.rx_dropped++; goto netdev_mangle_me_harder_failed; + }if (cmdsts &CMDSTS_DEST_MULTI ) ndev->stats.multicast++; ndev->stats.rx_packets++;
@@ -901,15 +903,12 @@ static void rx_irq(struct net_device *ndev) __vlan_hwaccel_put_tag(skb, htons(ETH_P_IPV6), tag); }#endif - rx_rc =netif_rx (skb); -if (NET_RX_DROP == rx_rc) { -netdev_mangle_me_harder_failed: - ndev->stats.rx_dropped++; - } +netif_rx (skb); }else {dev_kfree_skb_irq (skb); } +netdev_mangle_me_harder_failed: nr++; next_rx = info->next_rx; desc = info->descs + (DESC_SIZE * next_rx);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 12/61 i40e: remove redundant memory barrier when cleaning Tx descs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <[email protected]>
[ Upstream commit e37084a26070c546ae7961ee135bbfb15fbe13fd ]
i40e has a feature which writes to memory location last descriptor successfully sent. Memory barrier in i40e_clean_tx_irq() was used to avoid forward-reading descriptor fields in case DD bit was not set. Having mentioned feature in place implies that such situation will not happen as we know in advance how many descriptors HW has dealt with.
Besides, this barrier placement was wrong. Idea is to have this protection *after* reading DD bit from HW descriptor, not before. Digging through git history showed me that indeed barrier was before DD bit check, anyways the commit introducing i40e_get_head() should have wiped it out altogether.
Also, there was one commit doing s/read_barrier_depends/smp_rmb when get head feature was already in place, but it was only theoretical based on ixgbe experiences, which is different in these terms as that driver has to read DD bit from HW descriptor.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +0 -3
@@ -949,9 +949,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,if (!eop_desc)break ; -/* prevent any other reads prior to eop_desc */ -smp_rmb (); -i40e_trace (clean_tx_irq, tx_ring, tx_desc, tx_buf);/* we have caught up to head, no work left to do */ if (tx_head == tx_desc)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 13/61 bonding: dont set oif to bond dev when getting NS target destination
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit a8ba87f04ca9cdec06776ce92dce1395026dc3bb ]
Unlike IPv4, IPv6 routing strictly requires the source address to be valid on the outgoing interface. If the NS target is set to a remote VLAN interface, and the source address is also configured on a VLAN over a bond interface, setting the oif to the bond device will fail to retrieve the correct destination route.
Fix this by not setting the oif to the bond device when retrieving the NS target destination. This allows the correct destination device (the VLAN interface) to be determined, so that bond_verify_device_path can return the proper VLAN tags for sending NS messages.
--- drivers/net/bonding/bond_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/bonding/bond_main.c +0 -1
@@ -3206,7 +3206,6 @@ static void bond_ns_send_all(struct bonding *bond, struct slave *slave)/* Find out through which dev should the packet go */ memset (&fl6,0 ,sizeof (struct flowi6 )); fl6.daddr = targets[i]; - fl6.flowi6_oif = bond->dev->ifindex; dst =ip6_route_output (dev_net (bond->dev),NULL , &fl6);if (dst->error) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 14/61 tcp: Clear tcp_sk(sk)->fastopen_rsk in tcp_disconnect().
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01 ]
syzbot reported the splat below where a socket had tcp_sk(sk)->fastopen_rsk in the TCP_ESTABLISHED state. [0]
syzbot reused the server-side TCP Fast Open socket as a new client before the TFO socket completes 3WHS:
1. accept()
2. connect(AF_UNSPEC)
3. connect() to another destination
As of accept(), sk->sk_state is TCP_SYN_RECV, and tcp_disconnect() changes it to TCP_CLOSE and makes connect() possible, which restarts timers.
Since tcp_disconnect() forgot to clear tcp_sk(sk)->fastopen_rsk, the retransmit timer triggered the warning and the intended packet was not retransmitted.
Let's call reqsk_fastopen_remove() in tcp_disconnect().
[0]:
WARNING: CPU: 2 PID: 0 at net/ipv4/tcp_timer.c:542 tcp_retransmit_timer (net/ipv4/tcp_timer.c:542 (discriminator 7)) Modules linked in: CPU: 2 UID: 0 PID: 0 Comm: swapper/2 Not tainted 6.17.0-rc5-g201825fb4278 #62 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:tcp_retransmit_timer (net/ipv4/tcp_timer.c:542 (discriminator 7)) Code: 41 55 41 54 55 53 48 8b af b8 08 00 00 48 89 fb 48 85 ed 0f 84 55 01 00 00 0f b6 47 12 3c 03 74 0c 0f b6 47 12 3c 04 74 04 90 <0f> 0b 90 48 8b 85 c0 00 00 00 48 89 ef 48 8b 40 30 e8 6a 4f 06 3e RSP: 0018:ffffc900002f8d40 EFLAGS: 00010293 RAX: 0000000000000002 RBX: ffff888106911400 RCX: 0000000000000017 RDX: 0000000002517619 RSI: ffffffff83764080 RDI: ffff888106911400 RBP: ffff888106d5c000 R08: 0000000000000001 R09: ffffc900002f8de8 R10: 00000000000000c2 R11: ffffc900002f8ff8 R12: ffff888106911540 R13: ffff888106911480 R14: ffff888106911840 R15: ffffc900002f8de0 FS: 0000000000000000(0000) GS:ffff88907b768000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8044d69d90 CR3: 0000000002c30003 CR4: 0000000000370ef0 Call Trace: <IRQ> tcp_write_timer (net/ipv4/tcp_timer.c:738) call_timer_fn (kernel/time/timer.c:1747) __run_timers (kernel/time/timer.c:1799 kernel/time/timer.c:2372) timer_expire_remote (kernel/time/timer.c:2385 kernel/time/timer.c:2376 kernel/time/timer.c:2135) tmigr_handle_remote_up (kernel/time/timer_migration.c:944 kernel/time/timer_migration.c:1035) __walk_groups.isra.0 (kernel/time/timer_migration.c:533 (discriminator 1)) tmigr_handle_remote (kernel/time/timer_migration.c:1096) handle_softirqs (./arch/x86/include/asm/jump_label.h:36 ./include/trace/events/irq.h:142 kernel/softirq.c:580) irq_exit_rcu (kernel/softirq.c:614 kernel/softirq.c:453 kernel/softirq.c:680 kernel/softirq.c:696) sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1050 (discriminator 35) arch/x86/kernel/apic/apic.c:1050 (discriminator 35)) </IRQ>
--- net/ipv4/tcp.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ipv4/tcp.c +5 -0
@@ -3130,6 +3130,7 @@ int tcp_disconnect(struct sock *sk, int flags)struct inet_connection_sock *icsk =inet_csk (sk);struct tcp_sock *tp =tcp_sk (sk);int old_state = sk->sk_state; +struct request_sock *req;u32 seq;if (old_state !=TCP_CLOSE )
@@ -3239,6 +3240,10 @@ int tcp_disconnect(struct sock *sk, int flags)/* Clean up fastopen related fields */ + req =rcu_dereference_protected (tp->fastopen_rsk, +lockdep_sock_is_held (sk)); +if (req) +reqsk_fastopen_remove (sk, req, false);tcp_free_fastopen_req (tp); inet->defer_connect =0 ; tp->fastopen_client_fail =0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 15/61 tls: make sure to abort the stream if headers are bogus
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit 0aeb54ac4cd5cf8f60131b4d9ec0b6dc9c27b20d ]
Normally we wait for the socket to buffer up the whole record before we service it. If the socket has a tiny buffer, however, we read out the data sooner, to prevent connection stalls. Make sure that we abort the connection when we find out late that the record is actually invalid. Retrying the parsing is fine in itself but since we copy some more data each time before we parse we can overflow the allocated skb space.
Constructing a scenario in which we're under pressure without enough data in the socket to parse the length upfront is quite hard. syzbot figured out a way to do this by serving us the header in small OOB sends, and then filling in the recvbuf with a large normal send.
Make sure that tls_rx_msg_size() aborts strp, if we reach an invalid record there's really no way to recover.
--- net/tls/tls.h | 1 + net/tls/tls_strp.c | 14 +++++++++----- net/tls/tls_sw.c | 3 +-- 3 files changed, 11 insertions(+), 7 deletions(-)
net/tls/tls.h +1 -0
@@ -91,6 +91,7 @@ int tls_sk_query(struct sock *sk, int optname, char __user *optval,int tls_sk_attach (struct sock *sk,int optname,char __user *optval,unsigned int optlen);void tls_err_abort (struct sock *sk,int err); +void tls_strp_abort_strp (struct tls_strparser *strp,int err);int tls_set_sw_offload (struct sock *sk,struct tls_context *ctx,int tx);void tls_update_rx_zc_capable (struct tls_context *tls_ctx);
net/tls/tls_strp.c +9 -5
@@ -12,7 +12,7 @@static struct workqueue_struct *tls_strp_wq; -static void tls_strp_abort_strp (struct tls_strparser *strp,int err) +void tls_strp_abort_strp (struct tls_strparser *strp,int err) {if (strp->stopped)return ;
@@ -210,11 +210,17 @@ static int tls_strp_copyin_frag(struct tls_strparser *strp, struct sk_buff *skb, struct sk_buff *in_skb, unsigned int offset, size_t in_len) { + unsigned int nfrag = skb->len / PAGE_SIZE;size_t len, chunk;skb_frag_t *frag;int sz; - frag = &skb_shinfo (skb)->frags[skb->len /PAGE_SIZE ]; +if (unlikely (nfrag >=skb_shinfo (skb)->nr_frags)) { +DEBUG_NET_WARN_ON_ONCE (1 ); +return -EMSGSIZE ; + } + + frag = &skb_shinfo (skb)->frags[nfrag]; len = in_len;/* First make sure we got the header */
@@ -515,10 +521,8 @@ static int tls_strp_read_sock(struct tls_strparser *strp)tls_strp_load_anchor_with_queue (strp, inq);if (!strp->stm.full_len) { sz =tls_rx_msg_size (strp, strp->anchor); -if (sz <0 ) { -tls_strp_abort_strp (strp, sz); +if (sz <0 )return sz; - } strp->stm.full_len = sz;
net/tls/tls_sw.c +1 -2
@@ -2435,8 +2435,7 @@ int tls_rx_msg_size(struct tls_strparser *strp, struct sk_buff *skb)return data_len +TLS_HEADER_SIZE ; read_failure: -tls_err_abort (strp->sk, ret); - +tls_strp_abort_strp (strp, ret);return ret; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 16/61 Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set"
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tariq Toukan <[email protected]>
[ Upstream commit 3fbfe251cc9f6d391944282cdb9bcf0bd02e01f8 ]
This reverts commit d24341740fe48add8a227a753e68b6eedf4b385a. It causes errors when trying to configure QoS, as well as loss of L2 connectivity (on multi-host devices).
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -2
@@ -107,8 +107,6 @@ void mlx5e_update_carrier(struct mlx5e_priv *priv)if (up) {netdev_info (priv->netdev,"Link up\n" );netif_carrier_on (priv->netdev); -mlx5e_port_manual_buffer_config (priv,0 , priv->netdev->mtu, -NULL ,NULL ,NULL ); }else {netdev_info (priv->netdev,"Link down\n" );netif_carrier_off (priv->netdev);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 17/61 net: liquidio: fix overflow in octeon_init_instr_queue()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Nepomnyashih <[email protected]>
[ Upstream commit cca7b1cfd7b8a0eff2a3510c5e0f10efe8fa3758 ]
The expression (conf->instr_type == 64) << iq_no can overflow because iq_no may be as high as 64 (CN23XX_MAX_RINGS_PER_PF). Casting the operand to u64 ensures correct 64-bit arithmetic.
--- drivers/net/ethernet/cavium/liquidio/request_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/liquidio/request_manager.c +1 -1
@@ -135,7 +135,7 @@ int octeon_init_instr_queue(struct octeon_device *oct, oct->io_qmask.iq |=BIT_ULL (iq_no);/* Set the 32B/64B mode for each input queue */ - oct->io_qmask.iq64B |= ((conf->instr_type ==64 ) << iq_no); + oct->io_qmask.iq64B |= ((u64)(conf->instr_type ==64 ) << iq_no); iq->iqcmd_64B = (conf->instr_type ==64 ); oct->fn_list.setup_iq_regs (oct, iq_no);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 18/61 cnic: Fix use-after-free bugs in cnic_delete_task
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duoming Zhou <[email protected]>
[ Upstream commit cfa7d9b1e3a8604afc84e9e51d789c29574fb216 ]
The original code uses cancel_delayed_work() in cnic_cm_stop_bnx2x_hw(), which does not guarantee that the delayed work item 'delete_task' has fully completed if it was already running. Additionally, the delayed work item is cyclic, the flush_workqueue() in cnic_cm_stop_bnx2x_hw() only blocks and waits for work items that were already queued to the workqueue prior to its invocation. Any work items submitted after flush_workqueue() is called are not included in the set of tasks that the flush operation awaits. This means that after the cyclic work items have finished executing, a delayed work item may still exist in the workqueue. This leads to use-after-free scenarios where the cnic_dev is deallocated by cnic_free_dev(), while delete_task remains active and attempt to dereference cnic_dev in cnic_delete_task().
A typical race condition is illustrated below:
CPU 0 (cleanup) | CPU 1 (delayed work callback)
cnic_netdev_event() |
cnic_stop_hw() | cnic_delete_task()
cnic_cm_stop_bnx2x_hw() | ...
cancel_delayed_work() | /* the queue_delayed_work()
flush_workqueue() | executes after flush_workqueue()*/
| queue_delayed_work()
cnic_free_dev(dev)//free | cnic_delete_task() //new instance
| dev = cp->dev; //useReplace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the cyclic delayed work item is properly canceled and that any ongoing execution of the work item completes before the cnic_dev is deallocated. Furthermore, since cancel_delayed_work_sync() uses __flush_work(work, true) to synchronously wait for any currently executing instance of the work item to finish, the flush_workqueue() becomes redundant and should be removed.
This bug was identified through static analysis. To reproduce the issue and validate the fix, I simulated the cnic PCI device in QEMU and introduced intentional delays — such as inserting calls to ssleep() within the cnic_delete_task() function — to increase the likelihood of triggering the bug.
--- drivers/net/ethernet/broadcom/cnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/broadcom/cnic.c +1 -2
@@ -4222,8 +4222,7 @@ static void cnic_cm_stop_bnx2x_hw(struct cnic_dev *dev)cnic_bnx2x_delete_wait (dev,0 ); -cancel_delayed_work (&cp->delete_task); -flush_workqueue (cnic_wq); +cancel_delayed_work_sync (&cp->delete_task);if (atomic_read (&cp->iscsi_conn) !=0 ) netdev_warn(dev->netdev, "%d iSCSI connections not destroyed\n",
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 19/61 octeontx2-pf: Fix use-after-free bugs in otx2_sync_tstamp()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duoming Zhou <[email protected]>
[ Upstream commit f8b4687151021db61841af983f1cb7be6915d4ef ]
The original code relies on cancel_delayed_work() in otx2_ptp_destroy(), which does not ensure that the delayed work item synctstamp_work has fully completed if it was already running. This leads to use-after-free scenarios where otx2_ptp is deallocated by otx2_ptp_destroy(), while synctstamp_work remains active and attempts to dereference otx2_ptp in otx2_sync_tstamp(). Furthermore, the synctstamp_work is cyclic, the likelihood of triggering the bug is nonnegligible.
A typical race condition is illustrated below:
CPU 0 (cleanup) | CPU 1 (delayed work callback)
otx2_remove() |
otx2_ptp_destroy() | otx2_sync_tstamp()
cancel_delayed_work() |
kfree(ptp) |
| ptp = container_of(...); //UAF
| ptp-> //UAFThis is confirmed by a KASAN report:
BUG: KASAN: slab-use-after-free in __run_timer_base.part.0+0x7d7/0x8c0 Write of size 8 at addr ffff88800aa09a18 by task bash/136 ... Call Trace: <IRQ> dump_stack_lvl+0x55/0x70 print_report+0xcf/0x610 ? __run_timer_base.part.0+0x7d7/0x8c0 kasan_report+0xb8/0xf0 ? __run_timer_base.part.0+0x7d7/0x8c0 __run_timer_base.part.0+0x7d7/0x8c0 ? __pfx___run_timer_base.part.0+0x10/0x10 ? __pfx_read_tsc+0x10/0x10 ? ktime_get+0x60/0x140 ? lapic_next_event+0x11/0x20 ? clockevents_program_event+0x1d4/0x2a0 run_timer_softirq+0xd1/0x190 handle_softirqs+0x16a/0x550 irq_exit_rcu+0xaf/0xe0 sysvec_apic_timer_interrupt+0x70/0x80 </IRQ> ... Allocated by task 1: kasan_save_stack+0x24/0x50 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x7f/0x90 otx2_ptp_init+0xb1/0x860 otx2_probe+0x4eb/0xc30 local_pci_probe+0xdc/0x190 pci_device_probe+0x2fe/0x470 really_probe+0x1ca/0x5c0 __driver_probe_device+0x248/0x310 driver_probe_device+0x44/0x120 __driver_attach+0xd2/0x310 bus_for_each_dev+0xed/0x170 bus_add_driver+0x208/0x500 driver_register+0x132/0x460 do_one_initcall+0x89/0x300 kernel_init_freeable+0x40d/0x720 kernel_init+0x1a/0x150 ret_from_fork+0x10c/0x1a0 ret_from_fork_asm+0x1a/0x30 Freed by task 136: kasan_save_stack+0x24/0x50 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3a/0x60 __kasan_slab_free+0x3f/0x50 kfree+0x137/0x370 otx2_ptp_destroy+0x38/0x80 otx2_remove+0x10d/0x4c0 pci_device_remove+0xa6/0x1d0 device_release_driver_internal+0xf8/0x210 pci_stop_bus_device+0x105/0x150 pci_stop_and_remove_bus_device_locked+0x15/0x30 remove_store+0xcc/0xe0 kernfs_fop_write_iter+0x2c3/0x440 vfs_write+0x871/0xd70 ksys_write+0xee/0x1c0 do_syscall_64+0xac/0x280 entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the delayed work item is properly canceled before the otx2_ptp is deallocated.
This bug was initially identified through static analysis. To reproduce and test it, I simulated the OcteonTX2 PCI device in QEMU and introduced artificial delays within the otx2_sync_tstamp() function to increase the likelihood of triggering the bug.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +1 -1
@@ -365,7 +365,7 @@ void otx2_ptp_destroy(struct otx2_nic *pfvf)if (!ptp)return ; -cancel_delayed_work (&pfvf->ptp->synctstamp_work); +cancel_delayed_work_sync (&pfvf->ptp->synctstamp_work);ptp_clock_unregister (ptp->ptp_clock);kfree (ptp);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 20/61 ksmbd: smbdirect: validate data_offset and data_length field of smb_direct_data_transfer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 5282491fc49d5614ac6ddcd012e5743eecb6a67c upstream.
If data_offset and data_length of smb_direct_data_transfer struct are invalid, out of bounds issue could happen.
This patch validate data_offset and data_length field in recv_done.
--- fs/smb/server/transport_rdma.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/smb/server/transport_rdma.c +9 -8
@@ -548,7 +548,7 @@ static void recv_done(struct ib_cq *cq,case SMB_DIRECT_MSG_DATA_TRANSFER : {struct smb_direct_data_transfer *data_transfer = (struct smb_direct_data_transfer *)recvmsg->packet; -unsigned int data_length; +unsigned int data_offset, data_length;int avail_recvmsg_count, receive_credits; if (wc->byte_len <
@@ -559,14 +559,15 @@ static void recv_done(struct ib_cq *cq, } data_length =le32_to_cpu (data_transfer->data_length); -if (data_length) { -if (wc->byte_len <sizeof (struct smb_direct_data_transfer ) + - (u64 )data_length) { -put_recvmsg (t, recvmsg); -smb_direct_disconnect_rdma_connection (t); -return ; - } + data_offset =le32_to_cpu (data_transfer->data_offset); +if (wc->byte_len < data_offset || + wc->byte_len < (u64 )data_offset + data_length) { +put_recvmsg (t, recvmsg); +smb_direct_disconnect_rdma_connection (t); +return ; + } +if (data_length) {if (t->full_packet_received) recvmsg->first_segment = true;
Greg Kroah-Hartman
maintainerPATCH 21/61 ksmbd: smbdirect: verify remaining_data_length respects max_fragmented_recv_size
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit e1868ba37fd27c6a68e31565402b154beaa65df0 upstream.
This is inspired by the check for data_offset + data_length.
--- fs/smb/server/transport_rdma.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/smb/server/transport_rdma.c +10 -1
@@ -548,7 +548,7 @@ static void recv_done(struct ib_cq *cq,case SMB_DIRECT_MSG_DATA_TRANSFER : {struct smb_direct_data_transfer *data_transfer = (struct smb_direct_data_transfer *)recvmsg->packet; -unsigned int data_offset, data_length; +u32 remaining_data_length, data_offset, data_length;int avail_recvmsg_count, receive_credits; if (wc->byte_len <
@@ -558,6 +558,7 @@ static void recv_done(struct ib_cq *cq,return ; } + remaining_data_length =le32_to_cpu (data_transfer->remaining_data_length); data_length =le32_to_cpu (data_transfer->data_length); data_offset =le32_to_cpu (data_transfer->data_offset); if (wc->byte_len < data_offset ||
@@ -565,6 +566,14 @@ static void recv_done(struct ib_cq *cq,put_recvmsg (t, recvmsg);smb_direct_disconnect_rdma_connection (t);return ; + } +if (remaining_data_length > t->max_fragmented_recv_size || + data_length > t->max_fragmented_recv_size || + (u64 )remaining_data_length + (u64 )data_length > + (u64 )t->max_fragmented_recv_size) { +put_recvmsg (t, recvmsg); +smb_direct_disconnect_rdma_connection (t); +return ; }if (data_length) {
Greg Kroah-Hartman
maintainerPATCH 22/61 nilfs2: fix CFI failure when accessing /sys/fs/nilfs2/features/*
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 025e87f8ea2ae3a28bf1fe2b052bfa412c27ed4a upstream.
When accessing one of the files under /sys/fs/nilfs2/features when CONFIG_CFI_CLANG is enabled, there is a CFI violation:
CFI failure at kobj_attr_show+0x59/0x80 (target: nilfs_feature_revision_show+0x0/0x30; expected type: 0xfc392c4d)
...
Call Trace: <TASK> sysfs_kf_seq_show+0x2a6/0x390 ? __cfi_kobj_attr_show+0x10/0x10 kernfs_seq_show+0x104/0x15b seq_read_iter+0x580/0xe2b ...
When the kobject of the kset for /sys/fs/nilfs2 is initialized, its ktype is set to kset_ktype, which has a ->sysfs_ops of kobj_sysfs_ops. When nilfs_feature_attr_group is added to that kobject via sysfs_create_group(), the kernfs_ops of each files is sysfs_file_kfops_rw, which will call sysfs_kf_seq_show() when ->seq_show() is called. sysfs_kf_seq_show() in turn calls kobj_attr_show() through ->sysfs_ops->show(). kobj_attr_show() casts the provided attribute out to a 'struct kobj_attribute' via container_of() and calls ->show(), resulting in the CFI violation since neither nilfs_feature_revision_show() nor nilfs_feature_README_show() match the prototype of ->show() in 'struct kobj_attribute'.
Resolve the CFI violation by adjusting the second parameter in nilfs_feature_{revision,README}_show() from 'struct attribute' to 'struct kobj_attribute' to match the expected prototype.
--- fs/nilfs2/sysfs.c | 4 ++-- fs/nilfs2/sysfs.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
fs/nilfs2/sysfs.c +2 -2
@@ -1075,7 +1075,7 @@ void nilfs_sysfs_delete_device_group(str************************************************************************/ static ssize_t nilfs_feature_revision_show (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {return sysfs_emit (buf,"%d.%d\n" ,NILFS_CURRENT_REV ,NILFS_MINOR_REV );
@@ -1087,7 +1087,7 @@ static const char features_readme_str[]"(1) revision\n\tshow current revision of NILFS file system driver.\n" ;static ssize_t nilfs_feature_README_show (struct kobject *kobj, -struct attribute *attr, +struct kobj_attribute *attr,char *buf) {return sysfs_emit (buf, features_readme_str);
fs/nilfs2/sysfs.h +4 -4
@@ -50,16 +50,16 @@ struct nilfs_sysfs_dev_subgroups {struct completion sg_segments_kobj_unregister; }; -#define NILFS_COMMON_ATTR_STRUCT (name) \ +#define NILFS_KOBJ_ATTR_STRUCT (name) \ struct nilfs_##name##_attr { \ struct attribute attr; \ - ssize_t (*show)(struct kobject *, struct attribute *, \ + ssize_t (*show)(struct kobject *, struct kobj_attribute *, \ char *); \ - ssize_t (*store)(struct kobject *, struct attribute *, \ + ssize_t (*store)(struct kobject *, struct kobj_attribute *, \ const char *, size_t); \ } -NILFS_COMMON_ATTR_STRUCT (feature); +NILFS_KOBJ_ATTR_STRUCT (feature);#define NILFS_DEV_ATTR_STRUCT (name) \ struct nilfs_##name##_attr { \
Greg Kroah-Hartman
maintainerPATCH 23/61 power: supply: bq27xxx: fix error return in case of no bq27000 hdq battery
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: H. Nikolaus Schaller <[email protected]>
commit 2c334d038466ac509468fbe06905a32d202117db upstream.
Since commit
commit f16d9fb6cf03 ("power: supply: bq27xxx: Retrieve again when busy")
the console log of some devices with hdq enabled but no bq27000 battery (like e.g. the Pandaboard) is flooded with messages like:
[ 34.247833] power_supply bq27000-battery: driver failed to report 'status' property: -1
as soon as user-space is finding a /sys entry and trying to read the "status" property.
It turns out that the offending commit changes the logic to now return the value of cache.flags if it is <0. This is likely under the assumption that it is an error number. In normal errors from bq27xxx_read() this is indeed the case.
But there is special code to detect if no bq27000 is installed or accessible through hdq/1wire and wants to report this. In that case, the cache.flags are set historically by
commit 3dd843e1c26a ("bq27000: report missing device better.")to constant -1 which did make reading properties return -ENODEV. So everything appeared to be fine before the return value was passed upwards.
Now the -1 is returned as -EPERM instead of -ENODEV, triggering the error condition in power_supply_format_property() which then floods the console log.
So we change the detection of missing bq27000 battery to simply set
cache.flags = -ENODEV
instead of -1.
--- drivers/power/supply/bq27xxx_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq27xxx_battery.c +1 -1
@@ -1873,7 +1873,7 @@ static void bq27xxx_battery_update_unloc cache.flags =bq27xxx_read (di,BQ27XXX_REG_FLAGS , has_singe_flag);if ((cache.flags &0xff ) ==0xff ) - cache.flags =-1 ;/* read error */ + cache.flags = -ENODEV ;/* read error */ if (cache.flags >=0 ) { cache.temperature =bq27xxx_battery_read_temperature (di);if (di->regs[BQ27XXX_REG_TTE ] !=INVALID_REG_ADDR )
Greg Kroah-Hartman
maintainerPATCH 24/61 power: supply: bq27xxx: restrict no-battery detection to bq27000
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: H. Nikolaus Schaller <[email protected]>
commit 1e451977e1703b6db072719b37cd1b8e250b9cc9 upstream.
There are fuel gauges in the bq27xxx series (e.g. bq27z561) which may in some cases report 0xff as the value of BQ27XXX_REG_FLAGS that should not be interpreted as "no battery" like for a disconnected battery with some built in bq27000 chip.
So restrict the no-battery detection originally introduced by
commit 3dd843e1c26a ("bq27000: report missing device better.")to the bq27000.
There is no need to backport further because this was hidden before
commit f16d9fb6cf03 ("power: supply: bq27xxx: Retrieve again when busy")
--- drivers/power/supply/bq27xxx_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/bq27xxx_battery.c +2 -2
@@ -1872,8 +1872,8 @@ static void bq27xxx_battery_update_unlocbool has_singe_flag = di->opts &BQ27XXX_O_ZERO ; cache.flags =bq27xxx_read (di,BQ27XXX_REG_FLAGS , has_singe_flag); -if ((cache.flags &0xff ) ==0xff ) - cache.flags = -ENODEV ;/* read error */ +if (di->chip ==BQ27000 && (cache.flags &0xff ) ==0xff ) + cache.flags = -ENODEV ;/* bq27000 hdq read error */ if (cache.flags >=0 ) { cache.temperature =bq27xxx_battery_read_temperature (di);if (di->regs[BQ27XXX_REG_TTE ] !=INVALID_REG_ADDR )
Greg Kroah-Hartman
maintainerPATCH 25/61 LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit a9d13433fe17be0e867e51e71a1acd2731fbef8d upstream.
ARCH_STRICT_ALIGN is used for hardware without UAL, now it only control the -mstrict-align flag. However, ACPI structures are packed by default so will cause unaligned accesses.
To avoid this, define ACPI_MISALIGNMENT_NOT_SUPPORTED in asm/acenv.h to align ACPI structures if ARCH_STRICT_ALIGN enabled.
--- arch/loongarch/include/asm/acenv.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/loongarch/include/asm/acenv.h +3 -4
@@ -10,9 +10,8 @@#ifndef _ASM_LOONGARCH_ACENV_H#define _ASM_LOONGARCH_ACENV_H -/* -* This header is required by ACPI core, but we have nothing to fill in -* right now. Will be updated later when needed. -*/ +#ifdef CONFIG_ARCH_STRICT_ALIGN +#define ACPI_MISALIGNMENT_NOT_SUPPORTED +#endif /* CONFIG_ARCH_STRICT_ALIGN */ #endif /* _ASM_LOONGARCH_ACENV_H */
Greg Kroah-Hartman
maintainerPATCH 26/61 LoongArch: Check the return value when creating kobj
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <[email protected]>
commit 51adb03e6b865c0c6790f29659ff52d56742de2e upstream.
Add a check for the return value of kobject_create_and_add(), to ensure that the kobj allocation succeeds for later use.
--- arch/loongarch/kernel/env.c | 2 ++ 1 file changed, 2 insertions(+)
arch/loongarch/kernel/env.c +2 -0
@@ -70,6 +70,8 @@ static int __init boardinfo_init(void)struct kobject *loongson_kobj; loongson_kobj =kobject_create_and_add ("loongson" , firmware_kobj); +if (!loongson_kobj) +return -ENOMEM ;return sysfs_create_file (loongson_kobj, &boardinfo_attr.attr); }
Greg Kroah-Hartman
maintainerPATCH 27/61 iommu/vt-d: Fix __domain_mapping()s usage of switch_to_super_page()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eugene Koira <[email protected]>
commit dce043c07ca1ac19cfbe2844a6dc71e35c322353 upstream.
switch_to_super_page() assumes the memory range it's working on is aligned to the target large page level. Unfortunately, __domain_mapping() doesn't take this into account when using it, and will pass unaligned ranges ultimately freeing a PTE range larger than expected.
Take for example a mapping with the following iov_pfn range [0x3fe400, 0x4c0600), which should be backed by the following mappings:
iov_pfn [0x3fe400, 0x3fffff] covered by 2MiB pages iov_pfn [0x400000, 0x4bffff] covered by 1GiB pages iov_pfn [0x4c0000, 0x4c05ff] covered by 2MiB pages
Under this circumstance, __domain_mapping() will pass [0x400000, 0x4c05ff] to switch_to_super_page() at a 1 GiB granularity, which will in turn free PTEs all the way to iov_pfn 0x4fffff.
Mitigate this by rounding down the iov_pfn range passed to switch_to_super_page() in __domain_mapping()
to the target large page level.
Additionally add range alignment checks to switch_to_super_page.
--- drivers/iommu/intel/iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +6 -1
@@ -2205,6 +2205,10 @@ static void switch_to_super_page(structstruct dma_pte *pte =NULL ;unsigned long i; +if (WARN_ON (!IS_ALIGNED (start_pfn, lvl_pages) || + !IS_ALIGNED (end_pfn +1 , lvl_pages))) +return ; +while (start_pfn <= end_pfn) {if (!pte) pte =pfn_to_dma_pte (domain, start_pfn, &level);
@@ -2272,7 +2276,8 @@ __domain_mapping(struct dmar_domain *domunsigned long pages_to_remove; pteval |=DMA_PTE_LARGE_PAGE ; - pages_to_remove = min_t(unsigned long, nr_pages, + pages_to_remove = min_t(unsigned long, +round_down (nr_pages, lvl_pages),nr_pte_to_next_page (pte) * lvl_pages); end_pfn = iov_pfn + pages_to_remove -1 ;switch_to_super_page (domain, iov_pfn, end_pfn, largepage_lvl);
Greg Kroah-Hartman
maintainerPATCH 28/61 btrfs: tree-checker: fix the incorrect inode ref size check
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit 96fa515e70f3e4b98685ef8cac9d737fc62f10e1 upstream.
[BUG]
Inside check_inode_ref(), we need to make sure every structure, including the btrfs_inode_extref header, is covered by the item. But our code is incorrectly using "sizeof(iref)", where @iref is just a pointer.
This means "sizeof(iref)" will always be "sizeof(void *)", which is much smaller than "sizeof(struct btrfs_inode_extref)".
This will allow some bad inode extrefs to sneak in, defeating tree-checker.
[FIX]
Fix the typo by calling "sizeof(*iref)", which is the same as "sizeof(struct btrfs_inode_extref)", and will be the correct behavior we want.
--- fs/btrfs/tree-checker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/tree-checker.c +2 -2
@@ -1612,10 +1612,10 @@ static int check_inode_ref(struct extentwhile (ptr < end) {u16 namelen; -if (unlikely (ptr +sizeof (iref) > end)) { +if (unlikely (ptr +sizeof (*iref) > end)) {inode_ref_err (leaf, slot,"inode ref overflow, ptr %lu end %lu inode_ref_size %zu" , - ptr, end,sizeof (iref)); + ptr, end,sizeof (*iref));return -EUCLEAN ; }
Greg Kroah-Hartman
maintainerPATCH 29/61 ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S interface
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammad Rafi Shaik <[email protected]>
commit 5f1af203ef964e7f7bf9d32716dfa5f332cc6f09 upstream.
Fix missing lpaif_type configuration for the I2S interface. The proper lpaif interface type required to allow DSP to vote appropriate clock setting for I2S interface.
Message-ID: <[email protected]>
--- sound/soc/qcom/qdsp6/audioreach.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/qcom/qdsp6/audioreach.c +1 -0
@@ -728,6 +728,7 @@ static int audioreach_i2s_set_media_form param_data->param_id =PARAM_ID_I2S_INTF_CFG ; param_data->param_size = ic_sz -APM_MODULE_PARAM_DATA_SIZE ; + intf_cfg->cfg.lpaif_type = module->hw_interface_type; intf_cfg->cfg.intf_idx = module->hw_interface_idx; intf_cfg->cfg.sd_line_idx = module->sd_line_idx;
Greg Kroah-Hartman
maintainerPATCH 30/61 ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammad Rafi Shaik <[email protected]>
commit 33b55b94bca904ca25a9585e3cd43d15f0467969 upstream.
The q6i2s_set_fmt() function was defined but never linked into the I2S DAI operations, resulting DAI format settings is being ignored during stream setup. This change fixes the issue by properly linking the .set_fmt handler within the DAI ops.
Message-ID: <[email protected]>
--- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +1 -0
@@ -204,6 +204,7 @@ static const struct snd_soc_dai_ops q6dm .shutdown = q6apm_lpass_dai_shutdown, .set_channel_map = q6dma_set_channel_map, .hw_params = q6dma_hw_params, + .set_fmt = q6i2s_set_fmt, };static const struct snd_soc_dai_ops q6i2s_ops = {
Greg Kroah-Hartman
maintainerPATCH 31/61 mmc: mvsdio: Fix dma_unmap_sg() nents value
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <[email protected]>
commit 8ab2f1c35669bff7d7ed1bb16bf5cc989b3e2e17 upstream.
The dma_unmap_sg() functions should be called with the same nents as the dma_map_sg(), not the value the map function returned.
--- drivers/mmc/host/mvsdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mvsdio.c +1 -1
@@ -292,7 +292,7 @@ static u32 mvsd_finish_data(struct mvsd_ host->pio_ptr =NULL ; host->pio_size =0 ; }else { -dma_unmap_sg (mmc_dev (host->mmc), data->sg, host->sg_frags, +dma_unmap_sg (mmc_dev (host->mmc), data->sg, data->sg_len,mmc_get_dma_dir (data)); }
Greg Kroah-Hartman
maintainerPATCH 32/61 KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej S. Szmigiero <[email protected]>
commit d02e48830e3fce9701265f6c5a58d9bdaf906a76 upstream.
Commit 3bbf3565f48c ("svm: Do not intercept CR8 when enable AVIC") inhibited pre-VMRUN sync of TPR from LAPIC into VMCB::V_TPR in sync_lapic_to_cr8() when AVIC is active.
AVIC does automatically sync between these two fields, however it does so only on explicit guest writes to one of these fields, not on a bare VMRUN.
This meant that when AVIC is enabled host changes to TPR in the LAPIC state might not get automatically copied into the V_TPR field of VMCB.
This is especially true when it is the userspace setting LAPIC state via KVM_SET_LAPIC ioctl() since userspace does not have access to the guest VMCB.
Practice shows that it is the V_TPR that is actually used by the AVIC to decide whether to issue pending interrupts to the CPU (not TPR in TASKPRI), so any leftover value in V_TPR will cause serious interrupt delivery issues in the guest when AVIC is enabled.
Fix this issue by doing pre-VMRUN TPR sync from LAPIC into VMCB::V_TPR even when AVIC is enabled.
--- arch/x86/kvm/svm/svm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/svm/svm.c +1 -2
@@ -3834,8 +3834,7 @@ static inline void sync_lapic_to_cr8(strstruct vcpu_svm *svm =to_svm (vcpu);u64 cr8; -if (nested_svm_virtualize_tpr (vcpu) || -kvm_vcpu_apicv_active (vcpu)) +if (nested_svm_virtualize_tpr (vcpu))return ; cr8 =kvm_get_cr8 (vcpu);
Greg Kroah-Hartman
maintainerPATCH 33/61 rds: ib: Increment i_fastreg_wrs before bailing out
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Håkon Bugge <[email protected]>
commit 4351ca3fcb3ffecf12631b4996bf085a2dad0db6 upstream.
We need to increment i_fastreg_wrs before we bail out from rds_ib_post_reg_frmr().
We have a fixed budget of how many FRWR operations that can be outstanding using the dedicated QP used for memory registrations and de-registrations. This budget is enforced by the atomic_t i_fastreg_wrs. If we bail out early in rds_ib_post_reg_frmr(), we will "leak" the possibility of posting an FRWR operation, and if that accumulates, no FRWR operation can be carried out.
--- net/rds/ib_frmr.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
net/rds/ib_frmr.c +12 -8
@@ -133,12 +133,15 @@ static int rds_ib_post_reg_frmr(struct r ret =ib_map_mr_sg_zbva (frmr->mr, ibmr->sg, ibmr->sg_dma_len, &off,PAGE_SIZE ); -if (unlikely (ret != ibmr->sg_dma_len)) -return ret <0 ? ret : -EINVAL ; +if (unlikely (ret != ibmr->sg_dma_len)) { + ret = ret <0 ? ret : -EINVAL ; + goto out_inc; + } -if (cmpxchg (&frmr->fr_state, -FRMR_IS_FREE ,FRMR_IS_INUSE ) !=FRMR_IS_FREE ) -return -EBUSY ; +if (cmpxchg (&frmr->fr_state,FRMR_IS_FREE ,FRMR_IS_INUSE ) !=FRMR_IS_FREE ) { + ret = -EBUSY ; + goto out_inc; + }atomic_inc (&ibmr->ic->i_fastreg_inuse_count);
@@ -166,11 +169,10 @@ static int rds_ib_post_reg_frmr(struct r/* Failure here can be because of -ENOMEM as well */ rds_transition_frwr_state (ibmr,FRMR_IS_INUSE ,FRMR_IS_STALE ); -atomic_inc (&ibmr->ic->i_fastreg_wrs);if (printk_ratelimit ())pr_warn ("RDS/IB: %s returned error(%d)\n" , __func__, ret); - goto out; + goto out_inc; }/* Wait for the registration to complete in order to prevent an invalid
@@ -179,8 +181,10 @@ static int rds_ib_post_reg_frmr(struct r*/ wait_event (frmr->fr_reg_done, !frmr->fr_reg); -out: +return ret; +out_inc: +atomic_inc (&ibmr->ic->i_fastreg_wrs);return ret; }
Greg Kroah-Hartman
maintainerPATCH 34/61 selftests: mptcp: avoid spurious errors on TCP disconnect
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit 8708c5d8b3fb3f6d5d3b9e6bfe01a505819f519a upstream.
The disconnect test-case, with 'plain' TCP sockets generates spurious errors, e.g.
07 ns1 TCP -> ns1 (dead:beef:1::1:10006) MPTCP
read: Connection reset by peer
read: Connection reset by peer
(duration 155ms) [FAIL] client exit code 3, server 3
netns ns1-FloSdv (listener) socket stat for 10006:
TcpActiveOpens 2 0.0 TcpPassiveOpens 2 0.0 TcpEstabResets 2 0.0 TcpInSegs 274 0.0 TcpOutSegs 276 0.0 TcpOutRsts 3 0.0 TcpExtPruneCalled 2 0.0 TcpExtRcvPruned 1 0.0 TcpExtTCPPureAcks 104 0.0 TcpExtTCPRcvCollapsed 2 0.0 TcpExtTCPBacklogCoalesce 42 0.0 TcpExtTCPRcvCoalesce 43 0.0 TcpExtTCPChallengeACK 1 0.0 TcpExtTCPFromZeroWindowAdv 42 0.0 TcpExtTCPToZeroWindowAdv 41 0.0 TcpExtTCPWantZeroWindowAdv 13 0.0 TcpExtTCPOrigDataSent 164 0.0 TcpExtTCPDelivered 165 0.0 TcpExtTCPRcvQDrop 1 0.0
In the failing scenarios (TCP -> MPTCP), the involved sockets are actually plain TCP ones, as fallbacks for passive sockets at 2WHS time cause the MPTCP listeners to actually create 'plain' TCP sockets.
Similar to commit 218cc166321f ("selftests: mptcp: avoid spurious errors on disconnect"), the root cause is in the user-space bits: the test program tries to disconnect as soon as all the pending data has been spooled, generating an RST. If such option reaches the peer before the connection has reached the closed status, the TCP socket will report an error to the user-space, as per protocol specification, causing the above failure. Note that it looks like this issue got more visible since the "tcp: receiver changes" series from commit 06baf9bfa6ca ("Merge branch 'tcp-receiver-changes'").
Address the issue by explicitly waiting for the TCP sockets (-t) to reach a closed status before performing the disconnect. More precisely, the test program now waits for plain TCP sockets or TCP subflows in addition to the MPTCP sockets that were already monitored.
While at it, use 'ss' with '-n' to avoid resolving service names, which is not needed here.
--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.c +2 -2
@@ -1153,7 +1153,7 @@ void xdisconnect(int fd)else xerror ("bad family" ); -strcpy (cmd,"ss -M | grep -q " ); +strcpy (cmd,"ss -Mnt | grep -q " ); cmdlen =strlen (cmd);if (!inet_ntop (addr.ss_family, raw_addr, &cmd[cmdlen],sizeof (cmd) - cmdlen))
@@ -1163,7 +1163,7 @@ void xdisconnect(int fd)/* * wait until the pending data is completely flushed and all -* the MPTCP sockets reached the closed status. +* the sockets reached the closed status. * disconnect will bypass/ignore/drop any pending data. */ for (i =0 ; ; i += msec_sleep) {
Greg Kroah-Hartman
maintainerPATCH 35/61 ALSA: hda/realtek: Fix mute led for HP Laptop 15-dw4xx
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Praful Adiga <[email protected]>
commit d33c3471047fc54966621d19329e6a23ebc8ec50 upstream.
This laptop uses the ALC236 codec with COEF 0x7 and idx 1 to control the mute LED. Enable the existing quirk for this device.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10005,6 +10005,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x103c ,0x8992 ,"HP EliteBook 845 G9" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x103c ,0x8994 ,"HP EliteBook 855 G9" ,ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x8995 ,"HP EliteBook 855 G9" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x103c ,0x89a0 ,"HP Laptop 15-dw4xxx" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ),SND_PCI_QUIRK (0x103c ,0x89a4 ,"HP ProBook 440 G9" ,ALC236_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x89a6 ,"HP ProBook 450 G9" ,ALC236_FIXUP_HP_GPIO_LED ), SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
Greg Kroah-Hartman
maintainerPATCH 36/61 io_uring: backport io_should_terminate_tw()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Parts of commit b6f58a3f4aa8dba424356c7a69388a81f4459300 upstream.
Backport io_should_terminate_tw() helper to judge whether task_work should be run or terminated.
--- io_uring/io_uring.c | 5 ++--- io_uring/io_uring.h | 13 +++++++++++++ io_uring/poll.c | 3 +-- io_uring/timeout.c | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-)
io_uring/io_uring.c +2 -3
@@ -1249,8 +1249,7 @@ static void io_req_task_cancel(struct iovoid io_req_task_submit (struct io_kiocb *req,bool *locked) {io_tw_lock (req->ctx, locked); -/* req->task == current here, checking PF_EXITING is safe */ -if (likely (!(req->task->flags &PF_EXITING ))) +if (likely (!io_should_terminate_tw ()))io_queue_sqe (req);else io_req_complete_failed (req, -EFAULT );
@@ -1773,7 +1772,7 @@ static int io_issue_sqe(struct io_kiocbint io_poll_issue (struct io_kiocb *req,bool *locked) {io_tw_lock (req->ctx, locked); -if (unlikely (req->task->flags &PF_EXITING )) +if (unlikely (io_should_terminate_tw ()))return -EFAULT ;return io_issue_sqe (req,IO_URING_F_NONBLOCK |IO_URING_F_MULTISHOT ); }
io_uring/io_uring.h +13 -0
@@ -395,6 +395,19 @@ static inline bool io_allowed_run_tw(str ctx->submitter_task == current); } +/* +* Terminate the request if either of these conditions are true: +* +* 1) It's being executed by the original task, but that task is marked +* with PF_EXITING as it's exiting. +* 2) PF_KTHREAD is set, in which case the invoker of the task_work is +* our fallback task_work. +*/ +static inline bool io_should_terminate_tw (void ) +{ +return current->flags & (PF_KTHREAD |PF_EXITING ); +} +static inline void io_req_queue_tw_complete (struct io_kiocb *req,s32 res) {io_req_set_res (req, res,0 );
io_uring/poll.c +1 -2
@@ -241,8 +241,7 @@ static int io_poll_check_events(struct istruct io_ring_ctx *ctx = req->ctx;int v; -/* req->task == current here, checking PF_EXITING is safe */ -if (unlikely (req->task->flags &PF_EXITING )) +if (unlikely (io_should_terminate_tw ()))return -ECANCELED ; do {
io_uring/timeout.c +1 -1
@@ -275,7 +275,7 @@ static void io_req_task_link_timeout(strint ret = -ENOENT ;if (prev) { -if (!(req->task->flags &PF_EXITING )) { +if (!io_should_terminate_tw ()) {struct io_cancel_data cd = { .ctx = req->ctx, .data = prev->cqe.user_data,
Greg Kroah-Hartman
maintainerPATCH 37/61 io_uring: include dying ring in task_work "should cancel" state
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 3539b1467e94336d5854ebf976d9627bfb65d6c3 upstream.
When running task_work for an exiting task, rather than perform the issue retry attempt, the task_work is canceled. However, this isn't done for a ring that has been closed. This can lead to requests being successfully completed post the ring being closed, which is somewhat confusing and surprising to an application.
Rather than just check the task exit state, also include the ring ref state in deciding whether or not to terminate a given request when run from task_work.
--- io_uring/io_uring.c | 12 ++++++++---- io_uring/io_uring.h | 4 ++-- io_uring/poll.c | 2 +- io_uring/timeout.c | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-)
io_uring/io_uring.c +8 -4
@@ -1248,8 +1248,10 @@ static void io_req_task_cancel(struct iovoid io_req_task_submit (struct io_kiocb *req,bool *locked) { -io_tw_lock (req->ctx, locked); -if (likely (!io_should_terminate_tw ())) +struct io_ring_ctx *ctx = req->ctx; + +io_tw_lock (ctx, locked); +if (likely (!io_should_terminate_tw (ctx)))io_queue_sqe (req);else io_req_complete_failed (req, -EFAULT );
@@ -1771,8 +1773,10 @@ static int io_issue_sqe(struct io_kiocbint io_poll_issue (struct io_kiocb *req,bool *locked) { -io_tw_lock (req->ctx, locked); -if (unlikely (io_should_terminate_tw ())) +struct io_ring_ctx *ctx = req->ctx; + +io_tw_lock (ctx, locked); +if (unlikely (io_should_terminate_tw (ctx)))return -EFAULT ;return io_issue_sqe (req,IO_URING_F_NONBLOCK |IO_URING_F_MULTISHOT ); }
io_uring/io_uring.h +2 -2
@@ -403,9 +403,9 @@ static inline bool io_allowed_run_tw(str* 2) PF_KTHREAD is set, in which case the invoker of the task_work is * our fallback task_work. */ -static inline bool io_should_terminate_tw (void ) +static inline bool io_should_terminate_tw (struct io_ring_ctx *ctx) { -return current->flags & (PF_KTHREAD |PF_EXITING ); +return (current->flags & (PF_KTHREAD |PF_EXITING )) ||percpu_ref_is_dying (&ctx->refs); }static inline void io_req_queue_tw_complete (struct io_kiocb *req,s32 res)
io_uring/poll.c +1 -1
@@ -241,7 +241,7 @@ static int io_poll_check_events(struct istruct io_ring_ctx *ctx = req->ctx;int v; -if (unlikely (io_should_terminate_tw ())) +if (unlikely (io_should_terminate_tw (ctx)))return -ECANCELED ; do {
io_uring/timeout.c +1 -1
@@ -275,7 +275,7 @@ static void io_req_task_link_timeout(strint ret = -ENOENT ;if (prev) { -if (!io_should_terminate_tw ()) { +if (!io_should_terminate_tw (req->ctx)) {struct io_cancel_data cd = { .ctx = req->ctx, .data = prev->cqe.user_data,
Greg Kroah-Hartman
maintainerPATCH 38/61 ASoC: wm8940: Correct typo in control name
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit b4799520dcd6fe1e14495cecbbe9975d847cd482 ]
--- sound/soc/codecs/wm8940.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8940.c +1 -1
@@ -218,7 +218,7 @@ static const struct snd_kcontrol_new wm8940_snd_controls[] = {SOC_SINGLE_TLV ("Digital Capture Volume" ,WM8940_ADCVOL ,0 ,255 ,0 , wm8940_adc_tlv),SOC_ENUM ("Mic Bias Level" , wm8940_mic_bias_level_enum), -SOC_SINGLE_TLV ("Capture Boost Volue" ,WM8940_ADCBOOST , +SOC_SINGLE_TLV ("Capture Boost Volume" ,WM8940_ADCBOOST ,8 ,1 ,0 , wm8940_capture_boost_vol_tlv),SOC_SINGLE_TLV ("Speaker Playback Volume" ,WM8940_SPKVOL , 0, 63, 0, wm8940_spk_vol_tlv),
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 39/61 ASoC: wm8974: Correct PLL rate rounding
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit 9b17d3724df55ecc2bc67978822585f2b023be48 ]
Using a single value of 22500000 for both 48000Hz and 44100Hz audio will sometimes result in returning wrong dividers due to rounding. Update the code to use the actual value for both.
--- sound/soc/codecs/wm8974.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8974.c +6 -2
@@ -419,10 +419,14 @@ static int wm8974_update_clocks(struct snd_soc_dai *dai) fs256 =256 * priv->fs; f =wm8974_get_mclkdiv (priv->mclk, fs256, &mclkdiv); -if (f != priv->mclk) {/* The PLL performs best around 90MHz */ - fpll =wm8974_get_mclkdiv (22500000 , fs256, &mclkdiv); +if (fs256 %8000 ) + f =22579200 ; +else + f =24576000 ; + + fpll =wm8974_get_mclkdiv (f, fs256, &mclkdiv); }wm8974_set_dai_pll (dai,0 ,0 , priv->mclk, fpll);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 40/61 ASoC: SOF: Intel: hda-stream: Fix incorrect variable used in error message
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
[ Upstream commit 35fc531a59694f24a2456569cf7d1a9c6436841c ]
The dev_err message is reporting an error about capture streams however it is using the incorrect variable num_playback instead of num_capture. Fix this by using the correct variable num_capture.
--- sound/soc/sof/intel/hda-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/intel/hda-stream.c +1 -1
@@ -837,7 +837,7 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)if (num_capture >=SOF_HDA_CAPTURE_STREAMS ) {dev_err (sdev->dev,"error: too many capture streams %d\n" , - num_playback); + num_capture);return -EINVAL ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 41/61 drm: bridge: anx7625: Fix NULL pointer dereference with early IRQ
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <[email protected]>
[ Upstream commit a10f910c77f280327b481e77eab909934ec508f0 ]
If the interrupt occurs before resource initialization is complete, the interrupt handler/worker may access uninitialized data such as the I2C tcpc_client device, potentially leading to NULL pointer dereference.
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +4 -2
@@ -2697,7 +2697,7 @@ static int anx7625_i2c_probe(struct i2c_client *client) ret =devm_request_threaded_irq (dev, platform->pdata.intp_irq,NULL , anx7625_intr_hpd_isr,IRQF_TRIGGER_FALLING | -IRQF_ONESHOT , +IRQF_ONESHOT |IRQF_NO_AUTOEN ,"anx7625-intp" , platform);if (ret) {DRM_DEV_ERROR (dev,"fail to request irq\n" );
@@ -2767,8 +2767,10 @@ static int anx7625_i2c_probe(struct i2c_client *client) }/* Add work function */ -if (platform->pdata.intp_irq) +if (platform->pdata.intp_irq) { +enable_irq (platform->pdata.intp_irq);queue_work (platform->workqueue, &platform->work); + }if (platform->pdata.audio_en)anx7625_register_audio (dev, platform);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 42/61 drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qi Xi <[email protected]>
[ Upstream commit 288dac9fb6084330d968459c750c838fd06e10e6 ]
Add missing mutex unlock before returning from the error path in cdns_mhdp_atomic_enable().
--- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +4 -2
@@ -2042,8 +2042,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge, mhdp_state =to_cdns_mhdp_bridge_state (new_state); mhdp_state->current_mode =drm_mode_duplicate (bridge->dev, mode); -if (!mhdp_state->current_mode) -return ; +if (!mhdp_state->current_mode) { + ret = -EINVAL ; + goto out; + }drm_mode_set_name (mhdp_state->current_mode);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 43/61 crypto: af_alg: Indent the loop in af_alg_sendmsg()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 73d7409cfdad7fd08a9203eb2912c1c77e527776 ]
Put the loop in af_alg_sendmsg() into an if-statement to indent it to make the next patch easier to review as that will add another branch to handle MSG_SPLICE_PAGES to the if-statement.
Stable-dep-of: 9574b2330dbd ("crypto: af_alg - Set merge to zero early in af_alg_sendmsg")
--- crypto/af_alg.c | 51 ++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 24 deletions(-)
crypto/af_alg.c +27 -24
@@ -927,35 +927,38 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,if (sgl->cur)sg_unmark_end (sg + sgl->cur -1 ); -do { -struct page *pg; -unsigned int i = sgl->cur; +if (1 /* TODO check MSG_SPLICE_PAGES */ ) { +do { +struct page *pg; +unsigned int i = sgl->cur; - plen =min_t (size_t, len,PAGE_SIZE ); + plen =min_t (size_t, len,PAGE_SIZE ); - pg =alloc_page (GFP_KERNEL ); -if (!pg) { - err = -ENOMEM ; - goto unlock; - } + pg =alloc_page (GFP_KERNEL ); +if (!pg) { + err = -ENOMEM ; + goto unlock; + } -sg_assign_page (sg + i, pg); +sg_assign_page (sg + i, pg); - err =memcpy_from_msg (page_address (sg_page (sg + i)), - msg, plen); -if (err) { -__free_page (sg_page (sg + i)); -sg_assign_page (sg + i,NULL ); - goto unlock; - } + err =memcpy_from_msg ( +page_address (sg_page (sg + i)), + msg, plen); +if (err) { +__free_page (sg_page (sg + i)); +sg_assign_page (sg + i,NULL ); + goto unlock; + } - sg[i].length = plen; - len -= plen; - ctx->used += plen; - copied += plen; - size -= plen; - sgl->cur++; - }while (len && sgl->cur <MAX_SGL_ENTS ); + sg[i].length = plen; + len -= plen; + ctx->used += plen; + copied += plen; + size -= plen; + sgl->cur++; + }while (len && sgl->cur <MAX_SGL_ENTS ); + }if (!size)sg_mark_end (sg + sgl->cur -1 );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 44/61 crypto: af_alg - Set merge to zero early in af_alg_sendmsg
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 9574b2330dbd2b5459b74d3b5e9619d39299fc6f ]
If an error causes af_alg_sendmsg to abort, ctx->merge may contain a garbage value from the previous loop. This may then trigger a crash on the next entry into af_alg_sendmsg when it attempts to do a merge that can't be done.
Fix this by setting ctx->merge to zero near the start of the loop.
--- crypto/af_alg.c | 2 ++ 1 file changed, 2 insertions(+)
crypto/af_alg.c +2 -0
@@ -908,6 +908,8 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,continue ; } + ctx->merge =0 ; +if (!af_alg_writable (sk)) { err =af_alg_wait_for_wmem (sk, msg->msg_flags);if (err)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 45/61 smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
[ Upstream commit daac51c7032036a0ca5f1aa419ad1b0471d1c6e0 ]
During tests of another unrelated patch I was able to trigger this
error: Objects remaining on __kmem_cache_shutdown()
--- fs/smb/client/smbdirect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/smb/client/smbdirect.c +3 -1
@@ -1084,8 +1084,10 @@ static int smbd_negotiate(struct smbd_connection *info)log_rdma_event (INFO ,"smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n" , rc, response->sge.addr, response->sge.length, response->sge.lkey); -if (rc) +if (rc) { +put_receive_buffer (info, response);return rc; + }init_completion (&info->negotiate_completion); info->negotiate_done = false;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 46/61 mptcp: pm: nl: announce deny-join-id0 flag
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit 2293c57484ae64c9a3c847c8807db8c26a3a4d41 upstream.
During the connection establishment, a peer can tell the other one that it cannot establish new subflows to the initial IP address and port by setting the 'C' flag [1]. Doing so makes sense when the sender is behind a strict NAT, operating behind a legacy Layer 4 load balancer, or using anycast IP address for example.
When this 'C' flag is set, the path-managers must then not try to establish new subflows to the other peer's initial IP address and port. The in-kernel PM has access to this info, but the userspace PM didn't.
The RFC8684 [1] is strict about that:
(...) therefore the receiver MUST NOT try to open any additional subflows toward this address and port.
So it is important to tell the userspace about that as it is responsible for the respect of this flag.
When a new connection is created and established, the Netlink events now contain the existing but not currently used 'flags' attribute. When MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 is set, it means no other subflows to the initial IP address and port -- info that are also part of the event -- can be established.
[ Conflicts in mptcp_pm.yaml, and mptcp_pm.h, because these files have
been added later by commit bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp"), and commit 9d1ed17f93ce ("uapi: mptcp: use header file generated from YAML spec"), which are not in this version. Applying the same modifications, but only in mptcp.h. Conflict in pm_netlink.c, because of a difference in the context, introduced by commit b9f4554356f6 ("mptcp: annotate lockless access for token"), which is not in this version. ]
--- include/uapi/linux/mptcp.h | 6 ++++-- net/mptcp/pm_netlink.c | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
include/uapi/linux/mptcp.h +4 -2
@@ -81,6 +81,8 @@ enum {#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1) +#define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0) +#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
@@ -127,13 +129,13 @@ struct mptcp_info {/* * MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6, -* sport, dport +* sport, dport, server-side, [flags] * A new MPTCP connection has been created. It is the good time to allocate * memory and send ADD_ADDR if needed. Depending on the traffic-patterns * it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent. * * MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6, -* sport, dport +* sport, dport, server-side, [flags] * A MPTCP connection is established (can start new subflows). * * MPTCP_EVENT_CLOSED: token
net/mptcp/pm_netlink.c +7 -0
@@ -2242,6 +2242,7 @@ static int mptcp_event_created(struct sk const struct sock *ssk) {int err =nla_put_u32 (skb,MPTCP_ATTR_TOKEN , msk->token); +u16 flags =0 ;if (err)return err;
@@ -2249,6 +2250,12 @@ static int mptcp_event_created(struct skif (nla_put_u8 (skb,MPTCP_ATTR_SERVER_SIDE ,READ_ONCE (msk->pm.server_side)))return -EMSGSIZE ; +if (READ_ONCE (msk->pm.remote_deny_join_id0)) + flags |=MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 ; + +if (flags &&nla_put_u16 (skb,MPTCP_ATTR_FLAGS , flags)) +return -EMSGSIZE ; +return mptcp_event_add_subflow (skb, ssk); }
Greg Kroah-Hartman
maintainerPATCH 47/61 selftests: mptcp: userspace pm: validate deny-join-id0 flag
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit 24733e193a0d68f20d220e86da0362460c9aa812 upstream.
The previous commit adds the MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 flag. Make sure it is correctly announced by the other peer when it has been received.
pm_nl_ctl will now display 'deny_join_id0:1' when monitoring the events, and when this flag was set by the other peer.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID.
[ Conflict in userspace_pm.sh, because of a difference in the context,
introduced by commit c66fb480a330 ("selftests: userspace pm: avoid relaunching pm events"), which is not in this version. The same lines can still be added at the same place.
Conflicts in userspace_pm.sh, because of different refactoring, like with commit ae1fa39da991 ("selftests: mptcp: add evts_get_info helper"), and commit e198ad759273 ("selftests: mptcp: userspace_pm:
uniform results printing"). The modifications have been adapted to the old version, without the new helpers. ]
--- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 7 +++++++ tools/testing/selftests/net/mptcp/userspace_pm.sh | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c +7 -0
@@ -188,6 +188,13 @@ static int capture_events(int fd, int evfprintf (stderr,",error:%u" , *(__u8 *)RTA_DATA (attrs)); else if (attrs->rta_type == MPTCP_ATTR_SERVER_SIDE) fprintf(stderr, ",server_side:%u", *(__u8 *)RTA_DATA(attrs)); + else if (attrs->rta_type == MPTCP_ATTR_FLAGS) { +__u16 flags = *(__u16 *)RTA_DATA (attrs); + +/* only print when present, easier */ +if (flags &MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 ) +fprintf (stderr,",deny_join_id0:1" ); + } attrs =RTA_NEXT (attrs, msg_len); }
tools/testing/selftests/net/mptcp/userspace_pm.sh +12 -2
@@ -139,6 +139,9 @@ make_connection() is_v6="v4" fi + # set this on the client side only: will not affect the rest + ip netns exec "$ns2" sysctl -q net.mptcp.allow_join_initial_addr_port=0 + # Capture netlink events over the two network namespaces running # the MPTCP client and server local client_evts
@@ -173,21 +176,28 @@ make_connection() local client_token local client_port local client_serverside + local client_nojoin local server_token local server_serverside + local server_nojoin client_token=$(sed --unbuffered -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") client_port=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") client_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\ "$client_evts") + client_nojoin=$(sed --unbuffered -n 's/.*\(deny_join_id0:\)\([[:digit:]]*\).*$/\2/p;q'\ + "$client_evts") kill_wait $server_evts_pid server_token=$(sed --unbuffered -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts") server_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\ "$server_evts") + server_nojoin=$(sed --unbuffered -n 's/.*\(deny_join_id0:\)\([[:digit:]]*\).*$/\2/p;q'\ + "$server_evts") rm -f "$client_evts" "$server_evts" "$file" - if [ "$client_token" != "" ] && [ "$server_token" != "" ] && [ "$client_serverside" = 0 ] && - [ "$server_serverside" = 1 ] + if [ "${client_token}" != "" ] && [ "${server_token}" != "" ] && + [ "${client_serverside}" = 0 ] && [ "${server_serverside}" = 1 ] && + [ "${client_nojoin:-0}" = 0 ] && [ "${server_nojoin:-0}" = 1 ] then stdbuf -o0 -e0 printf "Established IP%s MPTCP Connection ns2 => ns1 \t\t[OK]\n" $is_v6 else
Greg Kroah-Hartman
maintainerPATCH 48/61 phy: broadcom: ns-usb3: fix Wvoid-pointer-to-enum-cast warning
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit bd6e74a2f0a0c76dda8e44d26f9b91a797586c3b ]
'family' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes:
drivers/phy/broadcom/phy-bcm-ns-usb3.c:209:17: error: cast to smaller integer type 'enum bcm_ns_family' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
Stable-dep-of: 64961557efa1 ("phy: ti: omap-usb2: fix device leak at unbind")
--- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/broadcom/phy-bcm-ns-usb3.c +1 -1
@@ -206,7 +206,7 @@ static int bcm_ns_usb3_mdio_probe(struct of_id =of_match_device (bcm_ns_usb3_id_table, dev);if (!of_id)return -EINVAL ; - usb3->family = (enum bcm_ns_family )of_id->data; + usb3->family = (uintptr_t )of_id->data; syscon_np =of_parse_phandle (dev->of_node,"usb3-dmp-syscon" ,0 ); err =of_address_to_resource (syscon_np,0 , &res);
Greg Kroah-Hartman
maintainerPATCH 49/61 phy: Use device_get_match_data()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
[ Upstream commit 21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3 ]
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers.
Stable-dep-of: 64961557efa1 ("phy: ti: omap-usb2: fix device leak at unbind")
--- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 9 +++------ drivers/phy/marvell/phy-berlin-usb.c | 7 +++---- drivers/phy/ralink/phy-ralink-usb.c | 10 +++------- drivers/phy/rockchip/phy-rockchip-pcie.c | 11 ++++------- drivers/phy/rockchip/phy-rockchip-usb.c | 10 +++------- drivers/phy/ti/phy-omap-control.c | 9 ++------- drivers/phy/ti/phy-omap-usb2.c | 11 ++++------- drivers/phy/ti/phy-ti-pipe3.c | 14 ++++---------- 8 files changed, 26 insertions(+), 55 deletions(-)
drivers/phy/broadcom/phy-bcm-ns-usb3.c +3 -6
@@ -16,10 +16,11 @@#include <linux/iopoll.h> #include <linux/mdio.h> #include <linux/module.h> +#include <linux/of.h> #include <linux/of_address.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/phy/phy.h> +#include <linux/property.h> #include <linux/slab.h> #define BCM_NS_USB3_PHY_BASE_ADDR_REG 0x1f
@@ -189,7 +190,6 @@ static int bcm_ns_usb3_mdio_phy_write(ststatic int bcm_ns_usb3_mdio_probe (struct mdio_device *mdiodev) {struct device *dev = &mdiodev->dev; -const struct of_device_id *of_id;struct phy_provider *phy_provider;struct device_node *syscon_np;struct bcm_ns_usb3 *usb3;
@@ -203,10 +203,7 @@ static int bcm_ns_usb3_mdio_probe(struct usb3->dev = dev; usb3->mdiodev = mdiodev; - of_id =of_match_device (bcm_ns_usb3_id_table, dev); -if (!of_id) -return -EINVAL ; - usb3->family = (uintptr_t )of_id->data; + usb3->family = (enum bcm_ns_family )device_get_match_data (dev); syscon_np =of_parse_phandle (dev->of_node,"usb3-dmp-syscon" ,0 ); err =of_address_to_resource (syscon_np,0 , &res);
drivers/phy/marvell/phy-berlin-usb.c +3 -4
@@ -8,9 +8,10 @@#include <linux/io.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/reset.h> #define USB_PHY_PLL 0x04
@@ -162,8 +163,6 @@ MODULE_DEVICE_TABLE(of, phy_berlin_usb_ostatic int phy_berlin_usb_probe (struct platform_device *pdev) { -const struct of_device_id *match = -of_match_device (phy_berlin_usb_of_match, &pdev->dev);struct phy_berlin_usb_priv *priv;struct phy *phy;struct phy_provider *phy_provider;
@@ -180,7 +179,7 @@ static int phy_berlin_usb_probe(struct pif (IS_ERR (priv->rst_ctrl))return PTR_ERR (priv->rst_ctrl); - priv->pll_divider = *((u32 *)match->data); + priv->pll_divider = *((u32 *)device_get_match_data (&pdev->dev)); phy =devm_phy_create (&pdev->dev,NULL , &phy_berlin_usb_ops);if (IS_ERR (phy)) {
drivers/phy/ralink/phy-ralink-usb.c +3 -7
@@ -13,9 +13,10 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/mutex.h> -#include <linux/of_platform.h> +#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h>
@@ -171,18 +172,13 @@ static int ralink_usb_phy_probe(struct p {struct device *dev = &pdev->dev;struct phy_provider *phy_provider; -const struct of_device_id *match;struct ralink_usb_phy *phy; - match =of_match_device (ralink_usb_phy_of_match, &pdev->dev); -if (!match) -return -ENODEV ; - phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL );if (!phy)return -ENOMEM ; - phy->clk = (uintptr_t )match->data; + phy->clk = (uintptr_t )device_get_match_data (&pdev->dev); phy->base =NULL ; phy->sysctl =syscon_regmap_lookup_by_phandle (dev->of_node,"ralink,sysctl" );
drivers/phy/rockchip/phy-rockchip-pcie.c +4 -7
@@ -12,10 +12,9 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h>
@@ -63,7 +62,7 @@ struct rockchip_pcie_data { };struct rockchip_pcie_phy { -struct rockchip_pcie_data *phy_data; +const struct rockchip_pcie_data *phy_data;struct regmap *reg_base;struct phy_pcie_instance {struct phy *phy;
@@ -365,7 +364,6 @@ static int rockchip_pcie_phy_probe(strucstruct rockchip_pcie_phy *rk_phy;struct phy_provider *phy_provider;struct regmap *grf; -const struct of_device_id *of_id;int i;u32 phy_num;
@@ -379,11 +377,10 @@ static int rockchip_pcie_phy_probe(strucif (!rk_phy)return -ENOMEM ; - of_id =of_match_device (rockchip_pcie_phy_dt_ids, &pdev->dev); -if (!of_id) + rk_phy->phy_data =device_get_match_data (&pdev->dev); +if (!rk_phy->phy_data)return -EINVAL ; - rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data; rk_phy->reg_base = grf;mutex_init (&rk_phy->pcie_mutex);
drivers/phy/rockchip/phy-rockchip-usb.c +3 -7
@@ -13,10 +13,9 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/regmap.h>
@@ -458,7 +457,6 @@ static int rockchip_usb_phy_probe(structstruct device *dev = &pdev->dev;struct rockchip_usb_phy_base *phy_base;struct phy_provider *phy_provider; -const struct of_device_id *match;struct device_node *child;int err;
@@ -466,14 +464,12 @@ static int rockchip_usb_phy_probe(structif (!phy_base)return -ENOMEM ; - match =of_match_device (dev->driver->of_match_table, dev); -if (!match || !match->data) { + phy_base->pdata =device_get_match_data (dev); +if (!phy_base->pdata) {dev_err (dev,"missing phy data\n" );return -EINVAL ; } - phy_base->pdata = match->data; - phy_base->dev = dev; phy_base->reg_base =ERR_PTR (-ENODEV );if (dev->parent && dev->parent->of_node)
drivers/phy/ti/phy-omap-control.c +2 -7
@@ -8,9 +8,9 @@#include <linux/module.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/err.h> #include <linux/io.h> #include <linux/clk.h>
@@ -268,20 +268,15 @@ MODULE_DEVICE_TABLE(of, omap_control_phystatic int omap_control_phy_probe (struct platform_device *pdev) { -const struct of_device_id *of_id;struct omap_control_phy *control_phy; - of_id =of_match_device (omap_control_phy_id_table, &pdev->dev); -if (!of_id) -return -EINVAL ; - control_phy =devm_kzalloc (&pdev->dev,sizeof (*control_phy),GFP_KERNEL );if (!control_phy)return -ENOMEM ; control_phy->dev = &pdev->dev; - control_phy->type = *(enum omap_control_phy_type *)of_id->data; + control_phy->type = *(enum omap_control_phy_type *)device_get_match_data (&pdev->dev);if (control_phy->type ==OMAP_CTRL_TYPE_OTGHS ) { control_phy->otghs_control =
drivers/phy/ti/phy-omap-usb2.c +4 -7
@@ -19,6 +19,7 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/slab.h> #include <linux/sys_soc.h>
@@ -371,16 +372,12 @@ static int omap_usb2_probe(struct platfostruct device_node *node = pdev->dev.of_node;struct device_node *control_node;struct platform_device *control_pdev; -const struct of_device_id *of_id; -struct usb_phy_data *phy_data; +const struct usb_phy_data *phy_data; - of_id =of_match_device (omap_usb2_id_table, &pdev->dev); - -if (!of_id) + phy_data =device_get_match_data (&pdev->dev); +if (!phy_data)return -EINVAL ; - phy_data = (struct usb_phy_data *)of_id->data; - phy =devm_kzalloc (&pdev->dev,sizeof (*phy),GFP_KERNEL );if (!phy)return -ENOMEM ;
drivers/phy/ti/phy-ti-pipe3.c +4 -10
@@ -8,6 +8,7 @@#include <linux/module.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/phy/phy.h> #include <linux/of.h>
@@ -791,23 +792,16 @@ static int ti_pipe3_probe(struct platforstruct phy_provider *phy_provider;struct device *dev = &pdev->dev;int ret; -const struct of_device_id *match; -struct pipe3_data *data; +const struct pipe3_data *data; phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL );if (!phy)return -ENOMEM ; - match =of_match_device (ti_pipe3_id_table, dev); -if (!match) + data =device_get_match_data (dev); +if (!data)return -EINVAL ; - data = (struct pipe3_data *)match->data; -if (!data) { -dev_err (dev,"no driver data\n" ); -return -EINVAL ; - } - phy->dev = dev; phy->mode = data->mode; phy->dpll_map = data->dpll_map;
Greg Kroah-Hartman
maintainerPATCH 50/61 phy: ti: omap-usb2: fix device leak at unbind
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 64961557efa1b98f375c0579779e7eeda1a02c42 ]
Make sure to drop the reference to the control device taken by of_find_device_by_node() during probe when the driver is unbound.
--- drivers/phy/ti/phy-omap-usb2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/phy/ti/phy-omap-usb2.c +13 -0
@@ -363,6 +363,13 @@ static void omap_usb2_init_errata(struct phy->flags |=OMAP_USB2_DISABLE_CHRG_DET ; } +static void omap_usb2_put_device (void *_dev) +{ +struct device *dev = _dev; + +put_device (dev); +} +static int omap_usb2_probe (struct platform_device *pdev) {struct omap_usb *phy;
@@ -373,6 +380,7 @@ static int omap_usb2_probe(struct platfostruct device_node *control_node;struct platform_device *control_pdev;const struct usb_phy_data *phy_data; +int ret; phy_data =device_get_match_data (&pdev->dev);if (!phy_data)
@@ -423,6 +431,11 @@ static int omap_usb2_probe(struct platforeturn -EINVAL ; } phy->control_dev = &control_pdev->dev; + + ret =devm_add_action_or_reset (&pdev->dev, omap_usb2_put_device, + phy->control_dev); +if (ret) +return ret; }else { if (of_property_read_u32_index(node, "syscon-phy-power", 1,
Greg Kroah-Hartman
maintainerPATCH 51/61 xhci: dbc: decouple endpoint allocation from initialization
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
[ Upstream commit 220a0ffde02f962c13bc752b01aa570b8c65a37b ]
Decouple allocation of endpoint ring buffer from initialization of the buffer, and initialization of endpoint context parts from from the rest of the contexts.
It allows driver to clear up and reinitialize endpoint rings after disconnect without reallocating everything.
This is a prerequisite for the next patch that prevents the transfer ring from filling up with cancelled (no-op) TRBs if a debug cable is reconnected several times without transferring anything.
--- drivers/usb/host/xhci-dbgcap.c | 71 ++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 25 deletions(-)
drivers/usb/host/xhci-dbgcap.c +46 -25
@@ -86,13 +86,34 @@ static u32 xhci_dbc_populate_strings(strreturn string_length; } +static void xhci_dbc_init_ep_contexts (struct xhci_dbc *dbc) +{ +struct xhci_ep_ctx *ep_ctx; +unsigned int max_burst; +dma_addr_t deq; + + max_burst =DBC_CTRL_MAXBURST (readl (&dbc->regs->control)); + +/* Populate bulk out endpoint context: */ + ep_ctx =dbc_bulkout_ctx (dbc); + deq =dbc_bulkout_enq (dbc); + ep_ctx->ep_info =0 ; + ep_ctx->ep_info2 =dbc_epctx_info2 (BULK_OUT_EP ,1024 , max_burst); + ep_ctx->deq =cpu_to_le64 (deq | dbc->ring_out->cycle_state); + +/* Populate bulk in endpoint context: */ + ep_ctx =dbc_bulkin_ctx (dbc); + deq =dbc_bulkin_enq (dbc); + ep_ctx->ep_info =0 ; + ep_ctx->ep_info2 =dbc_epctx_info2 (BULK_IN_EP ,1024 , max_burst); + ep_ctx->deq =cpu_to_le64 (deq | dbc->ring_in->cycle_state); +} +static void xhci_dbc_init_contexts (struct xhci_dbc *dbc,u32 string_length) {struct dbc_info_context *info; -struct xhci_ep_ctx *ep_ctx;u32 dev_info; -dma_addr_t deq, dma; -unsigned int max_burst; +dma_addr_t dma;if (!dbc)return ;
@@ -106,20 +127,8 @@ static void xhci_dbc_init_contexts(struc info->serial =cpu_to_le64 (dma +DBC_MAX_STRING_LENGTH *3 ); info->length =cpu_to_le32 (string_length); -/* Populate bulk out endpoint context: */ - ep_ctx =dbc_bulkout_ctx (dbc); - max_burst =DBC_CTRL_MAXBURST (readl (&dbc->regs->control)); - deq =dbc_bulkout_enq (dbc); - ep_ctx->ep_info =0 ; - ep_ctx->ep_info2 =dbc_epctx_info2 (BULK_OUT_EP ,1024 , max_burst); - ep_ctx->deq =cpu_to_le64 (deq | dbc->ring_out->cycle_state); - -/* Populate bulk in endpoint context: */ - ep_ctx =dbc_bulkin_ctx (dbc); - deq =dbc_bulkin_enq (dbc); - ep_ctx->ep_info =0 ; - ep_ctx->ep_info2 =dbc_epctx_info2 (BULK_IN_EP ,1024 , max_burst); - ep_ctx->deq =cpu_to_le64 (deq | dbc->ring_in->cycle_state); +/* Populate bulk in and out endpoint contexts: */ +xhci_dbc_init_ep_contexts (dbc);/* Set DbC context and info registers: */ lo_hi_writeq (dbc->ctx->dma, &dbc->regs->dccp);
@@ -421,6 +430,23 @@ dbc_alloc_ctx(struct device *dev, gfp_treturn ctx; } +static void xhci_dbc_ring_init (struct xhci_ring *ring) +{ +struct xhci_segment *seg = ring->first_seg; + +/* clear all trbs on ring in case of old ring */ +memset (seg->trbs,0 ,TRB_SEGMENT_SIZE ); + +/* Only event ring does not use link TRB */ +if (ring->type !=TYPE_EVENT ) { +union xhci_trb *trb = &seg->trbs[TRBS_PER_SEGMENT -1 ]; + + trb->link.segment_ptr =cpu_to_le64 (ring->first_seg->dma); + trb->link.control =cpu_to_le32 (LINK_TOGGLE |TRB_TYPE (TRB_LINK )); + } +xhci_initialize_ring_info (ring,1 ); +} +static struct xhci_ring *xhci_dbc_ring_alloc (struct device *dev,enum xhci_ring_type type,gfp_t flags) {
@@ -449,15 +475,10 @@ xhci_dbc_ring_alloc(struct device *dev, seg->dma = dma; -/* Only event ring does not use link TRB */ -if (type !=TYPE_EVENT ) { -union xhci_trb *trb = &seg->trbs[TRBS_PER_SEGMENT -1 ]; - - trb->link.segment_ptr =cpu_to_le64 (dma); - trb->link.control =cpu_to_le32 (LINK_TOGGLE |TRB_TYPE (TRB_LINK )); - }INIT_LIST_HEAD (&ring->td_list); -xhci_initialize_ring_info (ring,1 ); + +xhci_dbc_ring_init (ring); +return ring; dma_fail:kfree (seg);
Greg Kroah-Hartman
maintainerPATCH 52/61 xhci: dbc: Fix full DbC transfer ring after several reconnects
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
[ Upstream commit a5c98e8b1398534ae1feb6e95e2d3ee5215538ed ]
Pending requests will be flushed on disconnect, and the corresponding TRBs will be turned into No-op TRBs, which are ignored by the xHC controller once it starts processing the ring.
If the USB debug cable repeatedly disconnects before ring is started then the ring will eventually be filled with No-op TRBs. No new transfers can be queued when the ring is full, and driver will print the following error message:
"xhci_hcd 0000:00:14.0: failed to queue trbs"
This is a normal case for 'in' transfers where TRBs are always enqueued in advance, ready to take on incoming data. If no data arrives, and device is disconnected, then ring dequeue will remain at beginning of the ring while enqueue points to first free TRB after last cancelled No-op TRB.
s
Solve this by reinitializing the rings when the debug cable disconnects and DbC is leaving the configured state.
Clear the whole ring buffer and set enqueue and dequeue to the beginning of ring, and set cycle bit to its initial state.
--- drivers/usb/host/xhci-dbgcap.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-dbgcap.c +21 -2
@@ -447,6 +447,25 @@ static void xhci_dbc_ring_init(struct xhxhci_initialize_ring_info (ring,1 ); } +static int xhci_dbc_reinit_ep_rings (struct xhci_dbc *dbc) +{ +struct xhci_ring *in_ring = dbc->eps[BULK_IN ].ring; +struct xhci_ring *out_ring = dbc->eps[BULK_OUT ].ring; + +if (!in_ring || !out_ring || !dbc->ctx) { +dev_warn (dbc->dev,"Can't re-init unallocated endpoints\n" ); +return -ENODEV ; + } + +xhci_dbc_ring_init (in_ring); +xhci_dbc_ring_init (out_ring); + +/* set ep context enqueue, dequeue, and cycle to initial values */ +xhci_dbc_init_ep_contexts (dbc); + +return 0 ; +} +static struct xhci_ring *xhci_dbc_ring_alloc (struct device *dev,enum xhci_ring_type type,gfp_t flags) {
@@ -871,7 +890,7 @@ static enum evtreturn xhci_dbc_do_handledev_info (dbc->dev,"DbC cable unplugged\n" ); dbc->state =DS_ENABLED ;xhci_dbc_flush_requests (dbc); - +xhci_dbc_reinit_ep_rings (dbc);return EVT_DISC ; }
@@ -881,7 +900,7 @@ static enum evtreturn xhci_dbc_do_handlewritel (portsc, &dbc->regs->portsc); dbc->state =DS_ENABLED ;xhci_dbc_flush_requests (dbc); - +xhci_dbc_reinit_ep_rings (dbc);return EVT_DISC ; }
Greg Kroah-Hartman
maintainerPATCH 53/61 mptcp: propagate shutdown to subflows when possible
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit f755be0b1ff429a2ecf709beeb1bcd7abc111c2b ]
When the MPTCP DATA FIN have been ACKed, there is no more MPTCP related metadata to exchange, and all subflows can be safely shutdown.
Before this patch, the subflows were actually terminated at 'close()' time. That's certainly fine most of the time, but not when the userspace 'shutdown()' a connection, without close()ing it. When doing so, the subflows were staying in LAST_ACK state on one side -- and consequently in FIN_WAIT2 on the other side -- until the 'close()' of the MPTCP socket.
Now, when the DATA FIN have been ACKed, all subflows are shutdown. A consequence of this is that the TCP 'FIN' flag can be set earlier now, but the end result is the same. This affects the packetdrill tests looking at the end of the MPTCP connections, but for a good reason.
Note that tcp_shutdown() will check the subflow state, so no need to do that again before calling it.
--- net/mptcp/protocol.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
net/mptcp/protocol.c +15 -0
@@ -425,6 +425,19 @@ static void mptcp_close_wake_up(struct ssk_wake_async (sk,SOCK_WAKE_WAITD ,POLL_IN ); } +static void mptcp_shutdown_subflows (struct mptcp_sock *msk) +{ +struct mptcp_subflow_context *subflow; + +mptcp_for_each_subflow (msk, subflow) { +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); +bool slow; + + slow =lock_sock_fast (ssk); +tcp_shutdown (ssk,SEND_SHUTDOWN ); +unlock_sock_fast (ssk, slow); + } +}static bool mptcp_pending_data_fin_ack (struct sock *sk) {struct mptcp_sock *msk =mptcp_sk (sk);
@@ -448,6 +461,7 @@ static void mptcp_check_data_fin_ack(strbreak ;case TCP_CLOSING :case TCP_LAST_ACK : +mptcp_shutdown_subflows (msk);inet_sk_state_store (sk,TCP_CLOSE );break ; }
@@ -615,6 +629,7 @@ static bool mptcp_check_data_fin(structinet_sk_state_store (sk,TCP_CLOSING );break ;case TCP_FIN_WAIT2 : +mptcp_shutdown_subflows (msk);inet_sk_state_store (sk,TCP_CLOSE );break ;default :
Greg Kroah-Hartman
maintainerPATCH 54/61 selftests: mptcp: connect: catch IO errors on listen side
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit 14e22b43df25dbd4301351b882486ea38892ae4f ]
IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.
Now when an IO error is detected, the program exits directly with an error.
--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.c +4 -3
@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:
@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 ); -copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo); }else {perror ("accept" );return 1 ;
@@ -1045,10 +1046,10 @@ again:if (cfg_input)close (fd); -if (--cfg_repeat >0 ) +if (!err && --cfg_repeat >0 ) goto again; -return 0 ; +return err; }static void init_rng (void )
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
Hi,
Quoted 50 lines · Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit
14e22b43df25dbd4301351b882486ea38892ae4f]IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.Now when an IO error is detected, the program exits directly with an error.
Fixes 05be5e273c84 ("selftests: mptcp: add disconnect tests")Reviewed-by Mat Martineau <[email protected]>Reviewed-by Geliang Tang <[email protected]>Signed-off-by Matthieu Baerts (NGI0) <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-0@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:
tools/testing/selftests/net/mptcp/mptcp_connect.c again: · line 1040
Quoted 5 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-1@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 ); -copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo);
The winfo in function main_loop_s was added in
commit ca7ae8916043 ("selftests: mptcp: mptfo Initiator/Listener") but not present in v6.1.y.
As a result, mptcp selftests will fail to compile from v6.1.154. I'm not sure whether I should send a revert patch, a patch that removes &winfo, or ask for the prereq patch to be applied. So, I'm reporting it for now.
mptcp_connect.c: In function ‘main_loop_s’:
mptcp_connect.c:1040:59: error: ‘winfo’ undeclared (first use in this function)
1040 | err = copyfd_io(fd, remotesock, 1, true, &winfo);
| ^~~~~
mptcp_connect.c:1040:59: note: each undeclared identifier is reported only once for each function it appears in mptcp_connect.c:1040:23: error: too many arguments to function ‘copyfd_io’; expected 4, have 5
1040 | err = copyfd_io(fd, remotesock, 1, true, &winfo);
| ^~~~~~~~~ ~~~~~~
mptcp_connect.c:845:12: note: declared here
845 | static int copyfd_io(int infd, int peerfd, int outfd, bool close_peerfd)
| ^~~~~~~~~
Thanks,
Akagi
Quoted 20 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +2
-2}else {perror ("accept" );return 1 ;@@ -1045,10 +1046,10 @@ again:if (cfg_input)close (fd); -if (--cfg_repeat >0 ) +if (!err && --cfg_repeat >0 ) goto again; -return 0 ; +return err; }static void init_rng (void )
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
Hi Kenta,
Quoted 56 lines · Kenta Akagi
Hi,
Quoted 53 lines · Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit
14e22b43df25dbd4301351b882486ea38892ae4f]IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.Now when an IO error is detected, the program exits directly with an error.
Fixes 05be5e273c84 ("selftests: mptcp: add disconnect tests")Reviewed-by Mat Martineau <[email protected]>Reviewed-by Geliang Tang <[email protected]>Signed-off-by Matthieu Baerts (NGI0) <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-0@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 );
Quoted 9 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c again: · line 1040
Quoted 2 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-1-copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo);The winfo in function
main_loop_swas added in
commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") but not present in v6.1.y.
As a result, mptcp selftests will fail to compile from v6.1.154. I'm not sure whether I should send a revert patch, a patch that removes &winfo, or ask for the prereq patch to be applied. So, I'm reporting it for now.
Thank you for reporting the error!
I think the best is a patch removing "&winfo": the goal of 14e22b43df25 ("selftests: mptcp: connect: catch IO errors on listen side") is to stop in case of errors with copyfd_io(). No need to add commit ca7ae8916043 ("selftests: mptcp: mptfo Initiator/Listener") as prereq.
Do you plan to send such patch for v6.1, or do you prefer if I do it?
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
Hi,
Quoted 69 lines · Matthieu Baerts
Hi Kenta,
Quoted 56 lines · Kenta Akagi
Hi,
Quoted 53 lines · Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit
14e22b43df25dbd4301351b882486ea38892ae4f]IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.Now when an IO error is detected, the program exits directly with an error.
Fixes 05be5e273c84 ("selftests: mptcp: add disconnect tests")Reviewed-by Mat Martineau <[email protected]>Reviewed-by Geliang Tang <[email protected]>Signed-off-by Matthieu Baerts (NGI0) <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-0@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 );Quoted 9 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c again: · line 1040
Quoted 2 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-1-copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo);The winfo in function
main_loop_swas added in
commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") but not present in v6.1.y.
As a result, mptcp selftests will fail to compile from v6.1.154. I'm not sure whether I should send a revert patch, a patch that removes &winfo, or ask for the prereq patch to be applied. So, I'm reporting it for now.
Quoted 8 lines
Thank you for reporting the error!
I think the best is a patch removing "&winfo": the goal of
14e22b43df25("selftests: mptcp: connect: catch IO errors on listen side") is to stop in case of errors withcopyfd_io(). No need to add commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") as prereq.Do you plan to send such patch for v6.1, or do you prefer if I do it?
Thank you for checking.
I'll send PATCH for v6.1.y.
Quoted 6 lines
Cheers,
MattSignature · 1 line
Sponsored by the NGI0 Core fund.
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
In reply to Matthieu BaertsHi Matthieu,
Quoted 69 lines · Matthieu Baerts
Hi Kenta,
Quoted 56 lines · Kenta Akagi
Hi,
Quoted 53 lines · Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit
14e22b43df25dbd4301351b882486ea38892ae4f]IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.Now when an IO error is detected, the program exits directly with an error.
Fixes 05be5e273c84 ("selftests: mptcp: add disconnect tests")Reviewed-by Mat Martineau <[email protected]>Reviewed-by Geliang Tang <[email protected]>Signed-off-by Matthieu Baerts (NGI0) <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-0@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 );Quoted 9 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c again: · line 1040
Quoted 2 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-1-copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo);The winfo in function
main_loop_swas added in
commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") but not present in v6.1.y.
As a result, mptcp selftests will fail to compile from v6.1.154. I'm not sure whether I should send a revert patch, a patch that removes &winfo, or ask for the prereq patch to be applied. So, I'm reporting it for now.
Quoted 8 lines
Thank you for reporting the error!
I think the best is a patch removing "&winfo": the goal of
14e22b43df25("selftests: mptcp: connect: catch IO errors on listen side") is to stop in case of errors withcopyfd_io(). No need to add commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") as prereq.Do you plan to send such patch for v6.1, or do you prefer if I do it?
I would like to send it, but I don't know the following, so could you please tell me?
In a case like this, should I send a patch series of Revert that, and adjusted backport patch that compilable?
Or can I fix it directly like below?
- err = copyfd_io(fd, remotesock, 1, true, &winfo);
+ err = copyfd_io(fd, remotesock, 1, true);
I checked stable-kernel-rules.html but I couldn't find it.
Thanks,
Akagi
Quoted 7 lines
Cheers,
MattSignature · 1 line
Sponsored by the NGI0 Core fund.
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
Quoted 90 lines · Kenta Akagi
Hi Matthieu,
Quoted 69 lines · Matthieu Baerts
Hi Kenta,
Quoted 56 lines · Kenta Akagi
Hi,
Quoted 53 lines · Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit
14e22b43df25dbd4301351b882486ea38892ae4f]IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues.
Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this.
The main consequence of this issue is the error that was reported by the
selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout.Now when an IO error is detected, the program exits directly with an error.
Fixes 05be5e273c84 ("selftests: mptcp: add disconnect tests")Reviewed-by Mat Martineau <[email protected]>Reviewed-by Geliang Tang <[email protected]>Signed-off-by Matthieu Baerts (NGI0) <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-0@@ -1005,6 +1005,7 @@ int main_loop_s(int listensock)struct pollfd polls;socklen_t salen;int remotesock; +int err =0 ;int fd =0 ; again:@@ -1036,7 +1037,7 @@ again:SOCK_TEST_TCPULP (remotesock,0 );Quoted 9 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c again: · line 1040
Quoted 2 lines
tools/testing/selftests/net/mptcp/mptcp_connect.c +1
-1-copyfd_io (fd, remotesock,1 , true); + err =copyfd_io (fd, remotesock,1 , true, &winfo);The winfo in function
main_loop_swas added in
commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") but not present in v6.1.y.
As a result, mptcp selftests will fail to compile from v6.1.154. I'm not sure whether I should send a revert patch, a patch that removes &winfo, or ask for the prereq patch to be applied. So, I'm reporting it for now.Quoted 8 lines
Thank you for reporting the error!
I think the best is a patch removing "&winfo": the goal of
14e22b43df25("selftests: mptcp: connect: catch IO errors on listen side") is to stop in case of errors withcopyfd_io(). No need to add commitca7ae8916043("selftests: mptcp: mptfo Initiator/Listener") as prereq.Do you plan to send such patch for v6.1, or do you prefer if I do it?
I would like to send it, but I don't know the following, so could you please tell me?
In a case like this, should I send a patch series of Revert that, and adjusted backport patch that compilable?
Or can I fix it directly like below?(quoted diff) +1
-1- err = copyfd_io(fd, remotesock, 1, true, &winfo); + err = copyfd_io(fd, remotesock, 1, true);
Quoted 1 line
I checked stable-kernel-rules.html but I couldn't find it.
In such case, I would fix it directly. Simply create a commit with this diff, mention the issue and add a "Fixes" tag referencing the commit in v6.1. Then send a patch to Greg and Sasha, with the stable and MPTCP ML in cc, and use "PATCH 6.1.y" as prefix, e.g.
$ git commit -s
$ git send-email \
--to '[email protected]' \
--to '[email protected]' \
--cc '[email protected]' \
--cc 'MPTCP Upstream <[email protected]>' \
--subject-prefix 'PATCH 6.1.y' \
-1 HEADCheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Re: [PATCH 6.1 54/61] selftests: mptcp: connect: catch IO errors on listen side
Hi,
Thank you for your detailed guide. I have sent a patch.
Thanks,
Akagi
Greg Kroah-Hartman
maintainerPATCH 55/61 net: rfkill: gpio: add DT support
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Zabel <[email protected]>
[ Upstream commit d64c732dfc9edcd57feb693c23162117737e426b ]
Allow probing rfkill-gpio via device tree. This hooks up the already existing support that was started in commit 262c91ee5e52 ("net:
rfkill: gpio: prepare for DT and ACPI support") via the "rfkill-gpio" compatible, with the "name" and "type" properties renamed to "label" and "radio-type", respectively, in the device tree case.
Stable-dep-of: b6f56a44e4c1 ("net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer")
--- net/rfkill/rfkill-gpio.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
net/rfkill/rfkill-gpio.c +18 -2
@@ -79,6 +79,8 @@ static int rfkill_gpio_probe(struct plat {struct rfkill_gpio_data *rfkill;struct gpio_desc *gpio; +const char *name_property; +const char *type_property;const char *type_name;int ret;
@@ -86,8 +88,15 @@ static int rfkill_gpio_probe(struct platif (!rfkill)return -ENOMEM ; -device_property_read_string (&pdev->dev,"name" , &rfkill->name); -device_property_read_string (&pdev->dev,"type" , &type_name); +if (dev_of_node (&pdev->dev)) { + name_property ="label" ; + type_property ="radio-type" ; + }else { + name_property ="name" ; + type_property ="type" ; + } +device_property_read_string (&pdev->dev, name_property, &rfkill->name); +device_property_read_string (&pdev->dev, type_property, &type_name);if (!rfkill->name) rfkill->name =dev_name (&pdev->dev);
@@ -169,12 +178,19 @@ static const struct acpi_device_id rfkilMODULE_DEVICE_TABLE (acpi, rfkill_acpi_match);#endif +static const struct of_device_id rfkill_of_match[]__maybe_unused = { + { .compatible ="rfkill-gpio" , }, + { }, +}; +MODULE_DEVICE_TABLE (of, rfkill_of_match); +static struct platform_driver rfkill_gpio_driver = { .probe = rfkill_gpio_probe, .remove = rfkill_gpio_remove, .driver = { .name ="rfkill_gpio" , .acpi_match_table =ACPI_PTR (rfkill_acpi_match), + .of_match_table =of_match_ptr (rfkill_of_match), }, };
Greg Kroah-Hartman
maintainerPATCH 56/61 net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit b6f56a44e4c1014b08859dcf04ed246500e310e5 ]
Since commit 7d5e9737efda ("net: rfkill: gpio: get the name and type from device property") rfkill_find_type() gets called with the possibly uninitialized "const char *type_name;" local variable.
On x86 systems when rfkill-gpio binds to a "BCM4752" or "LNV4752" acpi_device, the rfkill->type is set based on the ACPI acpi_device_id:
rfkill->type = (unsigned)id->driver_data;
and there is no "type" property so device_property_read_string() will fail and leave type_name uninitialized, leading to a potential crash.
rfkill_find_type() does accept a NULL pointer, fix the potential crash by initializing type_name to NULL.
Note likely sofar this has not been caught because:
1. Not many x86 machines actually have a "BCM4752"/"LNV4752" acpi_device
2. The stack happened to contain NULL where type_name is stored
--- net/rfkill/rfkill-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/rfkill/rfkill-gpio.c +2 -2
@@ -78,10 +78,10 @@ static int rfkill_gpio_acpi_probe(structstatic int rfkill_gpio_probe (struct platform_device *pdev) {struct rfkill_gpio_data *rfkill; -struct gpio_desc *gpio; +const char *type_name =NULL ;const char *name_property;const char *type_property; -const char *type_name; +struct gpio_desc *gpio;int ret; rfkill =devm_kzalloc (&pdev->dev,sizeof (*rfkill),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 57/61 ASoC: qcom: q6apm-lpass-dai: close graphs before opening a new one
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
[ Upstream commit c52615e494f17f44b076ac8ae5a53cfc0041a0dd ]
On multiple prepare calls, its possible that the playback graphs are not unloaded from the DSP, which can have some wierd side-effects, one of them is that the data not consumed without any errors.
Stable-dep-of: 68f27f7c7708 ("ASoC: qcom: q6apm-lpass-dais: Fix NULL pointer dereference if source graph failed")
--- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +3 -0
@@ -130,6 +130,9 @@ static int q6apm_lpass_dai_prepare(strucif (dai_data->is_port_started[dai->id]) {q6apm_graph_stop (dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; + +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) +q6apm_graph_close (dai_data->graph[dai->id]); }/**
Greg Kroah-Hartman
maintainerPATCH 58/61 ASoC: q6apm-lpass-dai: close graph on prepare errors
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
[ Upstream commit be1fae62cf253a5b67526cee9fbc07689b97c125 ]
There is an issue around with error handling and graph management with the exising code, none of the error paths close the graph, which result in leaving the loaded graph in dsp, however the driver thinks otherwise.
This can have a nasty side effect specially when we try to load the same graph to dsp, dsp returns error which leaves the board with no sound and requires restart.
Fix this by properly closing the graph when we hit errors between open and close.
Stable-dep-of: 68f27f7c7708 ("ASoC: qcom: q6apm-lpass-dais: Fix NULL pointer dereference if source graph failed")
--- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-)
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +20 -12
@@ -109,14 +109,17 @@ static void q6apm_lpass_dai_shutdown(strstruct q6apm_lpass_dai_data *dai_data =dev_get_drvdata (dai->dev);int rc; -if (!dai_data->is_port_started[dai->id]) -return ; - rc =q6apm_graph_stop (dai_data->graph[dai->id]); -if (rc <0 ) -dev_err (dai->dev,"fail to close APM port (%d)\n" , rc); +if (dai_data->is_port_started[dai->id]) { + rc =q6apm_graph_stop (dai_data->graph[dai->id]); + dai_data->is_port_started[dai->id] = false; +if (rc <0 ) +dev_err (dai->dev,"fail to close APM port (%d)\n" , rc); + } -q6apm_graph_close (dai_data->graph[dai->id]); - dai_data->is_port_started[dai->id] = false; +if (dai_data->graph[dai->id]) { +q6apm_graph_close (dai_data->graph[dai->id]); + dai_data->graph[dai->id] =NULL ; + } }static int q6apm_lpass_dai_prepare (struct snd_pcm_substream *substream,struct snd_soc_dai *dai)
@@ -131,8 +134,10 @@ static int q6apm_lpass_dai_prepare(strucq6apm_graph_stop (dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; -if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) {q6apm_graph_close (dai_data->graph[dai->id]); + dai_data->graph[dai->id] =NULL ; + } }/**
@@ -151,26 +156,29 @@ static int q6apm_lpass_dai_prepare(struc cfg->direction = substream->stream; rc =q6apm_graph_media_format_pcm (dai_data->graph[dai->id], cfg); -if (rc) {dev_err (dai->dev,"Failed to set media format %d\n" , rc); -return rc; + goto err; } rc =q6apm_graph_prepare (dai_data->graph[dai->id]);if (rc) {dev_err (dai->dev,"Failed to prepare Graph %d\n" , rc); -return rc; + goto err; } rc =q6apm_graph_start (dai_data->graph[dai->id]);if (rc <0 ) {dev_err (dai->dev,"fail to start APM port %x\n" , dai->id); -return rc; + goto err; } dai_data->is_port_started[dai->id] = true;return 0 ; +err: +q6apm_graph_close (dai_data->graph[dai->id]); + dai_data->graph[dai->id] =NULL ; +return rc; }static int q6apm_lpass_dai_startup (struct snd_pcm_substream *substream,struct snd_soc_dai *dai)
Greg Kroah-Hartman
maintainerPATCH 59/61 ASoC: qcom: q6apm-lpass-dais: Fix NULL pointer dereference if source graph failed
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 68f27f7c7708183e7873c585ded2f1b057ac5b97 ]
If earlier opening of source graph fails (e.g. ADSP rejects due to incorrect audioreach topology), the graph is closed and "dai_data->graph[dai->id]" is assigned NULL. Preparing the DAI for sink graph continues though and next call to q6apm_lpass_dai_prepare() receives dai_data->graph[dai->id]=NULL leading to NULL pointer exception:
qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001002 cmd
qcom-apm gprsvc:service:2:1: DSP returned error[1001002] 1
q6apm-lpass-dais 30000000.remoteproc:glink-edge:gpr:service@1:bedais: fail to start APM port 78
q6apm-lpass-dais 30000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on TX_CODEC_DMA_TX_3: -22
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a8 ... Call trace: q6apm_graph_media_format_pcm+0x48/0x120 (P) q6apm_lpass_dai_prepare+0x110/0x1b4 snd_soc_pcm_dai_prepare+0x74/0x108 __soc_pcm_prepare+0x44/0x160 dpcm_be_dai_prepare+0x124/0x1c0
Message-ID: <[email protected]>
--- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +4 -2
@@ -176,8 +176,10 @@ static int q6apm_lpass_dai_prepare(strucreturn 0 ; err: -q6apm_graph_close (dai_data->graph[dai->id]); - dai_data->graph[dai->id] =NULL ; +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) { +q6apm_graph_close (dai_data->graph[dai->id]); + dai_data->graph[dai->id] =NULL ; + }return rc; }
Greg Kroah-Hartman
maintainerPATCH 60/61 crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit fb800fa4c1f5aee1238267252e88a7837e645c02 ]
Convert af_alg_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself.
This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction.
--- crypto/af_alg.c | 52 ++++++++-------------------------------------------- 1 file changed, 8 insertions(+), 44 deletions(-)
crypto/af_alg.c +8 -44
@@ -993,53 +993,17 @@ EXPORT_SYMBOL_GPL(af_alg_sendmsg);ssize_t af_alg_sendpage (struct socket *sock,struct page *page,int offset,size_t size,int flags) { -struct sock *sk = sock->sk; -struct alg_sock *ask =alg_sk (sk); -struct af_alg_ctx *ctx = ask->private; -struct af_alg_tsgl *sgl; -int err = -EINVAL ; +struct bio_vec bvec; +struct msghdr msg = { + .msg_flags = flags |MSG_SPLICE_PAGES , + };if (flags &MSG_SENDPAGE_NOTLAST ) - flags |=MSG_MORE ; + msg.msg_flags |=MSG_MORE ; -lock_sock (sk); -if (!ctx->more && ctx->used) - goto unlock; - -if (!size) - goto done; - -if (!af_alg_writable (sk)) { - err =af_alg_wait_for_wmem (sk, flags); -if (err) - goto unlock; - } - - err =af_alg_alloc_tsgl (sk); -if (err) - goto unlock; - - ctx->merge =0 ; - sgl = list_entry(ctx->tsgl_list.prev, struct af_alg_tsgl, list); - -if (sgl->cur) -sg_unmark_end (sgl->sg + sgl->cur -1 ); - -sg_mark_end (sgl->sg + sgl->cur); - -get_page (page); -sg_set_page (sgl->sg + sgl->cur, page, size, offset); - sgl->cur++; - ctx->used += size; - -done: - ctx->more = flags &MSG_MORE ; - -unlock: -af_alg_data_wakeup (sk); -release_sock (sk); - -return err ?: size; +bvec_set_page (&bvec, page, size, offset); +iov_iter_bvec (&msg.msg_iter,ITER_SOURCE , &bvec,1 , size); +return sock_sendmsg (sock, &msg); }EXPORT_SYMBOL_GPL (af_alg_sendpage);
Greg Kroah-Hartman
maintainerPATCH 61/61 crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 1b34cbbf4f011a121ef7b2d7d6e6920a036d5285 ]
Issuing two writes to the same af_alg socket is bogus as the data will be interleaved in an unpredictable fashion. Furthermore, concurrent writes may create inconsistencies in the internal socket state.
Disallow this by adding a new ctx->write field that indiciates exclusive ownership for writing.
--- crypto/af_alg.c | 7 +++++++ include/crypto/if_alg.h | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-)
crypto/af_alg.c +7 -0
@@ -859,6 +859,12 @@ int af_alg_sendmsg(struct socket *sock, }lock_sock (sk); +if (ctx->write) { +release_sock (sk); +return -EBUSY ; + } + ctx->write = true; +if (ctx->init && !ctx->more) {if (ctx->used) { err = -EINVAL ;
@@ -974,6 +980,7 @@ int af_alg_sendmsg(struct socket *sock, unlock:af_alg_data_wakeup (sk); + ctx->write = false;release_sock (sk);return copied ?: err;
include/crypto/if_alg.h +6 -4
@@ -136,6 +136,7 @@ struct af_alg_async_req {* SG? * @enc: Cryptographic operation to be performed when * recvmsg is invoked. +* @write: True if we are in the middle of a write. * @init: True if metadata has been sent. * @len: Length of memory allocated for this data structure. * @inflight: Non-zero when AIO requests are in flight.
@@ -151,10 +152,11 @@ struct af_alg_ctx {size_t used;atomic_t rcvused; -bool more; -bool merge; -bool enc; -bool init; + u32 more:1, + merge:1, + enc:1, + write:1, + init:1;unsigned int len;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
# Librecast Test Results
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.1.154-rc1-00062-gbd7dff6dbcf5 #90 SMP PREEMPT_DYNAMIC Tue Sep 23 07:23:46 -00 2025 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Am 22.09.2025 um 21:28 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.1.154-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: bd7dff6dbcf5b16eefef05f2750607b70bfe727c
* git describe: v6.1.153-62-gbd7dff6dbcf5
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.153-62-gbd7dff6dbcf5
## Test Regressions (compared to v6.1.151-87-gb31770c84f52)
## Metric Regressions (compared to v6.1.151-87-gb31770c84f52)
## Test Fixes (compared to v6.1.151-87-gb31770c84f52)
## Metric Fixes (compared to v6.1.151-87-gb31770c84f52)
## Test result summary
total: 227967, pass: 212169, fail: 4614, skip: 10926, xfail: 258
## Build Summary
* arc: 5 total, 4 passed, 0 failed, 1 skipped
* arm: 133 total, 133 passed, 0 failed
* arm64: 41 total, 41 passed, 0 failed
* i386: 21 total, 21 passed, 0 failed
* mips: 26 total, 25 passed, 1 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 32 total, 31 passed, 1 failed
* riscv: 11 total, 11 passed, 0 failed
* s390: 14 total, 14 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 7 total, 7 passed, 0 failed
* x86_64: 33 total, 33 passed, 0 failed
## Test suites summary
* boot
* commands
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-exec
* kselftest-fpu
* kselftest-futex
* kselftest-intel_pstate
* kselftest-kcmp
* kselftest-kvm
* kselftest-livepatch
* kselftest-membarrier
* kselftest-mincore
* kselftest-mqueue
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-sigaltstack
* kselftest-size
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-x86
* kunit
* kvm-unit-tests
* lava
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-build-clang
* log-parser-build-gcc
* log-parser-test
* ltp-capability
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* modules
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.1:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
119 tests: 119 pass, 0 failLinux version: 6.1.154-rc1-gbd7dff6dbcf5
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 8 lines · On Mon, 22 Sep 2025 21:28:53 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64:
Thanks!
Cheers,
Miguel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.154 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 24 Sep 2025 19:23:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.154-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
The kernel, bpf tool, perf tool, and kselftest builds fine for v6.1.154-rc1 on x86 and arm64 Azure VM.
Thanks,
Hardik