]> xenbits.xensource.com Git - arm/linux.git/commitdiff
um: Add checks to mtu parameter parsing
authorAnton Ivanov <anton.ivanov@cambridgegreys.com>
Fri, 9 Aug 2019 07:40:19 +0000 (08:40 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 15 Sep 2019 19:37:09 +0000 (21:37 +0200)
Adds a sanity check to the parsing of mtu command line param

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_kern.c

index 8fa094770965b7982aff36216bbd3ab26b792321..45ec9bc2430fbaf1710a3a0b5070620c98d3a807 100644 (file)
@@ -121,7 +121,8 @@ static int get_mtu(struct arglist *def)
 
        if (mtu != NULL) {
                if (kstrtoul(mtu, 10, &result) == 0)
-                       return result;
+                       if ((result < (1 << 16) - 1) && (result >= 576))
+                               return result;
        }
        return ETH_MAX_PACKET;
 }