Skip to content

Commit 07a3a10

Browse files
pvts-matbmastbergen
authored andcommitted
igb: set max size RX buffer when store bad packet is enabled
jira VULN-6695 cve CVE-2023-45871 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: Marcin Wcisło <[email protected]>
1 parent 37583b9 commit 07a3a10

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
@@ -4733,6 +4733,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
47334733
static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
47344734
struct igb_ring *rx_ring)
47354735
{
4736+
#if (PAGE_SIZE < 8192)
4737+
struct e1000_hw *hw = &adapter->hw;
4738+
#endif
4739+
47364740
/* set build_skb and buffer size flags */
47374741
clear_ring_build_skb_enabled(rx_ring);
47384742
clear_ring_uses_large_buffer(rx_ring);
@@ -4743,10 +4747,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
47434747
set_ring_build_skb_enabled(rx_ring);
47444748

47454749
#if (PAGE_SIZE < 8192)
4746-
if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
4747-
return;
4748-
4749-
set_ring_uses_large_buffer(rx_ring);
4750+
if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
4751+
rd32(E1000_RCTL) & E1000_RCTL_SBP)
4752+
set_ring_uses_large_buffer(rx_ring);
47504753
#endif
47514754
}
47524755

0 commit comments

Comments
 (0)