bug in register_ioctl32_conversion?

From: Steve Ralston (sralston@ra.ks.lsil.com)
Date: Mon Jul 31 2000 - 03:46:11 EST


Me thinks there's a bug in arch/sparc64/kernel/ioctl32.c,
in the register_ioctl32_conversion() routine:

  int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned
  long, struct file *))
  {
          int i;
          if (!additional_ioctls) {
                  additional_ioctls = module_map(PAGE_SIZE);
                  if (!additional_ioctls) return -ENOMEM;
// <-- Need to memzero, or zero all additional_ioctls[].cmd fields here!
          }
          for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++)
                  if (!additional_ioctls[i].cmd)
                          break;
          if (i == PAGE_SIZE/sizeof(struct ioctl_trans))
                  return -ENOMEM;
          additional_ioctls[i].cmd = cmd;
          if (!handler)
                  additional_ioctls[i].handler = (u32)(long)sys_ioctl;
          else
                  additional_ioctls[i].handler = (u32)(long)handler;
          ioctl32_insert_translation(&additional_ioctls[i]);
          return 0;
  }

This has been [randomly] tripping up loading of one of our
driver modules for quite some time now.:-(

Thanks,
-SteveR

-
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/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:32 EST