Commit graph

706 commits

Author SHA1 Message Date
Jeongjun Park
b306486b29 wifi: ath9k: add range check for conn_rsp_epid in htc_connect_service()
[ Upstream commit 8619593634cbdf5abf43f5714df49b04e4ef09ab ]

I found the following bug in my fuzzer:

  UBSAN: array-index-out-of-bounds in drivers/net/wireless/ath/ath9k/htc_hst.c:26:51
  index 255 is out of range for type 'htc_endpoint [22]'
  CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.11.0-rc6-dirty #14
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
  Workqueue: events request_firmware_work_func
  Call Trace:
   <TASK>
   dump_stack_lvl+0x180/0x1b0
   __ubsan_handle_out_of_bounds+0xd4/0x130
   htc_issue_send.constprop.0+0x20c/0x230
   ? _raw_spin_unlock_irqrestore+0x3c/0x70
   ath9k_wmi_cmd+0x41d/0x610
   ? mark_held_locks+0x9f/0xe0
   ...

Since this bug has been confirmed to be caused by insufficient verification
of conn_rsp_epid, I think it would be appropriate to add a range check for
conn_rsp_epid to htc_connect_service() to prevent the bug from occurring.

Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20240909103855.68006-1-aha310510@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:24:03 +01:00
Benoît Monin
f007306b3a net: usb: qmi_wwan: add Quectel RG650V
[ Upstream commit 6b3f18a76be6bbd237c7594cf0bf2912b68084fe ]

Add support for Quectel RG650V which is based on Qualcomm SDX65 chip.
The composition is DIAG / NMEA / AT / AT / QMI.

T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P: Vendor=2c7c ProdID=0122 Rev=05.15
S: Manufacturer=Quectel
S: Product=RG650V-EU
S: SerialNumber=xxxxxxx
C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=9ms
I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=9ms
I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=88(I) Atr=03(Int.) MxPS=   8 Ivl=9ms

Signed-off-by: Benoît Monin <benoit.monin@gmx.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241024151113.53203-1-benoit.monin@gmx.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:23:58 +01:00
Dragos Tatulea
391cc3c9c7 net/mlx5e: kTLS, Fix incorrect page refcounting
[ Upstream commit dd6e972cc5890d91d6749bb48e3912721c4e4b25 ]

The kTLS tx handling code is using a mix of get_page() and
page_ref_inc() APIs to increment the page reference. But on the release
path (mlx5e_ktls_tx_handle_resync_dump_comp()), only put_page() is used.

This is an issue when using pages from large folios: the get_page()
references are stored on the folio page while the page_ref_inc()
references are stored directly in the given page. On release the folio
page will be dereferenced too many times.

This was found while doing kTLS testing with sendfile() + ZC when the
served file was read from NFS on a kernel with NFS large folios support
(commit 49b29a573da8 ("nfs: add support for large folios")).

Fixes: 84d1bb2b139e ("net/mlx5e: kTLS, Limit DUMP wqe size")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241107183527.676877-5-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:20:50 +01:00
Mark Bloch
664ac69e67 net/mlx5: fs, lock FTE when checking if active
[ Upstream commit 9ca314419930f9135727e39d77e66262d5f7bef6 ]

The referenced commits introduced a two-step process for deleting FTEs:

- Lock the FTE, delete it from hardware, set the hardware deletion function
  to NULL and unlock the FTE.
- Lock the parent flow group, delete the software copy of the FTE, and
  remove it from the xarray.

However, this approach encounters a race condition if a rule with the same
match value is added simultaneously. In this scenario, fs_core may set the
hardware deletion function to NULL prematurely, causing a panic during
subsequent rule deletions.

To prevent this, ensure the active flag of the FTE is checked under a lock,
which will prevent the fs_core layer from attaching a new steering rule to
an FTE that is in the process of deletion.

