linux-mips
[Top] [All Lists]

Re: [patch] linux 2.4.5: __dbe_table iteration #2

To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Subject: Re: [patch] linux 2.4.5: __dbe_table iteration #2
From: Keith Owens <kaos@ocs.com.au>
Date: Thu, 23 Aug 2001 11:49:53 +1000
Cc: Ralf Baechle <ralf@uni-koblenz.de>, linux-mips@fnet.fr, linux-mips@oss.sgi.com
In-reply-to: Your message of "Mon, 20 Aug 2001 15:57:21 +0200." <Pine.GSO.3.96.1010820150047.3562D-100000@delta.ds2.pg.gda.pl>
Sender: owner-linux-mips@oss.sgi.com
On Mon, 20 Aug 2001 15:57:21 +0200 (MET DST), 
"Maciej W. Rozycki" <macro@ds2.pg.gda.pl> wrote:
>+      for (mp = module_list; mp != NULL; mp = mp->next) {
>+              if (!mod_member_present(mp, archdata_start) ||
>+                  !mp->archdata_start)
>+                      continue;
>+              ap = (struct archdata *)(mp->archdata_start);

The definition of struct archdata in kernel and modutils can be
different, a new kernel layout with an old modutils is legal but fatal
unless you code for it.  The correct test for archdata is

if (!mod_member_present(mp, archdata_start) ||
    (mp->archdata_end - mp->archdata_start) <=
     offsetof(struct archdata, dbe_table_end))
        continue;

Do not use archdata unless it is at least large enough to contain
dbe_table_end.  That test also takes care of NULL pointers, end - start
== 0 for NULL.

The rest of the code looks OK, except it needs a global change of
arch_init_module: to module_arch_init: to match the macro name.

Do you have the corresponding modutils patch or shall I do it?


<Prev in Thread] Current Thread [Next in Thread>