Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebfe92ca authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by David S. Miller
Browse files

Phonet: refuse to send bigger than MTU packets

parent eb7c3adb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -144,8 +144,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
	struct phonethdr *ph;
	int err;

	if (skb->len + 2 > 0xffff) {
		/* Phonet length field would overflow */
	if (skb->len + 2 > 0xffff /* Phonet length field limit */ ||
	    skb->len + sizeof(struct phonethdr) > dev->mtu) {
		err = -EMSGSIZE;
		goto drop;
	}