2.1.21-patch_module.c-2, insmod "QM_SYMBOL: bad address"

Keith Owens (kaos@ocs.com.au)
Fri, 17 Jan 1997 12:36:55 +1100


Sorry about this, -1 had the wrong diff output :(.

After loading a module with more than 128 exported symbols (say
sound.o), all other insmods fail with "QM_SYMBOL: bad address".
qm_symbols gives a premature -EFAULT if the buffer is too small,
instead of telling the caller how big the buffer should be.

--- linux/kernel/module.c.orig Wed Jan 15 16:20:35 1997
+++ linux/kernel/module.c Fri Jan 17 12:30:29 1997
@@ -528,14 +528,14 @@

space = mod->nsyms * 2*sizeof(void *);

- if (!access_ok(VERIFY_WRITE, buf, space))
- return -EFAULT;
-
i = len = 0;
s = mod->syms;

if (space > bufsize)
goto calc_space_needed;
+
+ if (!access_ok(VERIFY_WRITE, buf, space))
+ return -EFAULT;

bufsize -= space;
vals = (unsigned long *)buf;