lkml.org 
[lkml]   [1996]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: fix for the module problems in 2.1.11

On Tue, 19 Nov 1996, Bernhard Rosenkraenzer wrote:

> On Tue, 19 Nov 1996, David S. Miller wrote:
>
> > This should clear up everything people are reporting with 2.1.11
> >
>
> It doesn't.
> I'm using modules-2.1.8 with the patch that went through the list, and the
> 2.1.11 kernel with your patch applied.

[snip]

As it seems nobody has a proper solution to this problem, here is my
interim hack to allow modules loading. Remember, this is a _hack_, not a
real solution, and should be regarded as such.

Patch follows...

--- linux/kernel/module.c.orig Mon Nov 18 21:13:09 1996
+++ linux/kernel/module.c Tue Nov 19 03:02:49 1996
@@ -85,7 +85,8 @@
is too long, but that we couldn't detect real faults then.
Maybe strncpy_from_user() should return -EBIG, when
the source string is too long. */
- return strncpy_from_user(buf, user_name, MOD_MAX_NAME);
+ strncpy_from_user(buf, user_name, MOD_MAX_NAME);
+ return 0;
}


@@ -106,7 +107,7 @@
return -EPERM;
if (module_name == NULL || size == 0)
return -EINVAL;
- if ((error = get_mod_name(module_name, name)) != 0)
+ if ((error = get_mod_name(module_name, name)) < 0)
return error;
if (find_module(name) != NULL) {
return -EEXIST;
@@ -168,7 +169,7 @@
symtab = NULL;
}
#endif
- if ((error = get_mod_name(module_name, name)) != 0)
+ if ((error = get_mod_name(module_name, name)) < 0)
return error;
pr_debug("initializing module `%s', %d (0x%x) bytes\n",
name, codesize, codesize);
@@ -292,7 +293,7 @@
return -EPERM;
/* else */
if (module_name != NULL) {
- if ((error = get_mod_name(module_name, name)) != 0)
+ if ((error = get_mod_name(module_name, name)) < 0)
return error;
if ((mp = find_module(name)) == NULL)
return -ENOENT;


Ionut

--
Ionut Badulescu - Columbia College '98 E-mail:ib42@columbia.edu
Phone: (212)853-7875 Snail mail: 4A4 Wallach Hall
Fax: (212)695-5560 1116 Amsterdam Ave
PGP key available on request New York, NY 10027
It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.



\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.205 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site