Skip to content

Commit 2224409

Browse files
julianwiedmanndavem330
authored andcommitted
net/af_iucv: drop inbound packets with invalid flags
Inbound packets may have any combination of flag bits set in their iucv header. If we don't know how to handle a specific combination, drop the skb instead of leaking it. To clarify what error is returned in this case, replace the hard-coded 0 with the corresponding macro. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ee28bb5 commit 2224409

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/iucv/af_iucv.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,8 +2155,8 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
21552155
struct sock *sk;
21562156
struct iucv_sock *iucv;
21572157
struct af_iucv_trans_hdr *trans_hdr;
2158+
int err = NET_RX_SUCCESS;
21582159
char nullstring[8];
2159-
int err = 0;
21602160

21612161
if (skb->len < (ETH_HLEN + sizeof(struct af_iucv_trans_hdr))) {
21622162
WARN_ONCE(1, "AF_IUCV too short skb, len=%d, min=%d",
@@ -2254,7 +2254,7 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
22542254
err = afiucv_hs_callback_rx(sk, skb);
22552255
break;
22562256
default:
2257-
;
2257+
kfree_skb(skb);
22582258
}
22592259

22602260
return err;

0 commit comments

Comments
 (0)