From: Rémi Denis-Courmont Date: Mon, 17 Nov 2008 03:48:49 +0000 (-0800) Subject: Phonet: refuse to send bigger than MTU packets X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ebfe92ca65c780334bdf847ddc4eca15835bd9c0;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Phonet: refuse to send bigger than MTU packets Signed-off-by: Rémi Denis-Courmont Signed-off-by: David S. Miller --- diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index defeb7a0d50..7ab30f668b5 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c @@ -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; }