diff --git a/[refs] b/[refs] index 56180f9cab58..4137732b4778 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4953fe6c4aeada2d5cafd78aa97587a46d2d8f9 +refs/heads/master: 52441fa8f2f1ccc9fa97607c6ccf8b46b9fd15ae diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index 250092c1d57d..41bc1189b061 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -2527,6 +2527,13 @@ static int copy_module_from_fd(int fd, struct load_info *info) err = -EFBIG; goto out; } + + /* Don't hand 0 to vmalloc, it whines. */ + if (stat.size == 0) { + err = -EINVAL; + goto out; + } + info->hdr = vmalloc(stat.size); if (!info->hdr) { err = -ENOMEM;