rk: revert 20f3d0b+v3.0.66 to v3.0
[firefly-linux-kernel-4.4.55.git] / kernel / module.c
index a8bd2151b54c7a1fa79a83b31c5a90b2b82a6895..795bdc7f5c3f270301abcb56e2f787550f36c6b9 100644 (file)
@@ -2290,7 +2290,8 @@ static int copy_and_check(struct load_info *info,
                return -ENOEXEC;
 
        /* Suck in entire file: we'll want most of it. */
-       if ((hdr = vmalloc(len)) == NULL)
+       /* vmalloc barfs on "unusual" numbers.  Check here */
+       if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
                return -ENOMEM;
 
        if (copy_from_user(hdr, umod, len) != 0) {
@@ -2605,10 +2606,6 @@ static int check_module_license_and_versions(struct module *mod)
        if (strcmp(mod->name, "driverloader") == 0)
                add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 
-       /* lve claims to be GPL but upstream won't provide source */
-       if (strcmp(mod->name, "lve") == 0)
-               add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
-
 #ifdef CONFIG_MODVERSIONS
        if ((mod->num_syms && !mod->crcs)
            || (mod->num_gpl_syms && !mod->gpl_crcs)