File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2199,6 +2199,13 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
21992199 size = (rx_cmd_a & RX_CMD_A_LEN ) - RXW_PADDING ;
22002200 align_count = (4 - ((size + RXW_PADDING ) % 4 )) % 4 ;
22012201
2202+ if (unlikely (size > skb -> len )) {
2203+ netif_dbg (dev , rx_err , dev -> net ,
2204+ "size err rx_cmd_a=0x%08x\n" ,
2205+ rx_cmd_a );
2206+ return 0 ;
2207+ }
2208+
22022209 if (unlikely (rx_cmd_a & RX_CMD_A_RED )) {
22032210 netif_dbg (dev , rx_err , dev -> net ,
22042211 "Error rx_cmd_a=0x%08x\n" , rx_cmd_a );
@@ -2211,8 +2218,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22112218 dev -> net -> stats .rx_frame_errors ++ ;
22122219 } else {
22132220 /* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
2214- if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ) ||
2215- size > skb -> len )) {
2221+ if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ))) {
22162222 netif_dbg (dev , rx_err , dev -> net ,
22172223 "size err rx_cmd_a=0x%08x\n" ,
22182224 rx_cmd_a );
You can’t perform that action at this time.
0 commit comments