Skip to content

Commit aee509a

Browse files
committed
Merge: igb: set max size RX buffer when store bad packet is enabled
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3308 JIRA: https://issues.redhat.com/browse/RHEL-15192 CVE: CVE-2023-45871 commit bb5ed01 Author: Radoslaw Tyl <[email protected]> Date: Thu Aug 24 13:46:19 2023 -0700 igb: set max size RX buffer when store bad packet is enabled 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]> Signed-off-by: Wander Lairson Costa <[email protected]> Approved-by: Michal Schmidt <[email protected]> Approved-by: John B. Wyatt IV <[email protected]> Signed-off-by: Jan Stancek <[email protected]>
2 parents 063f72e + 3892a9d commit aee509a

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
@@ -4779,6 +4779,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
47794779
static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
47804780
struct igb_ring *rx_ring)
47814781
{
4782+
#if (PAGE_SIZE < 8192)
4783+
struct e1000_hw *hw = &adapter->hw;
4784+
#endif
4785+
47824786
/* set build_skb and buffer size flags */
47834787
clear_ring_build_skb_enabled(rx_ring);
47844788
clear_ring_uses_large_buffer(rx_ring);
@@ -4789,10 +4793,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
47894793
set_ring_build_skb_enabled(rx_ring);
47904794

47914795
#if (PAGE_SIZE < 8192)
4792-
if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
4793-
return;
4794-
4795-
set_ring_uses_large_buffer(rx_ring);
4796+
if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
4797+
rd32(E1000_RCTL) & E1000_RCTL_SBP)
4798+
set_ring_uses_large_buffer(rx_ring);
47964799
#endif
47974800
}
47984801

0 commit comments

Comments
 (0)