diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2015-03-23 22:01:40 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-03-23 22:02:37 -0400 |
commit | cc9e605dc6cb2e32fedae4ac2f61ad3b5f8d623d (patch) | |
tree | cdc55e6352c7cb5766f3784ef867165ad5dc7737 /kernel | |
parent | 7b63c3ab9b10b8a9cdc6b3a9e0e3d6a8a5d28970 (diff) |
module: do not print allocation-fail warning on bogus user buffer size
init_module(2) passes user-specified buffer length directly to
vmalloc(). It makes warn_alloc_failed() to print out a lot of info into
dmesg if user specified insane size, like -1.
Let's silence the warning. It doesn't add much value to -ENOMEM return
code. Without the patch the syscall is prohibitive noisy for testing
with trinity.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c index 3ab942f78760..65bd206e04a9 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2494,7 +2494,8 @@ static int copy_module_from_user(const void __user *umod, unsigned long len, | |||
2494 | return err; | 2494 | return err; |
2495 | 2495 | ||
2496 | /* Suck in entire file: we'll want most of it. */ | 2496 | /* Suck in entire file: we'll want most of it. */ |
2497 | info->hdr = vmalloc(info->len); | 2497 | info->hdr = __vmalloc(info->len, |
2498 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN, PAGE_KERNEL); | ||
2498 | if (!info->hdr) | 2499 | if (!info->hdr) |
2499 | return -ENOMEM; | 2500 | return -ENOMEM; |
2500 | 2501 | ||