<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: Re: cipecb module fails to load in 2.0.39fin
From: Olaf Titz <olaf,AT,bigred,DOT,inka,DOT,de>
Date: Fri, 6 Oct 2000 03:13:05 +0200
In-reply-to: <Pine.LNX.4.21.0010021604570.3179-100000@gummy.wi.securepipe.com>

> No, now that you mention it, init_task is not in /proc/ksyms.
> How is that possible?  init_task is contained in linux/sched.c,
> which is basic kernel functionality.  How could my kernel be
> missing that?

The kernel does not export all its symbols, only those deemed
important and specially marked for export. See kernel/ksyms.c.
In 2.0 this export list does indeed not contain init_task which also
means the for_each_task macro is not usable from a module.

Try this one. Now after tricking my test machine into booting 2.0.38 I
have verified that it does indeed load and work under that kernel. I'm
not 100% sure that dynamic device allocation works under 2.0, but
probably just the test which is taken out in the second chunk is wrong
for 2.0.

I'm also not convinced that my for_each_task variant for 2.0 is SMP
safe, but SMP systems have worse problems under 2.0 anyway.

Olaf

Index: cipe.h
===================================================================
RCS file: /home/olaf/common-home/CVSrepos/security/cipe-linux/cipe.h,v
retrieving revision 1.30
diff -u -r1.30 cipe.h
--- cipe.h      2000/08/02 14:33:45     1.30
+++ cipe.h      2000/10/04 21:31:37
@@ -159,8 +159,10 @@
 #define tasklist_LOCK()                read_lock(&tasklist_lock)
 #define tasklist_UNLOCK()      read_unlock(&tasklist_lock)
 #else
-#define tasklist_LOCK()                /* nop */
-#define tasklist_UNLOCK()      /* nop */
+#define tasklist_LOCK()                cli()
+#define tasklist_UNLOCK()      sti()
+#undef  for_each_task
+#define for_each_task(p) for (p = current; (p = p->next_task) != current; )
 #endif

 #ifdef LINUX_23
Index: device.c
===================================================================
RCS file: /home/olaf/common-home/CVSrepos/security/cipe-linux/device.c,v
retrieving revision 1.35.4.1
diff -u -r1.35.4.1 device.c
--- device.c    2000/09/21 21:37:35     1.35.4.1
+++ device.c    2000/10/06 00:16:17
@@ -409,11 +409,13 @@
        c->sock->zapped=1;
        c->sock->err=ENXIO;
        c->sock->error_report(c->sock);
+#ifdef LINUX_21
        if (!cipe_isowned(c)) {
            /* SHOULD NOT HAPPEN. Socket is probably left orphaned */
            printk(KERN_ERR "cipe_dev_close: not owned??\n");
            cipe_close(c);
        }
+#endif
     } else {
        cipe_close(c);
     }

== end of patch





<< | Thread Index | >> ]    [ << | Date Index | >> ]