lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091207144922.GD8073@hmsreliant.think-freely.org>
Date:	Mon, 7 Dec 2009 09:49:22 -0500
From:	Neil Horman <nhorman@...driver.com>
To:	netdev@...r.kernel.org, e1000-devel@...ts.sourceforge.net
Cc:	davem@...emloft.net, jeffrey.t.kirsher@...el.com,
	jesse.brandeburg@...el.com, bruce.w.allan@...el.com,
	peter.p.waskiewicz.jr@...el.com, john.ronciak@...el.com
Subject: Re: [PATCH 3/3] ixgb: increase skb size to prevent dma over skb
	boundary

Update xgb driver to not allow dma beyond the end of the allocated skb
    
Signed-off-by: Neil Horman <nhorman@...driver.com>

ixgb_main.c |   13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index bcd0f01..2d8e699 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -798,14 +798,19 @@ ixgb_setup_rctl(struct ixgb_adapter *adapter)
 
 	rctl |= IXGB_RCTL_SECRC;
 
-	if (adapter->rx_buffer_len <= IXGB_RXBUFFER_2048)
+	if (adapter->rx_buffer_len <= IXGB_RXBUFFER_2048) {
 		rctl |= IXGB_RCTL_BSIZE_2048;
-	else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_4096)
+		adapter->rx_buffer_len = IXGB_RXBUFFER_2048;
+	} else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_4096) {
 		rctl |= IXGB_RCTL_BSIZE_4096;
-	else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_8192)
+		adapter->rx_buffer_len = IXGB_RXBUFFER_4096;
+	} else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_8192) {
 		rctl |= IXGB_RCTL_BSIZE_8192;
-	else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_16384)
+		adapter->rx_buffer_len = IXGB_RXBUFFER_8192;
+	} else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_16384) {
 		rctl |= IXGB_RCTL_BSIZE_16384;
+		adapter->rx_buffer_len = IXGB_RXBUFFER_16384;
+	}
 
 	IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