[PATCH] Fix NULL handler for compat_ioctl

From: Ben Collins (bcollins@debian.org)
Date: Wed Apr 30 2003 - 20:34:27 EST


Pretty serious ommision, but I'm guessing there's not too many users of
the {un,}register_ioctl32_conversion calls. Linux1394 just happens to
use it quite extensively, so this showed up on my radar by coincidence.

You are supposed to be able to pass a NULL handler to
register_ioctl32_conversion to signify a compatible translation, IOW,
use the 64-bit ioctl handler. Without this patch, we would instead jump
to a NULL address.

Applies to current 2.5.68-bk (see Larry, someone is using bk-cvs for
something good :).

diff -u -u -r1.8 compat.c
--- linux/fs/compat.c 30 Apr 2003 16:17:21 -0000 1.8
+++ linux/fs/compat.c 1 May 2003 01:45:46 -0000
@@ -229,7 +229,10 @@
         
         t->next = NULL;
         t->cmd = cmd;
- t->handler = handler;
+ if (!handler)
+ t->handler = (void *)sys_ioctl;
+ else
+ t->handler = handler;
         ioctl32_insert_translation(t);
 
         unlock_kernel();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:37 EST