summaryrefslogtreecommitdiffstats
path: root/net/phonet
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2008-11-16 19:48:49 -0800
committerDavid S. Miller <davem@davemloft.net>2008-11-16 19:48:49 -0800
commitebfe92ca65c780334bdf847ddc4eca15835bd9c0 (patch)
tree6def944664e96f8394bcc9e268c5ee8e9d64ee16 /net/phonet
parenteb7c3adb1ca92450870dbb0d347fc986cd5e2af4 (diff)
downloadop-kernel-dev-ebfe92ca65c780334bdf847ddc4eca15835bd9c0.zip
op-kernel-dev-ebfe92ca65c780334bdf847ddc4eca15835bd9c0.tar.gz
Phonet: refuse to send bigger than MTU packets
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet')
-rw-r--r--net/phonet/af_phonet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index defeb7a..7ab30f6 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;
}
OpenPOWER on IntegriCloud