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 @@ -2209,6 +2209,13 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22092209 size = (rx_cmd_a & RX_CMD_A_LEN ) - RXW_PADDING ;
22102210 align_count = (4 - ((size + RXW_PADDING ) % 4 )) % 4 ;
22112211
2212+ if (unlikely (size > skb -> len )) {
2213+ netif_dbg (dev , rx_err , dev -> net ,
2214+ "size err rx_cmd_a=0x%08x\n" ,
2215+ rx_cmd_a );
2216+ return 0 ;
2217+ }
2218+
22122219 if (unlikely (rx_cmd_a & RX_CMD_A_RED )) {
22132220 netif_dbg (dev , rx_err , dev -> net ,
22142221 "Error rx_cmd_a=0x%08x\n" , rx_cmd_a );
@@ -2221,8 +2228,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22212228 dev -> net -> stats .rx_frame_errors ++ ;
22222229 } else {
22232230 /* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
2224- if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ) ||
2225- size > skb -> len )) {
2231+ if (unlikely (size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12 ))) {
22262232 netif_dbg (dev , rx_err , dev -> net ,
22272233 "size err rx_cmd_a=0x%08x\n" ,
22282234 rx_cmd_a );
You can’t perform that action at this time.
0 commit comments