Skip to contentSkip to conversation

mips kernel 2.6.16rc1 + IET 0.4.13 - /dev/ietctl - ioctl unknown command

DISCUSSION Frederic Temporelli 2 participants 4 messages Mar 8, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

Hello,

I would like to report an ioctl issue using IET 0.4.13 (iSCSI target) and kernel 2.6.16-rc1, running on mips / SGI O2

The driver seems to load nicely, but there was no way to do ioctl on the userspace device /dev/ietctl. I got such messages in syslog:

Mar  4 16:47:16 o2 kernel: [4303606.514000] ioctl32(ietd:3448): Unknown cmd fd(4) cmd(81046900){01} arg(7f942ab0) on /dev/ietctl

=> I've been able to resolve the issue by adding a by-pass (goto do_ioctl) in kernel compat_sys_ioctl function (fs/compat.c) and all is working fine now.

I don't know if such issue is related to mips only or is due to changes 2.6.16 kernel
I've also did some tries on x86 with linux 2.6.15.5, all was working fine without needing to change anything in the kernel.

Did somebody report such issue with IET and recent kernel ? May some people from linux-mips tell if such issue is mips specific ?

Best regards.
--
Fred

Signature · 3 lines
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/277 - Release Date: 08/03/2006
#1 lore raw

thanks for the catch.

could u show us how u did that bypass? thanks.

ming

Quoted 28 lines · Frederic Temporelli

Hello,

I would like to report an ioctl issue using IET 0.4.13 (iSCSI target) and kernel 2.6.16-rc1, running on mips / SGI O2

The driver seems to load nicely, but there was no way to do ioctl on the userspace device /dev/ietctl.
I got such messages in syslog:

Mar  4 16:47:16 o2 kernel: [4303606.514000] ioctl32(ietd:3448): Unknown 

cmd fd(4) cmd(81046900){01} arg(7f942ab0) on /dev/ietctl

=> I've been able to resolve the issue by adding a by-pass (goto do_ioctl) in kernel compat_sys_ioctl function (fs/compat.c) and all is working fine now.

I don't know if such issue is related to mips only or is due to changes 2.6.16 kernel
I've also did some tries on x86 with linux 2.6.15.5, all was working fine without needing to change anything in the kernel.

Did somebody report such issue with IET and recent kernel ? May some people from linux-mips tell if such issue is mips specific ?

Best regards.
--
Fred

#2 lore raw

Hi,

Here's the bypass (really ugly, just skip the following cmd test and directly go to the vfs_ioctl call later in the func). And yes, I'm using a 64bits kernel and app is 32 bits...

= 8< ==========================

compat.c 2006-03-08 20:30:10.000000000 +0100 renamed from compat.c.git 2006-03-08 20:31:27.000000000 +0100 +1 -0
@@ -400,6 +400,7 @@ asmlinkage long compat_sys_ioctl(unsigne
       } else {
               static int count;
 
+               goto do_ioctl;
               if (++count <= 50)
                       compat_ioctl_error(filp, fd, cmd, arg);
               error = -EINVAL;

= 8< ==========================

Regards
--
Fred

Quoted 49 lines · Ming Zhang

thanks for the catch.

could u show us how u did that bypass? thanks.

ming

Quoted 13 lines · Frederic Temporelli

Hello,

I would like to report an ioctl issue using IET 0.4.13 (iSCSI target) and kernel 2.6.16-rc1, running on mips / SGI O2

The driver seems to load nicely, but there was no way to do ioctl on the userspace device /dev/ietctl. I got such messages in syslog:

Mar  4 16:47:16 o2 kernel: [4303606.514000] ioctl32(ietd:3448): Unknown cmd fd(4) cmd(81046900){01} arg(7f942ab0) on /dev/ietctl

=> I've been able to resolve the issue by adding a by-pass (goto do_ioctl) in kernel compat_sys_ioctl function (fs/compat.c) and all is working fine now.

I don't know if such issue is related to mips only or is due to changes 2.6.16 kernel
I've also did some tries on x86 with linux 2.6.15.5, all was working fine without needing to change anything in the kernel.

Quoted 10 lines

Did somebody report such issue with IET and recent kernel ? May some people from linux-mips tell if such issue is mips specific ?

Best regards.
--
Fred

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Iscsitarget-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

Signature · 3 lines
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/277 - Release Date: 08/03/2006
#3 lore raw

just tested, iet works on

Linux dopteron.localdomain 2.6.16-rc5 #1 SMP PREEMPT Wed Mar 8 14:11:41 EST 2006 i686 athlon i386 GNU/Linux

so i would think this is a mips specific issue.

ming

Quoted 86 lines · Frederic Temporelli

Hi,

Here's the bypass (really ugly, just skip the following cmd test and directly go to the vfs_ioctl call later in the func).
And yes, I'm using a 64bits kernel and app is 32 bits...

= 8< ==========================

compat.c 2006-03-08 20:30:10.000000000 +0100 renamed from compat.c.git 2006-03-08 20:31:27.000000000 +0100 +1 -0
@@ -400,6 +400,7 @@ asmlinkage long compat_sys_ioctl(unsigne
        } else {
                static int count;
 
+               goto do_ioctl;
                if (++count <= 50)
                        compat_ioctl_error(filp, fd, cmd, arg);
                error = -EINVAL;

= 8< ==========================

Regards
--
Fred

Quoted 56 lines · Ming Zhang

thanks for the catch.

could u show us how u did that bypass? thanks.

ming

Quoted 20 lines · Frederic Temporelli

Hello,

I would like to report an ioctl issue using IET 0.4.13 (iSCSI target) and kernel 2.6.16-rc1, running on mips / SGI O2

The driver seems to load nicely, but there was no way to do ioctl on the userspace device /dev/ietctl.
I got such messages in syslog:

Mar  4 16:47:16 o2 kernel: [4303606.514000] ioctl32(ietd:3448): Unknown 

cmd fd(4) cmd(81046900){01} arg(7f942ab0) on /dev/ietctl

=> I've been able to resolve the issue by adding a by-pass (goto do_ioctl) in kernel compat_sys_ioctl function (fs/compat.c) and all is working fine now.

I don't know if such issue is related to mips only or is due to changes 2.6.16 kernel
I've also did some tries on x86 with linux 2.6.15.5, all was working fine without needing to change anything in the kernel.

Quoted 10 lines

Did somebody report such issue with IET and recent kernel ? May some people from linux-mips tell if such issue is mips specific ?

Best regards.
--
Fred

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Iscsitarget-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel