2.1 ISDN showstoper an fix

Carlos Morgado (l39801@alfa.ist.utl.pt)
Wed, 30 Dec 1998 14:08:37 +0000


An old 2.0 bug with the ISDN subsystem and the PCBIT-D card is present in
2.1. If the pcbit card receives a call with no CalledPN or CallingPN the
kernel will barf. In 2.0 this was a simple ops, in 2.1 the kernel gets
comatose and Alt+SysRq (sync,umount) don't work.

A fix for this bug has been sent to the ISDN manintainer and incorporated
into the isdn4k in 2.0.36 but the fix got broken (??) and the (c) comments
by the patch author were removed.

Bellow is a patch against 2.1 (should work for any 2.1 as the PCBIT-D driver
development stoped).

--- linux-2.1.131ac9/drivers/isdn/pcbit/callbacks.c Thu Feb 27 18:57:30 1997
+++ linux/drivers/isdn/pcbit/callbacks.c Wed Dec 30 13:17:44 1998
@@ -11,6 +11,12 @@
* callbacks for the FSM
*/

+/*
+ * Fix: 19981230 - Carlos Morgado <chbm@techie.com>
+ * Port of Nelson Escravana's <nelson.escravana@usa.net> fix to CalledPN
+ * NULL pointer dereference in cb_in_1 (originally fixed in 2.0)
+ */
+
#define __NO_VERSION__

#include <linux/module.h>
@@ -164,8 +170,21 @@
* ictl.num >= strlen() + strlen() + 5
*/

- strcpy(ictl.parm.setup.phone, cbdata->data.setup.CallingPN);
- strcpy(ictl.parm.setup.eazmsn, cbdata->data.setup.CalledPN);
+ if(cbdata->data.setup.CallingPN == NULL) {
+ printk(KERN_DEBUG "NULL CallingPN to phone putting 0");
+ strcpy(ictl.parm.setup.phone, "0");
+ } else {
+ strcpy(ictl.parm.setup.phone, cbdata->data.setup.CallingPN);
+ };
+
+ if(cbdata->data.setup.CalledPN == NULL) {
+ printk(KERN_DEBUG "NULL CalledPN to eazmsn putting 0\n");
+ strcpy(ictl.parm.setup.eazmsn, "0");
+ } else {
+ strcpy(ictl.parm.setup.eazmsn, cbdata->data.setup.CalledPN);
+ };
+
+
ictl.parm.setup.si1 = 7;
ictl.parm.setup.si2 = 0;
ictl.parm.setup.plan = 0;

-- 
Carlos Morgado - l39801@alfa.ist.utl.pt - http://alfa.ist.utl.pt/~c39801
PGP Key fingerprint = 43 BF 53 98 EB 32 F5 17  9E EB 77 1F 57 8C C6 83
I am Homer of Borg! Prepare to be... OOooo! donuts! 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/