Skip to content

Commit d3573f5

Browse files
committed
igb: set max size RX buffer when store bad packet is enabled
jira LE-1907 cve CVE-2023-45871 Rebuild_History Non-Buildable kernel-3.10.0-1160.118.1.el7 commit-author Radoslaw Tyl <[email protected]> commit bb5ed01 Increase the RX buffer size to 3K when the SBP bit is on. The size of the RX buffer determines the number of pages allocated which may not be sufficient for receive frames larger than the set MTU size. Cc: [email protected] Fixes: 89eaefb ("igb: Support RX-ALL feature flag.") Reported-by: Manfred Rudigier <[email protected]> Signed-off-by: Radoslaw Tyl <[email protected]> Tested-by: Arpana Arland <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit bb5ed01) Signed-off-by: Jonathan Maple <[email protected]>
1 parent b66322f commit d3573f5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4576,6 +4576,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
45764576
static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
45774577
struct igb_ring *rx_ring)
45784578
{
4579+
#if (PAGE_SIZE < 8192)
4580+
struct e1000_hw *hw = &adapter->hw;
4581+
#endif
4582+
45794583
/* set build_skb and buffer size flags */
45804584
clear_ring_build_skb_enabled(rx_ring);
45814585
clear_ring_uses_large_buffer(rx_ring);
@@ -4586,10 +4590,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
45864590
set_ring_build_skb_enabled(rx_ring);
45874591

45884592
#if (PAGE_SIZE < 8192)
4589-
if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
4590-
return;
4591-
4592-
set_ring_uses_large_buffer(rx_ring);
4593+
if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
4594+
rd32(E1000_RCTL) & E1000_RCTL_SBP)
4595+
set_ring_uses_large_buffer(rx_ring);
45934596
#endif
45944597
}
45954598

0 commit comments

Comments
 (0)