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 @@ -2205,6 +2205,13 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22052205 size = (rx_cmd_a & RX_CMD_A_LEN ) - RXW_PADDING ;
22062206 align_count = (4 - ((size + RXW_PADDING ) % 4 )) % 4 ;
22072207
2208+ if (unlikely (size > skb -> len )) {
2209+ netif_dbg (dev , rx_err , dev -> net ,
2210+ "size err rx_cmd_a=0x%08x\n" ,
2211+ rx_cmd_a );
2212+ return 0 ;
2213+ }
2214+
22082215 if (unlikely (rx_cmd_a & RX_CMD_A_RED )) {
22092216 netif_dbg (dev , rx_err , dev -> net ,
22102217 "Error rx_cmd_a=0x%08x\n" , rx_cmd_a );
@@ -2217,8 +2224,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22172224 dev -> net -> stats .rx_frame_errors ++ ;
22182225 } else {
22192226 /* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
2220- if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ) ||
2221- size > skb -> len )) {
2227+ if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ))) {
22222228 netif_dbg (dev , rx_err , dev -> net ,
22232229 "size err rx_cmd_a=0x%08x\n" ,
22242230 rx_cmd_a );
You can’t perform that action at this time.
0 commit comments