[  438.967589] MOSHE: 2496 mlx5_del_flow_rules del_hw_func
[  438.968205] ------------[ cut here ]------------
[  438.968654] refcount_t: decrement hit 0; leaking memory.
[  438.969249] WARNING: CPU: 0 PID: 8957 at lib/refcount.c:31 refcount_warn_saturate+0xfb/0x110
[  438.970054] Modules linked in: act_mirred cls_flower act_gact sch_ingress openvswitch nsh mlx5_vdpa vringh vhost_iotlb vdpa mlx5_ib mlx5_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm ib_uverbs ib_core zram zsmalloc fuse [last unloaded: cls_flower]
[  438.973288] CPU: 0 UID: 0 PID: 8957 Comm: tc Not tainted 6.12.0-rc1+ #8
[  438.973888] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
[  438.974874] RIP: 0010:refcount_warn_saturate+0xfb/0x110
[  438.975363] Code: 40 66 3b 82 c6 05 16 e9 4d 01 01 e8 1f 7c a0 ff 0f 0b c3 cc cc cc cc 48 c7 c7 10 66 3b 82 c6 05 fd e8 4d 01 01 e8 05 7c a0 ff <0f> 0b c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90
[  438.976947] RSP: 0018:ffff888124a53610 EFLAGS: 00010286
[  438.977446] RAX: 0000000000000000 RBX: ffff888119d56de0 RCX: 0000000000000000
[  438.978090] RDX: ffff88852c828700 RSI: ffff88852c81b3c0 RDI: ffff88852c81b3c0
[  438.978721] RBP: ffff888120fa0e88 R08: 0000000000000000 R09: ffff888124a534b0
[  438.979353] R10: 0000000000000001 R11: 0000000000000001 R12: ffff888119d56de0
[  438.979979] R13: ffff888120fa0ec0 R14: ffff888120fa0ee8 R15: ffff888119d56de0
[  438.980607] FS:  00007fe6dcc0f800(0000) GS:ffff88852c800000(0000) knlGS:0000000000000000
[  438.983984] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  438.984544] CR2: 00000000004275e0 CR3: 0000000186982001 CR4: 0000000000372eb0
[  438.985205] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  438.985842] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  438.986507] Call Trace:
[  438.986799]  <TASK>
[  438.987070]  ? __warn+0x7d/0x110
[  438.987426]  ? refcount_warn_saturate+0xfb/0x110
[  438.987877]  ? report_bug+0x17d/0x190
[  438.988261]  ? prb_read_valid+0x17/0x20
[  438.988659]  ? handle_bug+0x53/0x90
[  438.989054]  ? exc_invalid_op+0x14/0x70
[  438.989458]  ? asm_exc_invalid_op+0x16/0x20
[  438.989883]  ? refcount_warn_saturate+0xfb/0x110
[  438.990348]  mlx5_del_flow_rules+0x2f7/0x340 [mlx5_core]
[  438.990932]  __mlx5_eswitch_del_rule+0x49/0x170 [mlx5_core]
[  438.991519]  ? mlx5_lag_is_sriov+0x3c/0x50 [mlx5_core]
[  438.992054]  ? xas_load+0x9/0xb0
[  438.992407]  mlx5e_tc_rule_unoffload+0x45/0xe0 [mlx5_core]
[  438.993037]  mlx5e_tc_del_fdb_flow+0x2a6/0x2e0 [mlx5_core]
[  438.993623]  mlx5e_flow_put+0x29/0x60 [mlx5_core]
[  438.994161]  mlx5e_delete_flower+0x261/0x390 [mlx5_core]
[  438.994728]  tc_setup_cb_destroy+0xb9/0x190
[  438.995150]  fl_hw_destroy_filter+0x94/0xc0 [cls_flower]
[  438.995650]  fl_change+0x11a4/0x13c0 [cls_flower]
[  438.996105]  tc_new_tfilter+0x347/0xbc0
[  438.996503]  ? ___slab_alloc+0x70/0x8c0
[  438.996929]  rtnetlink_rcv_msg+0xf9/0x3e0
[  438.997339]  ? __netlink_sendskb+0x4c/0x70
[  438.997751]  ? netlink_unicast+0x286/0x2d0
[  438.998171]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10
[  438.998625]  netlink_rcv_skb+0x54/0x100
[  438.999020]  netlink_unicast+0x203/0x2d0
[  438.999421]  netlink_sendmsg+0x1e4/0x420
[  438.999820]  __sock_sendmsg+0xa1/0xb0
[  439.000203]  ____sys_sendmsg+0x207/0x2a0
[  439.000600]  ? copy_msghdr_from_user+0x6d/0xa0
[  439.001072]  ___sys_sendmsg+0x80/0xc0
[  439.001459]  ? ___sys_recvmsg+0x8b/0xc0
[  439.001848]  ? generic_update_time+0x4d/0x60
[  439.002282]  __sys_sendmsg+0x51/0x90
[  439.002658]  do_syscall_64+0x50/0x110
[  439.003040]  entry_SYSCALL_64_after_hwframe+0x76/0x7e

