diff options
| -rw-r--r-- | kernel/module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 250092c1d57d..41bc1189b061 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -2527,6 +2527,13 @@ static int copy_module_from_fd(int fd, struct load_info *info) | |||
| 2527 | err = -EFBIG; | 2527 | err = -EFBIG; |
| 2528 | goto out; | 2528 | goto out; |
| 2529 | } | 2529 | } |
| 2530 | |||
| 2531 | /* Don't hand 0 to vmalloc, it whines. */ | ||
| 2532 | if (stat.size == 0) { | ||
| 2533 | err = -EINVAL; | ||
| 2534 | goto out; | ||
| 2535 | } | ||
| 2536 | |||
| 2530 | info->hdr = vmalloc(stat.size); | 2537 | info->hdr = vmalloc(stat.size); |
| 2531 | if (!info->hdr) { | 2538 | if (!info->hdr) { |
| 2532 | err = -ENOMEM; | 2539 | err = -ENOMEM; |
