* [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e)
@ 2023-12-13 22:08 Tony Nguyen
2023-12-13 22:08 ` [PATCH net 1/2] ice: fix theoretical out-of-bounds access in ethtool link modes Tony Nguyen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-12-13 22:08 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen
This series contains updates to ice and i40e drivers.
Michal Schmidt prevents possible out-of-bounds access for ice.
Ivan Vecera corrects value for MDIO clause 45 on i40e.
The following are changes since commit 810c38a369a0a0ce625b5c12169abce1dd9ccd53:
net/rose: Fix Use-After-Free in rose_ioctl
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Ivan Vecera (1):
i40e: Fix ST code value for Clause 45
Michal Schmidt (1):
ice: fix theoretical out-of-bounds access in ethtool link modes
drivers/net/ethernet/intel/i40e/i40e_register.h | 2 +-
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++--
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] ice: fix theoretical out-of-bounds access in ethtool link modes
2023-12-13 22:08 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) Tony Nguyen
@ 2023-12-13 22:08 ` Tony Nguyen
2023-12-13 22:08 ` [PATCH net 2/2] i40e: Fix ST code value for Clause 45 Tony Nguyen
2023-12-15 3:10 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-12-13 22:08 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Michal Schmidt, anthony.l.nguyen, Przemek Kitszel, Simon Horman,
Pucha Himasekhar Reddy
From: Michal Schmidt <mschmidt@redhat.com>
To map phy types reported by the hardware to ethtool link mode bits,
ice uses two lookup tables (phy_type_low_lkup, phy_type_high_lkup).
The "low" table has 64 elements to cover every possible bit the hardware
may report, but the "high" table has only 13. If the hardware reports a
higher bit in phy_types_high, the driver would access memory beyond the
lookup table's end.
Instead of iterating through all 64 bits of phy_types_{low,high}, use
the sizes of the respective lookup tables.
Fixes: 9136e1f1e5c3 ("ice: refactor PHY type to ethtool link mode")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index a34083567e6f..bde9bc74f928 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1850,14 +1850,14 @@ ice_phy_type_to_ethtool(struct net_device *netdev,
linkmode_zero(ks->link_modes.supported);
linkmode_zero(ks->link_modes.advertising);
- for (i = 0; i < BITS_PER_TYPE(u64); i++) {
+ for (i = 0; i < ARRAY_SIZE(phy_type_low_lkup); i++) {
if (phy_types_low & BIT_ULL(i))
ice_linkmode_set_bit(&phy_type_low_lkup[i], ks,
req_speeds, advert_phy_type_lo,
i);
}
- for (i = 0; i < BITS_PER_TYPE(u64); i++) {
+ for (i = 0; i < ARRAY_SIZE(phy_type_high_lkup); i++) {
if (phy_types_high & BIT_ULL(i))
ice_linkmode_set_bit(&phy_type_high_lkup[i], ks,
req_speeds, advert_phy_type_hi,
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] i40e: Fix ST code value for Clause 45
2023-12-13 22:08 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) Tony Nguyen
2023-12-13 22:08 ` [PATCH net 1/2] ice: fix theoretical out-of-bounds access in ethtool link modes Tony Nguyen
@ 2023-12-13 22:08 ` Tony Nguyen
2023-12-15 3:10 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-12-13 22:08 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Ivan Vecera, anthony.l.nguyen, Jacob Keller, Simon Horman,
Pucha Himasekhar Reddy
From: Ivan Vecera <ivecera@redhat.com>
ST code value for clause 45 that has been changed by
commit 8196b5fd6c73 ("i40e: Refactor I40E_MDIO_CLAUSE* macros")
is currently wrong.
The mentioned commit refactored ..MDIO_CLAUSE??_STCODE_MASK so
their value is the same for both clauses. The value is correct
for clause 22 but not for clause 45.
Fix the issue by adding a parameter to I40E_GLGEN_MSCA_STCODE_MASK
macro that specifies required value.
Fixes: 8196b5fd6c73 ("i40e: Refactor I40E_MDIO_CLAUSE* macros")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_register.h | 2 +-
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h
index f408fcf23ce8..f6671ac79735 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_register.h
@@ -207,7 +207,7 @@
#define I40E_GLGEN_MSCA_OPCODE_SHIFT 26
#define I40E_GLGEN_MSCA_OPCODE_MASK(_i) I40E_MASK(_i, I40E_GLGEN_MSCA_OPCODE_SHIFT)
#define I40E_GLGEN_MSCA_STCODE_SHIFT 28
-#define I40E_GLGEN_MSCA_STCODE_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_STCODE_SHIFT)
+#define I40E_GLGEN_MSCA_STCODE_MASK(_i) I40E_MASK(_i, I40E_GLGEN_MSCA_STCODE_SHIFT)
#define I40E_GLGEN_MSCA_MDICMD_SHIFT 30
#define I40E_GLGEN_MSCA_MDICMD_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDICMD_SHIFT)
#define I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT 31
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index aff6dc6afbe2..f95bc2a4a838 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -37,11 +37,11 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
#define I40E_QTX_CTL_VM_QUEUE 0x1
#define I40E_QTX_CTL_PF_QUEUE 0x2
-#define I40E_MDIO_CLAUSE22_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK
+#define I40E_MDIO_CLAUSE22_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK(1)
#define I40E_MDIO_CLAUSE22_OPCODE_WRITE_MASK I40E_GLGEN_MSCA_OPCODE_MASK(1)
#define I40E_MDIO_CLAUSE22_OPCODE_READ_MASK I40E_GLGEN_MSCA_OPCODE_MASK(2)
-#define I40E_MDIO_CLAUSE45_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK
+#define I40E_MDIO_CLAUSE45_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK(0)
#define I40E_MDIO_CLAUSE45_OPCODE_ADDRESS_MASK I40E_GLGEN_MSCA_OPCODE_MASK(0)
#define I40E_MDIO_CLAUSE45_OPCODE_WRITE_MASK I40E_GLGEN_MSCA_OPCODE_MASK(1)
#define I40E_MDIO_CLAUSE45_OPCODE_READ_MASK I40E_GLGEN_MSCA_OPCODE_MASK(3)
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e)
2023-12-13 22:08 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) Tony Nguyen
2023-12-13 22:08 ` [PATCH net 1/2] ice: fix theoretical out-of-bounds access in ethtool link modes Tony Nguyen
2023-12-13 22:08 ` [PATCH net 2/2] i40e: Fix ST code value for Clause 45 Tony Nguyen
@ 2023-12-15 3:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-15 3:10 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev
Hello:
This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:
On Wed, 13 Dec 2023 14:08:24 -0800 you wrote:
> This series contains updates to ice and i40e drivers.
>
> Michal Schmidt prevents possible out-of-bounds access for ice.
>
> Ivan Vecera corrects value for MDIO clause 45 on i40e.
>
> The following are changes since commit 810c38a369a0a0ce625b5c12169abce1dd9ccd53:
> net/rose: Fix Use-After-Free in rose_ioctl
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
>
> [...]
Here is the summary with links:
- [net,1/2] ice: fix theoretical out-of-bounds access in ethtool link modes
https://git.kernel.org/netdev/net/c/91f9181c7381
- [net,2/2] i40e: Fix ST code value for Clause 45
https://git.kernel.org/netdev/net/c/9b3daf2b0443
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-15 3:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 22:08 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) Tony Nguyen
2023-12-13 22:08 ` [PATCH net 1/2] ice: fix theoretical out-of-bounds access in ethtool link modes Tony Nguyen
2023-12-13 22:08 ` [PATCH net 2/2] i40e: Fix ST code value for Clause 45 Tony Nguyen
2023-12-15 3:10 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-12-13 (ice, i40e) patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).