Fixes: 718ce4d601db ("net/mlx5: Consolidate update FTE for all removal changes")
Fixes: cefc23554fc2 ("net/mlx5: Fix FTE cleanup")
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241107183527.676877-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:20:50 +01:00
Reinhard Speyerer
60cea42f5a net: usb: qmi_wwan: add Fibocom FG132 0x0112 composition
[ Upstream commit 64761c980cbf71fb7a532a8c7299907ea972a88c ]

Add Fibocom FG132 0x0112 composition:

T:  Bus=03 Lev=02 Prnt=06 Port=01 Cnt=02 Dev#= 10 Spd=12   MxCh= 0
D:  Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=2cb7 ProdID=0112 Rev= 5.15
S:  Manufacturer=Fibocom Wireless Inc.
S:  Product=Fibocom Module
S:  SerialNumber=xxxxxxxx
C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=86(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>

Link: https://patch.msgid.link/ZxLKp5YZDy-OM0-e@arcor.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:28 +01:00
Ioana Ciornei
b9e9ea8747 net: phy: ti: take into account all possible interrupt sources
commit 73f476aa1975bae6a792b340f5b26ffcfba869a6 upstream.

The previous implementation of .handle_interrupt() did not take into
account the fact that all the interrupt status registers should be
acknowledged since multiple interrupt sources could be asserted.

Fix this by reading all the status registers before exiting with
IRQ_NONE or triggering the PHY state machine.

Fixes: 1d1ae3c6ca3f ("net: phy: ti: implement generic .handle_interrupt() callback")
Reported-by: Sven Schuchmann <schuchmann@schleissheimer.de>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20210226153020.867852-1-ciorneiioana@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:27 +01:00
Johan Jonker
062aa38d5b net: arc: fix the device for dma_map_single/dma_unmap_single
[ Upstream commit 71803c1dfa29e0d13b99e48fda11107cc8caebc7 ]

The ndev->dev and pdev->dev aren't the same device, use ndev->dev.parent
which has dma_mask, ndev->dev.parent is just pdev->dev.
Or it would cause the following issue:

[   39.933526] ------------[ cut here ]------------
[   39.938414] WARNING: CPU: 1 PID: 501 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x90/0x1f8

Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Diogo Silva
7b0cca4552 net: phy: ti: add PHY_RST_AFTER_CLK_EN flag
[ Upstream commit 256748d5480bb3c4b731236c6d6fc86a8e2815d8 ]

DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
make sure that this indication is respected.

In my experience not having this flag enabled would lead to, on some
boots, the wrong MII mode being selected if the PHY was initialized on
the bootloader and was receiving data during Linux boot.

Signed-off-by: Diogo Silva <diogompaissilva@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 34e45ad9378c ("net: phy: dp83848: Add TI DP83848 Ethernet PHY")
Link: https://patch.msgid.link/20241102151504.811306-1-paissilva@ld-100007.ds1.internal
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ioana Ciornei
a2b6d0907f net: phy: ti: implement generic .handle_interrupt() callback
[ Upstream commit 1d1ae3c6ca3ff49843d73852bb2a8153ce16f432 ]

In an attempt to actually support shared IRQs in phylib, we now move the
responsibility of triggering the phylib state machine or just returning
IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
3 different IRQ handling callbacks (.handle_interrupt(),
.did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
driver implement directly an IRQ handler like any other device driver.
Make this driver follow the new convention.

Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 256748d5480b ("net: phy: ti: add PHY_RST_AFTER_CLK_EN flag")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ioana Ciornei
b1c86072e8 net: phy: export phy_error and phy_trigger_machine
[ Upstream commit 293e9a3d950dfebc76d9fa6931e6f91ef856b9ab ]

These functions are currently used by phy_interrupt() to either signal
an error condition or to trigger the link state machine. In an attempt
to actually support shared PHY IRQs, export these two functions so that
the actual PHY drivers can use them.

Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Andre Edich <andre.edich@microchip.com>
Cc: Antoine Tenart <atenart@kernel.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Divya Koppera <Divya.Koppera@microchip.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Mathias Kresin <dev@kresin.me>
Cc: Maxim Kochetkov <fido_max@inbox.ru>
Cc: Michael Walle <michael@walle.cc>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Philippe Schenker <philippe.schenker@toradex.com>
Cc: Willy Liu <willy.liu@realtek.com>
Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 256748d5480b ("net: phy: ti: add PHY_RST_AFTER_CLK_EN flag")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Peiyang Wang
4152c38410 net: hns3: fix kernel crash when uninstalling driver
[ Upstream commit df3dff8ab6d79edc942464999d06fbaedf8cdd18 ]

When the driver is uninstalled and the VF is disabled concurrently, a
kernel crash occurs. The reason is that the two actions call function
pci_disable_sriov(). The num_VFs is checked to determine whether to
release the corresponding resources. During the second calling, num_VFs
is not 0 and the resource release function is called. However, the
corresponding resource has been released during the first invoking.
Therefore, the problem occurs:

[15277.839633][T50670] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
...
[15278.131557][T50670] Call trace:
[15278.134686][T50670]  klist_put+0x28/0x12c
[15278.138682][T50670]  klist_del+0x14/0x20
[15278.142592][T50670]  device_del+0xbc/0x3c0
[15278.146676][T50670]  pci_remove_bus_device+0x84/0x120
[15278.151714][T50670]  pci_stop_and_remove_bus_device+0x6c/0x80
[15278.157447][T50670]  pci_iov_remove_virtfn+0xb4/0x12c
[15278.162485][T50670]  sriov_disable+0x50/0x11c
[15278.166829][T50670]  pci_disable_sriov+0x24/0x30
[15278.171433][T50670]  hnae3_unregister_ae_algo_prepare+0x60/0x90 [hnae3]
[15278.178039][T50670]  hclge_exit+0x28/0xd0 [hclge]
[15278.182730][T50670]  __se_sys_delete_module.isra.0+0x164/0x230
[15278.188550][T50670]  __arm64_sys_delete_module+0x1c/0x30
[15278.193848][T50670]  invoke_syscall+0x50/0x11c
[15278.198278][T50670]  el0_svc_common.constprop.0+0x158/0x164
[15278.203837][T50670]  do_el0_svc+0x34/0xcc
[15278.207834][T50670]  el0_svc+0x20/0x30

For details, see the following figure.

     rmmod hclge              disable VFs
----------------------------------------------------
hclge_exit()            sriov_numvfs_store()
  ...                     device_lock()
  pci_disable_sriov()     hns3_pci_sriov_configure()
                            pci_disable_sriov()
                              sriov_disable()
    sriov_disable()             if !num_VFs :
      if !num_VFs :               return;
        return;                 sriov_del_vfs()
      sriov_del_vfs()             ...
        ...                       klist_put()
        klist_put()               ...
        ...                     num_VFs = 0;
      num_VFs = 0;        device_unlock();

In this patch, when driver is removing, we get the device_lock()
to protect num_VFs, just like sriov_numvfs_store().

Fixes: 0dd8a25f355b ("net: hns3: disable sriov before unload hclge layer")
Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241101091507.3644584-1-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Dario Binacchi
d16db102d1 can: c_can: fix {rx,tx}_errors statistics
[ Upstream commit 4d6d26537940f3b3e17138987ed9e4a334780bf7 ]

The c_can_handle_bus_err() function was incorrectly incrementing only the
receive error counter, even in cases of bit or acknowledgment errors that
occur during transmission. The patch fixes the issue by incrementing the
appropriate counter based on the type of error.

Fixes: 881ff67ad450 ("can: c_can: Added support for Bosch C_CAN controller")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://patch.msgid.link/20241014135319.2009782-1-dario.binacchi@amarulasolutions.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Wei Fang
a704919ef0 net: enetc: set MAC address to the VF net_device
[ Upstream commit badccd49b93bb945bf4e5cc8707db67cdc5e27e5 ]

The MAC address of VF can be configured through the mailbox mechanism of
ENETC, but the previous implementation forgot to set the MAC address in
net_device, resulting in the SMAC of the sent frames still being the old
MAC address. Since the MAC address in the hardware has been changed, Rx
cannot receive frames with the DMAC address as the new MAC address. The
most obvious phenomenon is that after changing the MAC address, we can
see that the MAC address of eno0vf0 has not changed through the "ifconfig
eno0vf0" command and the IP address cannot be obtained .

root@ls1028ardb:~# ifconfig eno0vf0 down
root@ls1028ardb:~# ifconfig eno0vf0 hw ether 00:04:9f:3a:4d:56 up
root@ls1028ardb:~# ifconfig eno0vf0
eno0vf0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 66:36:2c:3b:87:76  txqueuelen 1000  (Ethernet)
        RX packets 794  bytes 69239 (69.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11  bytes 2226 (2.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Fixes: beb74ac878c8 ("enetc: Add vf to pf messaging support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://patch.msgid.link/20241029090406.841836-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ksawlii
a5b7b870fc Revert "net: fec: Refactor: #define magic constants"
This reverts commit 64636f4e88.
2024-11-24 00:23:56 +01:00
Ksawlii
e7b1ec68bc Revert "net: fec: Fix FEC_ECR_EN1588 being cleared on link-down"
This reverts commit 132969266d.
2024-11-24 00:23:56 +01:00
Ksawlii
bfbdef95a1 Revert "wifi: virt_wifi: avoid reporting connection success with wrong SSID"
This reverts commit 1c786f1067.
2024-11-24 00:23:56 +01:00
Ksawlii
4f9bfbe9f1 Revert "wifi: virt_wifi: don't use strlen() in const context"
This reverts commit 8df54fa66a.
2024-11-24 00:23:56 +01:00
Ksawlii
683ecba589 Revert "net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports"
This reverts commit 4324f66a7a.
2024-11-24 00:23:56 +01:00
Ksawlii
2e56e9f4fd Revert "net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports"
This reverts commit 23d58869be.
2024-11-24 00:23:56 +01:00
Ksawlii
d3f5815f54 Revert "wifi: mwifiex: Fix interface type change"
This reverts commit 64663028ab.
2024-11-24 00:23:56 +01:00
Ksawlii
fa72cb31d6 Revert "net: bonding: correctly annotate RCU in bond_should_notify_peers()"
This reverts commit 7dc1b04912.
2024-11-24 00:23:56 +01:00
Ksawlii
32d9b82df9 Revert "net: stmmac: Correct byte order of perfect_match"
This reverts commit 4e35d4a08d.
2024-11-24 00:23:55 +01:00
Ksawlii
eb36756b64 Revert "net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys"
This reverts commit babb23917f.
2024-11-24 00:23:55 +01:00
Ksawlii
9b5b6a7525 Revert "net: usb: qmi_wwan: fix memory leak for not ip packets"
This reverts commit 3789fee8a8.
2024-11-24 00:23:55 +01:00
Ksawlii
97133e2e2e Revert "net: dsa: bcm_sf2: Fix a possible memory leak in bcm_sf2_mdio_register()"
This reverts commit be9d7e8db2.
2024-11-24 00:23:55 +01:00
Ksawlii
5c2a1132c9 Revert "net: fec: Stop PPS on driver remove"
This reverts commit e328279c90.
2024-11-24 00:23:55 +01:00
Ksawlii
0b80835234 Revert "net/mlx5e: Correctly report errors for ethtool rx flows"
This reverts commit a1624526b7.
2024-11-24 00:23:54 +01:00
Ksawlii
11596bfd09 Revert "net: axienet: Fix register defines comment description"
This reverts commit fd86cc6597.
2024-11-24 00:23:54 +01:00
Ksawlii
7dd6e87cff Revert "net: dsa: vsc73xx: pass value in phy_write operation"
This reverts commit 3c0fd5c577.
2024-11-24 00:23:53 +01:00
Ksawlii
f4d0eedded Revert "net: dsa: vsc73xx: use read_poll_timeout instead delay loop"
This reverts commit 98c55bf660.
2024-11-24 00:23:53 +01:00
Ksawlii
36bbae2b95 Revert "net: dsa: vsc73xx: check busy flag in MDIO operations"
This reverts commit 509fc0dcd1.
2024-11-24 00:23:53 +01:00
Ksawlii
29c857027d Revert "net: hns3: fix wrong use of semaphore up"
This reverts commit deb6d455f4.
2024-11-24 00:23:53 +01:00
Ksawlii
39f88f5bf8 Revert "net: hns3: fix a deadlock problem when config TC during resetting"
This reverts commit 26a0b43c4b.
2024-11-24 00:23:53 +01:00
Ksawlii
038863cd84 Revert "wifi: cw1200: Avoid processing an invalid TIM IE"
This reverts commit 045e1a3f2e.
2024-11-24 00:23:53 +01:00
Ksawlii
911ea2912e Revert "wifi: iwlwifi: abort scan when rfkill on but device enabled"
This reverts commit a2e13a5078.
2024-11-24 00:23:53 +01:00
Ksawlii
52f4f64489 Revert "net/sun3_82586: Avoid reading past buffer in debug output"
This reverts commit 70d98df8ea.
2024-11-24 00:23:52 +01:00
Ksawlii
0eeaf7577a Revert "net: hns3: add checking for vf id of mailbox"
This reverts commit 7e18329b75.
2024-11-24 00:23:52 +01:00
Ksawlii
68834d1c47 Revert "bonding: fix bond_ipsec_offload_ok return type"
This reverts commit 38a3a70b3e.
2024-11-24 00:23:51 +01:00
Ksawlii
6de0889cec Revert "bonding: fix null pointer deref in bond_ipsec_offload_ok"
This reverts commit 4552f9f0ae.
2024-11-24 00:23:51 +01:00
Ksawlii
0f85dd45e4 Revert "bonding: fix xfrm real_dev null pointer dereference"
This reverts commit 9fa8811d1a.
2024-11-24 00:23:51 +01:00
Ksawlii
b4e9e5b37a Revert "bonding: fix xfrm state handling when clearing active slave"
This reverts commit 08a3b787ac.
2024-11-24 00:23:51 +01:00
Ksawlii
5036a90d21 Revert "ice: fix ICE_LAST_OFFSET formula"
This reverts commit 9a98cb967c.
2024-11-24 00:23:51 +01:00
Ksawlii
091e8249c6 Revert "net: dsa: mv88e6xxx: read FID when handling ATU violations"
This reverts commit 6fad67a4c7.
2024-11-24 00:23:51 +01:00
Ksawlii
c346f9c457 Revert "net: dsa: mv88e6xxx: replace ATU violation prints with trace points"
This reverts commit f634cf4b40.
2024-11-24 00:23:51 +01:00
Ksawlii
6c2054cc66 Revert "net: dsa: mv88e6xxx: Fix out-of-bound access"
This reverts commit 2230f96d6c.
2024-11-24 00:23:51 +01:00
Ksawlii
6fe606a02b Revert "net: xilinx: axienet: Always disable promiscuous mode"
This reverts commit a7875446c0.
2024-11-24 00:23:51 +01:00
Ksawlii
09bc706e3c Revert "net: xilinx: axienet: Fix dangling multicast addresses"
This reverts commit ae9628b4fa.
2024-11-24 00:23:50 +01:00
Ksawlii
8b24cf4850 Revert "wifi: mwifiex: duplicate static structs used in driver instances"
This reverts commit b610ebf3a2.
2024-11-24 00:23:50 +01:00
Ksawlii
eac4761f23 Revert "gtp: fix a potential NULL pointer dereference"
This reverts commit fa13bd9705.
2024-11-24 00:23:49 +01:00
Ksawlii
4b0722c93f Revert "net: usb: qmi_wwan: add MeiG Smart SRM825L"
This reverts commit 00c231ae05.
2024-11-24 00:23:48 +01:00
Ksawlii
dd0cd80967 Revert "wifi: iwlwifi: remove fw_running op"
This reverts commit 16883bf3ae.
2024-11-24 00:23:48 +01:00
Ksawlii
179a92ca0d Revert "virtio_net: Fix napi_skb_cache_put warning"
This reverts commit a5315ef480.
2024-11-24 00:23:46 +01:00
Ksawlii
1e55dc00f6 Revert "can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open"
This reverts commit bd0d86f91e.
2024-11-24 00:23:45 +01:00
Ksawlii
9c8504d56e Revert "wifi: brcmsmac: advertise MFP_CAPABLE to enable WPA3"
This reverts commit 8ec1b558ee.
2024-11-24 00:23:42 +01:00
Ksawlii
35b8c8834d Revert "igb: Fix not clearing TimeSync interrupts for 82580"
This reverts commit 11b7218c81.
2024-11-24 00:23:42 +01:00
Ksawlii
a4bc5ebe94 Revert "igc: Unlock on error in igc_io_resume()"
This reverts commit d0a818c297.
2024-11-24 00:23:42 +01:00
Ksawlii
27364c06ed Revert "net: usb: don't write directly to netdev->dev_addr"
This reverts commit d16fdd827d.
2024-11-24 00:23:41 +01:00
Ksawlii
24a09ec9d4 Revert "usbnet: modern method to get random MAC"
This reverts commit dd010dbcce.
2024-11-24 00:23:41 +01:00
Ksawlii
2990a48a81 Revert "bareudp: Fix device stats updates."
This reverts commit 831b755d5b.
2024-11-24 00:23:41 +01:00
Ksawlii
e3f85dd1eb Revert "gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers"
This reverts commit c35b04ae63.
2024-11-24 00:23:41 +01:00
Ksawlii
db38998ee6 Revert "gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlers"
This reverts commit db2af80170.
2024-11-24 00:23:41 +01:00
Ksawlii
ddc4bffd5d Revert "net: dsa: vsc73xx: fix possible subblocks range of CAPT block"
This reverts commit d94a0fcfb4.
2024-11-24 00:23:41 +01:00
Ksawlii
8cac0e6819 Revert "wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id()"
This reverts commit 1129f7beb1.
2024-11-24 00:23:40 +01:00
Ksawlii
279241fa19 Revert "net: dpaa: avoid on-stack arrays of NR_CPUS elements"
This reverts commit a0e5358edc.
2024-11-24 00:23:39 +01:00
Ksawlii
54b7a02bce Revert "usbnet: ipheth: race between ipheth_close and error handling"
This reverts commit 806a25636b.
2024-11-24 00:23:39 +01:00
Ksawlii
21aef4054e Revert "usbnet: ipheth: fix carrier detection in modes 1 and 4"
This reverts commit ee4da2f98f.
2024-11-24 00:23:36 +01:00
Ksawlii
13a9224eff Revert "net: ethernet: use ip_hdrlen() instead of bit shift"
This reverts commit e9c6237f35.
2024-11-24 00:23:36 +01:00
Ksawlii
dda6252518 Revert "net: phy: vitesse: repair vsc73xx autonegotiation"
This reverts commit 7ba04fa7a8.
2024-11-24 00:23:36 +01:00
Ksawlii
1ba1b1e7b3 Revert "ice: fix accounting for filters shared by multiple VSIs"
This reverts commit 14c7602518.
2024-11-24 00:23:35 +01:00
Ksawlii
4f4fca3a0f Revert "net/mlx5: Update the list of the PCI supported devices"
This reverts commit 5faf98b4ac.
2024-11-24 00:23:34 +01:00
Ksawlii
551674c42e Revert "net/mlx5e: Add missing link modes to ptys2ethtool_map"
This reverts commit e25fd0c3e1.
2024-11-24 00:23:34 +01:00
Ksawlii
d85c07139d Revert "net: ftgmac100: Enable TX interrupt to avoid TX timeout"
This reverts commit eb248351db.
2024-11-24 00:23:34 +01:00
Ksawlii
b73b428f1d Revert "net: dpaa: Pad packets to ETH_ZLEN"
This reverts commit 3ad5828caa.
2024-11-24 00:23:34 +01:00
Ksawlii
d4c68e1fc4 Revert "net: ftgmac100: Ensure tx descriptor updates are visible"
This reverts commit f48cec25ee.
2024-11-24 00:23:33 +01:00
Ksawlii
41c096fbd1 Revert "wifi: iwlwifi: lower message level for FW buffer destination"
This reverts commit 5b1fe09fed.
2024-11-24 00:23:33 +01:00
Ksawlii
b93dfe3647 Revert "wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead"
This reverts commit 793a26784e.
2024-11-24 00:23:33 +01:00
Ksawlii
24c95b7dbb Revert "wifi: rtw88: always wait for both firmware loading attempts"
This reverts commit 5dbdf4c053.
2024-11-24 00:23:31 +01:00
Ksawlii
13ab2b7319 Revert "wifi: mt76: mt7915: fix rx filter setting for bfee functionality"
This reverts commit 0781d356c3.
2024-11-24 00:23:30 +01:00
Ksawlii
c22bb3d377 Revert "wifi: wilc1000: fix potential RCU dereference issue in wilc_parse_join_bss_param"
This reverts commit 42ac5e3f69.
2024-11-24 00:23:30 +01:00
Ksawlii
c1863deede Revert "can: m_can: Add support for transceiver as phy"
This reverts commit b4f694a5c6.
2024-11-24 00:23:29 +01:00
Ksawlii
ee1b3b5b8c Revert "can: m_can: m_can_close(): stop clocks after device has been shut down"
This reverts commit 0fd677f8d4.
2024-11-24 00:23:29 +01:00
Ksawlii
5ca325c27a Revert "bareudp: allow redirecting bareudp packets to eth devices"
This reverts commit 854b84d157.
2024-11-24 00:23:29 +01:00
Ksawlii
5162dabdcb Revert "bareudp: Pull inner IP header in bareudp_udp_encap_recv()."
This reverts commit 626bcd6901.
2024-11-24 00:23:29 +01:00
Ksawlii
bd030fa7ad Revert "net: geneve: support IPv4/IPv6 as inner protocol"
This reverts commit 0315c150d1.
2024-11-24 00:23:29 +01:00
Ksawlii
05b6109631 Revert "geneve: Fix incorrect inner network header offset when innerprotoinherit is set"
This reverts commit 08dc6b0262.
2024-11-24 00:23:29 +01:00
Ksawlii
f09a4f8481 Revert "bareudp: Pull inner IP header on xmit."
This reverts commit ef79bbcf95.
2024-11-24 00:23:29 +01:00
Ksawlii
1107016b02 Revert "net: enetc: Use IRQF_NO_AUTOEN flag in request_irq()"
This reverts commit e356dcea7c.
2024-11-24 00:23:29 +01:00
Ksawlii
cb6b405833 Revert "r8169: disable ALDPS per default for RTL8125"
This reverts commit b64d3334b9.
2024-11-24 00:23:29 +01:00
Ksawlii
cca2e810e8 Revert "net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition"
This reverts commit 2168093ef8.
2024-11-24 00:23:18 +01:00
Ksawlii
7948f1fe22 Revert "wifi: rtw88: 8822c: Fix reported RX band width"
This reverts commit 3240476a5b.
2024-11-24 00:23:16 +01:00
Ksawlii
b3f227d379 Revert "ieee802154: Fix build error"
This reverts commit a902682431.
2024-11-24 00:23:12 +01:00
Ksawlii
ade1083a2d Revert "net/mlx5: Fix error path in multi-packet WQE transmit"
This reverts commit 270ecc4364.
2024-11-24 00:23:12 +01:00
Ksawlii
318078984c Revert "net/mlx5: Added cond_resched() to crdump collection"
This reverts commit 4d839c06f8.
2024-11-24 00:23:12 +01:00
Ksawlii
3ffa22465c Revert "net: ieee802154: mcr20a: Use IRQF_NO_AUTOEN flag in request_irq()"
This reverts commit dfd74b3f20.
2024-11-24 00:23:12 +01:00
Ksawlii
d422a0435b Revert "net: ethernet: lantiq_etop: fix memory disclosure"
This reverts commit 9274ce290d.
2024-11-24 00:23:12 +01:00
Ksawlii
1b23c4f488 Revert "wifi: ath9k: fix possible integer overflow in ath9k_get_et_stats()"
This reverts commit 011f778de0.
2024-11-24 00:23:10 +01:00
Ksawlii
0b1f278e92 Revert "wifi: ath9k_htc: Use __skb_set_length() for resetting urb before resubmit"
This reverts commit d6155048f0.
2024-11-24 00:23:10 +01:00
Ksawlii
5a67c02dd6 Revert "ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node()"
This reverts commit 30705ece9d.
2024-11-24 00:23:10 +01:00
Ksawlii
6c30036842 Revert "net/xen-netback: prevent UAF in xenvif_flush_hash()"
This reverts commit fcc9e6b2eb.
2024-11-24 00:23:10 +01:00
Ksawlii
312c6c6837 Revert "net: hisilicon: hip04: fix OF node leak in probe()"
This reverts commit 894592fa8b.
2024-11-24 00:23:10 +01:00