On Fri, Jul 10, 2020 at 03:10:25PM -0700, Scott Branden wrote:I don't consider this a complete fix as there may be other callers which do not initialize
Thanks for the diagnosis and fix! I haven't had time to cycle back
On 2020-07-10 3:04 p.m., Matthew Wilcox wrote:
On Fri, Jul 10, 2020 at 02:00:32PM -0700, Scott Branden wrote:Yes, but there's no requirement that *buf need to be NULL when calling this
Did it give you a stack backtrace?@@ -950,8 +951,8 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size,The assumption that *buf is always NULL when id !=
goto out;
}
- if (id != READING_FIRMWARE_PREALLOC_BUFFER)
- *buf = vmalloc(i_size);
+ if (!*buf)
READING_FIRMWARE_PREALLOC_BUFFER doesn't appear to be correct.
I get unhandled page faults due to this change on boot.
function.
To fix my particular crash I added the following locally:
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3989,7 +3989,7 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char
__user *, uargs, int, flags)
Â{
ÂÂÂÂ struct load_info info = { };
ÂÂÂÂ loff_t size;
-ÂÂÂ void *hdr;
+ÂÂÂ void *hdr = NULL;
ÂÂÂÂ int err;
ÂÂÂÂ err = may_init_module();
around to this series yet. Hopefully soon. :)