Debian Bug report logs - #502845
open-iscsi: login fails using 64-bit kernel with 32-bit userland

Package: linux-2.6; Maintainer for linux-2.6 is Debian Kernel Team <debian-kernel@lists.debian.org>;

Reported by: Rainer Gauweiler <r.gauweiler@otterbach.de>

Date: Mon, 20 Oct 2008 08:00:01 UTC

Severity: important

Tags: upstream

Forwarded to http://thread.gmane.org/gmane.linux.iscsi.open-iscsi/4896/focus=5070

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Philipp Hug <debian@hug.cx>:
Bug#502845; Package open-iscsi. (Mon, 20 Oct 2008 08:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rainer Gauweiler <r.gauweiler@otterbach.de>:
New Bug report received and forwarded. Copy sent to Philipp Hug <debian@hug.cx>. (Mon, 20 Oct 2008 08:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Rainer Gauweiler <r.gauweiler@otterbach.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: open-iscsi: no login using amd64
Date: Mon, 20 Oct 2008 09:57:03 +0200
Package: open-iscsi
Version: 2.0.730-1etch1
Severity: grave
Justification: renders package unusable

after fresh install:
iscsiadm -m node -o new -T target1 -p IP
iscsiadm -m node -o new -T target2 -p IP
iscsiadm -m node -p IP -L all
>iscsiadm: initiator reported error (9 - internal error)
>iscsiadm: initiator reported error (9 - internal error)
dmesg
>Loading iSCSI transport class v1.1-646.<5>iscsi: registered transport (tcp)
>iscsi: registered transport (iser)
>scsi3 : iSCSI Initiator over TCP/IP
>scsi4 : iSCSI Initiator over TCP/IP
>iscsi: invalid session 0

The same works if I use a non amd64 kernel, f.e. 2.6.18-6-686 or
2.6.24-etchnhalf.1-686-bigmem

Target is ietd on CentOs5.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-amd64
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages open-iscsi depends on:
ii  libc6                  2.3.6.ds1-13etch5 GNU C Library: Shared libraries

open-iscsi recommends no packages.

-- no debconf information




Bug marked as found in version 2.0.730-1. Request was from Andreas Henriksson <andreas@fatal.se> to control@bugs.debian.org. (Fri, 12 Dec 2008 22:18:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Philipp Hug <debian@hug.cx>:
Bug#502845; Package open-iscsi. (Sat, 13 Dec 2008 22:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Quentin Smith <quentin@MIT.EDU>:
Extra info received and forwarded to list. Copy sent to Philipp Hug <debian@hug.cx>. (Sat, 13 Dec 2008 22:03:04 GMT) Full text and rfc822 format available.

Message #12 received at 502845@bugs.debian.org (full text, mbox):

From: Quentin Smith <quentin@MIT.EDU>
To: 502845@bugs.debian.org
Cc: 502845-submitter@bugs.debian.org, control@bugs.debian.org
Subject: open-iscsi: no login using amd64
Date: Sat, 13 Dec 2008 16:50:29 -0500 (EST)
reassign 502845 linux-image-2.6.18-6-amd64
thanks

The initiator lives in the kernel, not in the open-iscsi package. This 
might be fixed in a new version of the kernel - you should try using a 
newer kernel (such as etchnhalf).

--Quentin




Bug reassigned from package `open-iscsi' to `linux-image-2.6.18-6-amd64'. Request was from Quentin Smith <quentin@MIT.EDU> to control@bugs.debian.org. (Sat, 13 Dec 2008 22:03:07 GMT) Full text and rfc822 format available.

Message sent on to Rainer Gauweiler <r.gauweiler@otterbach.de>:
Bug#502845. (Sat, 13 Dec 2008 22:03:11 GMT) Full text and rfc822 format available.

Severity set to `important' from `grave' Request was from Bastian Blank <waldi@debian.org> to control@bugs.debian.org. (Sat, 13 Dec 2008 22:27:08 GMT) Full text and rfc822 format available.

Tags added: moreinfo Request was from Bastian Blank <waldi@debian.org> to control@bugs.debian.org. (Sat, 13 Dec 2008 22:27:09 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-image-2.6.18-6-amd64. (Sun, 14 Dec 2008 10:02:47 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rainer Gauweiler <r.gauweiler@otterbach.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sun, 14 Dec 2008 10:02:47 GMT) Full text and rfc822 format available.

Message #26 received at 502845@bugs.debian.org (full text, mbox):

From: Rainer Gauweiler <r.gauweiler@otterbach.de>
To: Quentin Smith <quentin@MIT.EDU>, 502845-quiet@bugs.debian.org
Cc: 502845@bugs.debian.org, 502845-submitter@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#502845: open-iscsi: no login using amd64
Date: Sun, 14 Dec 2008 10:53:49 +0100
[Message part 1 (text/plain, inline)]
Hello,

Quentin Smith schrieb:
> reassign 502845 linux-image-2.6.18-6-amd64
> thanks
> 
> The initiator lives in the kernel, not in the open-iscsi package. This 
> might be fixed in a new version of the kernel - you should try using a 
> newer kernel (such as etchnhalf).

I already have tried etchnhalf - no difference, it still doesn't work.

On Google I find several people having this problem, noone with an 
answer. But all use debian, so it seems it is a problem with the debian 
kernel.

Regards
	Rainer

-- 
------------------------------------------------------
Fon 07222/952-278, Fax 07222/952-222
r.gauweiler@otterbach.de, http://www.otterbach.de

O t t e r b a c h  I T  G m b H
Hardbergstraße 3, 76437 Rastatt

Umsatzsteueridentifikationsnummer: DE194922575
Handelsregister Mannheim HRB 522198
GF: Ulrich Otterbach, Otto Engelhard, Reinhard Hornung
------------------------------------------------------
[r_gauweiler.vcf (text/x-vcard, attachment)]

Information stored :
Bug#502845; Package linux-image-2.6.18-6-amd64. (Sun, 14 Dec 2008 10:02:48 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rainer Gauweiler <r.gauweiler@otterbach.de>:
Extra info received and filed, but not forwarded. (Sun, 14 Dec 2008 10:02:48 GMT) Full text and rfc822 format available.

Message sent on to Rainer Gauweiler <r.gauweiler@otterbach.de>:
Bug#502845. (Sun, 14 Dec 2008 10:02:51 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-image-2.6.18-6-amd64. (Thu, 11 Feb 2010 15:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 11 Feb 2010 15:48:03 GMT) Full text and rfc822 format available.

Message #39 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: 502845@bugs.debian.org
Subject: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Thu, 11 Feb 2010 16:37:36 +0100
reassign linux-image-2.6.32-1-amd64
thanks

Hi,
the bug is still existant on amd64 with kernel image linux-image-2.6.32-1-amd64.

Still all attempts to mount an iscsi target with open-iscsi leads
to a hang in the --login ...

Renders open-iscsi unusable for amd64 ...

strace Log of an open-iscsi login which hangs ...

11280 execve("/usr/bin/iscsiadm", ["iscsiadm", "-m", "node", "--targetname", "iqn.1997-01.org.rfc822.lab.t4:st"..., "--portal", "195.71.99.251:3260", "--login"], [/* 14 vars */]) = 0
11280 brk(0)                            = 0x8cfb000
11280 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
11280 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf77d2000
11280 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
11280 open("/etc/ld.so.cache", O_RDONLY) = 3
11280 fstat64(3, {st_mode=S_IFREG|0644, st_size=26171, ...}) = 0
11280 mmap2(NULL, 26171, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf77cb000
11280 close(3)                          = 0
11280 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
11280 open("/lib/i686/cmov/libc.so.6", O_RDONLY) = 3
11280 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1\0004\0\0\0\4"..., 512) = 512
11280 fstat64(3, {st_mode=S_IFREG|0755, st_size=1413540, ...}) = 0
11280 mmap2(NULL, 1418864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xf7670000
11280 mmap2(0xf77c5000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x155) = 0xf77c5000
11280 mmap2(0xf77c8000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xf77c8000
11280 close(3)                          = 0
11280 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf766f000
11280 set_thread_area({entry_number:-1 -> 12, base_addr:0xf766f6b0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
11280 mprotect(0xf77c5000, 4096, PROT_READ) = 0
11280 munmap(0xf77cb000, 26171)         = 0
11280 rt_sigaction(SIGINT, {0x8066bc0, [], 0}, {SIG_DFL}, 8) = 0
11280 umask(0177)                       = 022
11280 getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
11280 setrlimit(RLIMIT_NOFILE, {rlim_cur=16*1024, rlim_max=16*1024}) = 0
11280 access("/etc/iscsi/", F_OK)       = 0
11280 mmap2(NULL, 462848, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf75fe000
11280 access("/var/lock/iscsi", F_OK)   = 0
11280 open("/var/lock/iscsi/lock", O_RDWR|O_CREAT, 0666) = 3
11280 close(3)                          = 0
11280 link("/var/lock/iscsi/lock", "/var/lock/iscsi/lock.write") = 0
11280 access("/etc/iscsi/ifaces", F_OK) = 0
11280 unlink("/var/lock/iscsi/lock.write") = 0
11280 brk(0)                            = 0x8cfb000
11280 brk(0x8d1c000)                    = 0x8d1c000
11280 open("/sys/class/iscsi_host", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
11280 fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
11280 fcntl64(3, F_GETFD)               = 0x1 (flags FD_CLOEXEC)
11280 getdents(3, /* 2 entries */, 4096) = 32
11280 getdents(3, /* 0 entries */, 4096) = 0
11280 close(3)                          = 0
11280 open("/etc/iscsi/nodes", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
11280 fstat64(3, {st_mode=S_IFDIR|0600, st_size=1024, ...}) = 0
11280 getdents(3, /* 4 entries */, 1024) = 132
11280 open("/etc/iscsi/nodes/iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
11280 fstat64(4, {st_mode=S_IFDIR|0600, st_size=1024, ...}) = 0
11280 getdents(4, /* 3 entries */, 1024) = 64
11280 open("/etc/iscsi/nodes/iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1/195.71.99.251,3260,1", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5
11280 fstat64(5, {st_mode=S_IFDIR|0600, st_size=1024, ...}) = 0
11280 getdents(5, /* 3 entries */, 1024) = 52
11280 access("/var/lock/iscsi", F_OK)   = 0
11280 open("/var/lock/iscsi/lock", O_RDWR|O_CREAT, 0666) = 6
11280 close(6)                          = 0
11280 link("/var/lock/iscsi/lock", "/var/lock/iscsi/lock.write") = 0
11280 open("/etc/iscsi/nodes/iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1/195.71.99.251,3260,1/default", O_RDONLY) = 6
11280 fstat64(6, {st_mode=S_IFREG|0600, st_size=1676, ...}) = 0
11280 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf77d1000
11280 _llseek(6, 0, [0], SEEK_SET)      = 0
11280 read(6, "node.name = iqn.1997-01.org.rfc82"..., 1024) = 1024
11280 read(6, "n.iscsi.MaxConnections = 1\nnode.s"..., 1024) = 652
11280 read(6, ""..., 1024)              = 0
11280 close(6)                          = 0
11280 munmap(0xf77d1000, 4096)          = 0
11280 unlink("/var/lock/iscsi/lock.write") = 0
11280 getdents(5, /* 0 entries */, 1024) = 0
11280 close(5)                          = 0
11280 getdents(4, /* 0 entries */, 1024) = 0
11280 close(4)                          = 0
11280 open("/etc/iscsi/nodes/iqn.2010-01.localhost:disk1", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
11280 fstat64(4, {st_mode=S_IFDIR|0600, st_size=1024, ...}) = 0
11280 getdents(4, /* 3 entries */, 1024) = 60
11280 open("/etc/iscsi/nodes/iqn.2010-01.localhost:disk1/127.0.0.1,3260,1", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5
11280 fstat64(5, {st_mode=S_IFDIR|0600, st_size=1024, ...}) = 0
11280 getdents(5, /* 3 entries */, 1024) = 52
11280 access("/var/lock/iscsi", F_OK)   = 0
11280 open("/var/lock/iscsi/lock", O_RDWR|O_CREAT, 0666) = 6
11280 close(6)                          = 0
11280 link("/var/lock/iscsi/lock", "/var/lock/iscsi/lock.write") = 0
11280 open("/etc/iscsi/nodes/iqn.2010-01.localhost:disk1/127.0.0.1,3260,1/default", O_RDONLY) = 6
11280 fstat64(6, {st_mode=S_IFREG|0600, st_size=1643, ...}) = 0
11280 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf77d1000
11280 _llseek(6, 0, [0], SEEK_SET)      = 0
11280 read(6, "node.name = iqn.2010-01.localhost"..., 1024) = 1024
11280 read(6, "de.session.iscsi.MaxOutstandingR2"..., 1024) = 619
11280 read(6, ""..., 1024)              = 0
11280 close(6)                          = 0
11280 munmap(0xf77d1000, 4096)          = 0
11280 unlink("/var/lock/iscsi/lock.write") = 0
11280 getdents(5, /* 0 entries */, 1024) = 0
11280 close(5)                          = 0
11280 getdents(4, /* 0 entries */, 1024) = 0
11280 close(4)                          = 0
11280 getdents(3, /* 0 entries */, 1024) = 0
11280 close(3)                          = 0
11280 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
11280 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf77d1000
11280 write(1, "Logging in to [iface: default, ta"..., 115) = 115
11280 socket(PF_FILE, SOCK_STREAM, 0)   = 3
11280 connect(3, {sa_family=AF_FILE, path=@"ISCSIADM_ABSTRACT_NAMESPACE"...}, 110) = 0
11280 write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\230q\304\377\230q\304\377iqn.1997-01.o"..., 5244) = 5244
11280 recv(3, 0xffc46760, 2464, MSG_WAITALL) = ? ERESTARTSYS (To be restarted)
11280 --- SIGINT (Interrupt) @ 0 (0) ---
11280 write(2, "iscsiadm: "..., 10)     = 10
11280 write(2, "caught SIGINT, exiting..."..., 25) = 25
11280 write(2, "\n"..., 1)              = 1
11280 exit_group(1)                     = ?

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 




Bug reassigned from package 'linux-image-2.6.18-6-amd64' to 'linux-image-2.6.32-1-amd64'. Request was from Florian Lohoff <f@zz.de> to control@bugs.debian.org. (Thu, 11 Feb 2010 16:03:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-image-2.6.32-1-amd64. (Thu, 11 Feb 2010 16:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 11 Feb 2010 16:54:03 GMT) Full text and rfc822 format available.

Message #46 received at 502845@bugs.debian.org (full text, mbox):

From: Bastian Blank <waldi@debian.org>
To: Florian Lohoff <f@zz.de>, 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Thu, 11 Feb 2010 17:51:38 +0100
On Thu, Feb 11, 2010 at 04:37:36PM +0100, Florian Lohoff wrote:
> 11280 connect(3, {sa_family=AF_FILE, path=@"ISCSIADM_ABSTRACT_NAMESPACE"...}, 110) = 0
> 11280 write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\230q\304\377\230q\304\377iqn.1997-01.o"..., 5244) = 5244
> 11280 recv(3, 0xffc46760, 2464, MSG_WAITALL) = ? ERESTARTSYS (To be restarted)

This only shows that iscsid does not respond to the requests of
iscsiadm. However I consider it unlikely that such a bug should have
survived for 14 kernel releases.

Please show all the relevant configs, strace outputs of iscsiadm _and_
iscsid and also network traces.

Bastian

-- 
A princess should not be afraid -- not with a brave knight to protect her.
		-- McCoy, "Shore Leave", stardate 3025.3




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-image-2.6.32-1-amd64. (Thu, 11 Feb 2010 19:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 11 Feb 2010 19:30:02 GMT) Full text and rfc822 format available.

Message #51 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: Bastian Blank <waldi@debian.org>
Cc: 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Thu, 11 Feb 2010 20:23:12 +0100
[Message part 1 (text/plain, inline)]
On Thu, Feb 11, 2010 at 05:51:38PM +0100, Bastian Blank wrote:
> On Thu, Feb 11, 2010 at 04:37:36PM +0100, Florian Lohoff wrote:
> > 11280 connect(3, {sa_family=AF_FILE, path=@"ISCSIADM_ABSTRACT_NAMESPACE"...}, 110) = 0
> > 11280 write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\230q\304\377\230q\304\377iqn.1997-01.o"..., 5244) = 5244
> > 11280 recv(3, 0xffc46760, 2464, MSG_WAITALL) = ? ERESTARTSYS (To be restarted)
> 
> This only shows that iscsid does not respond to the requests of
> iscsiadm. However I consider it unlikely that such a bug should have
> survived for 14 kernel releases.
> 
> Please show all the relevant configs, strace outputs of iscsiadm _and_
> iscsid and also network traces.

Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
hangs forever ... No matter whether the target is on the same machine
or on a different machine ...

What i did now:

bladesys3:~# tcpdump -i eth0 -s0 -w /tmp/login.pcap host t4.lab.rfc822.org and port 3260

and in parallel:

bladesys3:~# strace -t -f -o /tmp/scsid.strace.log /etc/init.d/open-iscsi start

Starting iSCSI initiator service: iscsid.
Setting up iSCSI targets:
iscsiadm: No records found!
.
Mounting network filesystems:.

And then:

iscsiadm -m discovery -t st -p 195.71.99.251
iscsiadm -m node

iscsiadm -m node --targetname "iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1" --portal "195.71.99.251:3260" --op=update --name node.session.auth.authmethod --value=CHAP
iscsiadm -m node --targetname "iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1" --portal "195.71.99.251:3260" --op=update --name node.session.auth.username --value=storage1
iscsiadm -m node --targetname "iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1" --portal "195.71.99.251:3260" --op=update --name node.session.auth.password --value=mi4Taibi

iscsiadm -m node --targetname "iqn.1997-01.org.rfc822.lab.t4:storage.t4.disk1" --portal "195.71.99.251:3260" --login

tcpdump:

http://silicon-verl.de/home/flo/tmp/iscsilogin.pcap
http://silicon-verl.de/home/flo/tmp/scsid.strace.log

The scsid strace shows repeated stuff like:

3444  20:14:08 connect(9, {sa_family=AF_INET, sin_port=htons(3260), sin_addr=inet_addr("195.71.99.251")}, 128) = -1 EINPROGRESS (Operation now in progress)

Although telnet (as the tcpdump) reports the connect is no problem:

bladesys3:/tmp# telnet t4.lab.rfc822.org 3260
Trying 195.71.99.251...
Connected to tiles-four.lab.rfc822.org.
Escape character is '^]'.
^]
telnet> close
Connection closed.

Still - the login hangs - dead ... I have never seen something like this
between i386 machines.

open-iscsi config is untouched.

What else?

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-image-2.6.32-1-amd64. (Thu, 11 Feb 2010 20:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 11 Feb 2010 20:15:06 GMT) Full text and rfc822 format available.

Message #56 received at 502845@bugs.debian.org (full text, mbox):

From: Bastian Blank <waldi@debian.org>
To: Florian Lohoff <f@zz.de>
Cc: 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Thu, 11 Feb 2010 21:13:21 +0100
On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
> pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
> hangs forever ... No matter whether the target is on the same machine
> or on a different machine ...

Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
suffers of the 64-bit-allignment-desease on i386.

Also please not that this interface is officialy _not_ exported.

Bastian

-- 
Captain's Log, star date 21:34.5...




Information forwarded to debian-bugs-dist@lists.debian.org, unknown-package@qa.debian.org:
Bug#502845; Package linux-image-2.6.32-1-amd64. (Mon, 15 Feb 2010 20:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to unknown-package@qa.debian.org. (Mon, 15 Feb 2010 20:24:02 GMT) Full text and rfc822 format available.

Message #61 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: Bastian Blank <waldi@debian.org>
Cc: 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Mon, 15 Feb 2010 21:19:31 +0100
[Message part 1 (text/plain, inline)]
On Thu, Feb 11, 2010 at 09:13:21PM +0100, Bastian Blank wrote:
> On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
> > pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
> > hangs forever ... No matter whether the target is on the same machine
> > or on a different machine ...
> 
> Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> suffers of the 64-bit-allignment-desease on i386.
> 
> Also please not that this interface is officialy _not_ exported.

So? What would be the correct state? Wontfix? Forwarded-UpStream?

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
[signature.asc (application/pgp-signature, inline)]

Bug reassigned from package 'linux-image-2.6.32-1-amd64' to 'linux-2.6'. Request was from Martin Michlmayr <tbm@cyrius.com> to control@bugs.debian.org. (Sun, 21 Feb 2010 21:06:11 GMT) Full text and rfc822 format available.

Added tag(s) upstream. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Tue, 06 Apr 2010 03:21:09 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Tue, 06 Apr 2010 03:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Hutchings <ben@decadent.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Tue, 06 Apr 2010 03:27:03 GMT) Full text and rfc822 format available.

Message #70 received at 502845@bugs.debian.org (full text, mbox):

From: Ben Hutchings <ben@decadent.org.uk>
To: Florian Lohoff <f@zz.de>
Cc: Rainer Gauweiler <r.gauweiler@otterbach.de>, 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Tue, 06 Apr 2010 04:21:46 +0100
[Message part 1 (text/plain, inline)]
On Mon, 2010-02-15 at 21:19 +0100, Florian Lohoff wrote:
> On Thu, Feb 11, 2010 at 09:13:21PM +0100, Bastian Blank wrote:
> > On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > > Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
> > > pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
> > > hangs forever ... No matter whether the target is on the same machine
> > > or on a different machine ...
> > 
> > Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> > suffers of the 64-bit-allignment-desease on i386.
> > 
> > Also please not that this interface is officialy _not_ exported.
> 
> So? What would be the correct state? Wontfix? Forwarded-UpStream?

If you want to get this fixed in the kernel then please report this
upstream at <https://bugzilla.kernel.org> or on an appropriate mailing
list.  If it's accepted as a real bug and fixed upstream then we can
backport the fix.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Wed, 07 Apr 2010 19:42:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Wed, 07 Apr 2010 19:42:06 GMT) Full text and rfc822 format available.

Message #75 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: Rainer Gauweiler <r.gauweiler@otterbach.de>, 502845@bugs.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Wed, 7 Apr 2010 21:31:17 +0200
[Message part 1 (text/plain, inline)]
On Tue, Apr 06, 2010 at 04:21:46AM +0100, Ben Hutchings wrote:
> > > On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > > > Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
> > > > pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
> > > > hangs forever ... No matter whether the target is on the same machine
> > > > or on a different machine ...
> > > 
> > > Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> > > suffers of the 64-bit-allignment-desease on i386.
> > > 
> > > Also please not that this interface is officialy _not_ exported.
> > 
> > So? What would be the correct state? Wontfix? Forwarded-UpStream?
> 
> If you want to get this fixed in the kernel then please report this
> upstream at <https://bugzilla.kernel.org> or on an appropriate mailing
> list.  If it's accepted as a real bug and fixed upstream then we can
> backport the fix.

The bug has been confirmnd on the open-iscsi mailingliste and reported
to be on the low priority fixlist. So basically open-iscsi is broken in 
Debian with a amd64 kernel and 32 bit userspace with no solution.

See attached mail.

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
[Message part 2 (message/rfc822, inline)]
From: Mike Christie <michaelc@cs.wisc.edu>
To: open-iscsi@googlegroups.com
Cc: Pasi Kärkkäinen <pasik@iki.fi>, Florian Lohoff <f@zz.de>
Subject: Re: amd64 kernel / i386 userland - no login
Date: Tue, 06 Apr 2010 22:58:09 -0500
On 04/06/2010 03:15 AM, Pasi Kärkkäinen wrote:
> On Fri, Mar 05, 2010 at 04:05:56PM -0600, Mike Christie wrote:
>> On 03/03/2010 01:13 PM, Florian Lohoff wrote:
>>>
>>> Hi,
>>> i reported a bug into the Debian Bug Tracking system that with
>>> a 64bit Kernel and a 32bit Userspace the login fails.
>>>
>>> See here:
>>>
>>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502845#51
>>>
>>> This is very reproducable - using a 32 bit kernel or a pure 64 bit
>>> userland makes it work immediatly - From Bastians response my guess
>>> was that some 64/32 syscall wrapper is missing but my question on
>>> how to proceed was not answered so i guess its the right thing to
>>> send it here too ..
>>>
>>
>> The iscsi netlink struct is not laid out correctly so on 32 bit user 64
>> bit kernel setups, when it gets passed from userspace to the kernel it
>> gets messed up. We have to redo the interface to fix this. Until then
>> you have to use 32 bit user with 32 bit kernel or 64 bit user with 64
>> bit kernels.
>>
>
> Is there any timeframe for this fix?
>

No. It is really really low on the TODO.


> I was planning to install 64bit kernel to a 32bit RHEL5 system
> (yes, not officially supported, I know ;) but this bug kind of makes
> it no-go.. unfortunately.
>
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sat, 01 May 2010 21:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Moritz Muehlenhoff <jmm@inutil.org>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sat, 01 May 2010 21:03:03 GMT) Full text and rfc822 format available.

Message #80 received at 502845@bugs.debian.org (full text, mbox):

From: Moritz Muehlenhoff <jmm@inutil.org>
To: Florian Lohoff <f@zz.de>
Cc: Ben Hutchings <ben@decadent.org.uk>, Rainer Gauweiler <r.gauweiler@otterbach.de>, 502845@bugs.debian.org, pkg-iscsi-maintainers@lists.alioth.debian.org
Subject: Re: Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Sat, 1 May 2010 22:44:56 +0200
On Wed, Apr 07, 2010 at 09:31:17PM +0200, Florian Lohoff wrote:
> On Tue, Apr 06, 2010 at 04:21:46AM +0100, Ben Hutchings wrote:
> > > > On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > > > > Something _is_ broken - I am very successful building up open-iscsi/iscsitarget
> > > > > pairs on i386 - as soon as the initiator (open-iscsi) is on amd64 the login
> > > > > hangs forever ... No matter whether the target is on the same machine
> > > > > or on a different machine ...
> > > > 
> > > > Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> > > > suffers of the 64-bit-allignment-desease on i386.
> > > > 
> > > > Also please not that this interface is officialy _not_ exported.
> > > 
> > > So? What would be the correct state? Wontfix? Forwarded-UpStream?
> > 
> > If you want to get this fixed in the kernel then please report this
> > upstream at <https://bugzilla.kernel.org> or on an appropriate mailing
> > list.  If it's accepted as a real bug and fixed upstream then we can
> > backport the fix.
> 
> The bug has been confirmnd on the open-iscsi mailingliste and reported
> to be on the low priority fixlist. So basically open-iscsi is broken in 
> Debian with a amd64 kernel and 32 bit userspace with no solution.

Adding Debian open-iscsi maintainers to CC.

Since according to upstream this is unlikey to be fixed for the Squeeze
kernel, maybe you should at least document in the open-iscsi package?

Cheers,
        Moritz




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sat, 01 May 2010 23:39:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ritesh Raj Sarraf <rrs@researchut.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sat, 01 May 2010 23:39:10 GMT) Full text and rfc822 format available.

Message #85 received at 502845@bugs.debian.org (full text, mbox):

From: Ritesh Raj Sarraf <rrs@researchut.com>
To: Florian Lohoff <f@zz.de>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Sun, 2 May 2010 05:04:56 +0530
[Message part 1 (text/plain, inline)]
On Sunday 02 May 2010 02:14:56 Moritz Muehlenhoff wrote:
> On Wed, Apr 07, 2010 at 09:31:17PM +0200, Florian Lohoff wrote:
> > On Tue, Apr 06, 2010 at 04:21:46AM +0100, Ben Hutchings wrote:
> > > > > On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > > > > > Something _is_ broken - I am very successful building up
> > > > > > open-iscsi/iscsitarget pairs on i386 - as soon as the initiator
> > > > > > (open-iscsi) is on amd64 the login hangs forever ... No matter
> > > > > > whether the target is on the same machine or on a different
> > > > > > machine ...
> > > > > 


I have the same setup where my software iSCSI target is on an i686 box where 
as my open-iscsi initiator is on an amd64 box.

> > > > > Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> > > > > suffers of the 64-bit-allignment-desease on i386.
> > > > > 
> > > > > Also please not that this interface is officialy _not_ exported.
> > > > 
> > > > So? What would be the correct state? Wontfix? Forwarded-UpStream?
> > > 
> > > If you want to get this fixed in the kernel then please report this
> > > upstream at <https://bugzilla.kernel.org> or on an appropriate mailing
> > > list.  If it's accepted as a real bug and fixed upstream then we can
> > > backport the fix.
> > 
> > The bug has been confirmnd on the open-iscsi mailingliste and reported
> > to be on the low priority fixlist. So basically open-iscsi is broken in
> > Debian with a amd64 kernel and 32 bit userspace with no solution.
> 
> Adding Debian open-iscsi maintainers to CC.
> 
> Since according to upstream this is unlikey to be fixed for the Squeeze
> kernel, maybe you should at least document in the open-iscsi package?
> 


I am not very sure if I see the same problem.

Here, on my setup:

rrs@learner:~$ uname -a
Linux learner 2.6.32-4-686 #1 SMP Tue Apr 6 07:02:27 UTC 2010 i686 GNU/Linux
rrs@learner:~$ apt-cache policy iscsitarget
iscsitarget:
  Installed: 1.4.20-1
  Candidate: 1.4.20-1
  Version table:
 *** 1.4.20-1 0
        500 http://ftp.debian.org sid/main Packages
        100 /var/lib/dpkg/status
     0.4.17+svn229-1.4 0
        990 http://ftp.debian.org testing/main Packages


champaran:/etc/iscsi# /etc/init.d/open-iscsi start
 * Starting iSCSI initiator service iscsid                                                                                   
[ OK ] 
 * Setting up iSCSI targets                                                                                                         
Logging in to [iface: default, target: iqn.2001-04.com.example:iet.test, 
portal: 192.168.2.104,3260]
Login to [iface: default, target: iqn.2001-04.com.example:iet.test, portal: 
192.168.2.104,3260]: successful
                                                                                                                             [ 
OK ]
 * Mounting network filesystems                                                                                              
[ OK ] 


champaran:~# uname -a
Linux champaran 2.6.32-4-amd64 #1 SMP Mon Apr 5 21:14:10 UTC 2010 x86_64 
GNU/Linux


Is there something else I need to reproduce the problem ?


Regards,
Ritesh
-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
[Message part 2 (text/html, inline)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sat, 01 May 2010 23:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ritesh Raj Sarraf <rrs@researchut.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sat, 01 May 2010 23:48:03 GMT) Full text and rfc822 format available.

Message #90 received at 502845@bugs.debian.org (full text, mbox):

From: Ritesh Raj Sarraf <rrs@researchut.com>
To: Florian Lohoff <f@zz.de>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Sun, 2 May 2010 05:13:50 +0530
[Message part 1 (text/plain, inline)]
I also did it with CHAP auth during discovery and it works.

champaran:~# iscsiadm -m node --loginall=automatic
Logging in to [iface: default, target: iqn.2001-04.com.example:iet.test, 
portal: 192.168.2.104,3260]
Login to [iface: default, target: iqn.2001-04.com.example:iet.test, portal: 
192.168.2.104,3260]: successful
champaran:~# iscsiadm -m session -P3
iSCSI Transport Class version 2.0-870
version 2.0-871
Target: iqn.2001-04.com.example:iet.test
        Current Portal: 192.168.2.104:3260,1
        Persistent Portal: 192.168.2.104:3260,1
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1993-08.org.debian:01:5ab1e6508f14
                Iface IPaddress: 192.168.2.101
                Iface HWaddress: <empty>
                Iface Netdev: <empty>
                SID: 1
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
                ************************
                Negotiated iSCSI params:
                ************************
                HeaderDigest: None
                DataDigest: None
                MaxRecvDataSegmentLength: 262144
                MaxXmitDataSegmentLength: 8192
                FirstBurstLength: 65536
                MaxBurstLength: 262144
                ImmediateData: Yes
                InitialR2T: Yes
                MaxOutstandingR2T: 1
                ************************
                Attached SCSI devices:
                ************************
                Host Number: 7  State: running
                scsi7 Channel 00 Id 0 Lun: 0
                        Attached scsi disk sdb          State: running
                scsi7 Channel 00 Id 0 Lun: 1
                        Attached scsi disk sdc          State: running



On Sunday 02 May 2010 05:04:56 Ritesh Raj Sarraf wrote:
> On Sunday 02 May 2010 02:14:56 Moritz Muehlenhoff wrote:
> > On Wed, Apr 07, 2010 at 09:31:17PM +0200, Florian Lohoff wrote:
> > > On Tue, Apr 06, 2010 at 04:21:46AM +0100, Ben Hutchings wrote:
> > > > > > On Thu, Feb 11, 2010 at 08:23:12PM +0100, Florian Lohoff wrote:
> > > > > > > Something _is_ broken - I am very successful building up
> > > > > > > open-iscsi/iscsitarget pairs on i386 - as soon as the initiator
> > > > > > > (open-iscsi) is on amd64 the login hangs forever ... No matter
> > > > > > > whether the target is on the same machine or on a different
> > > > > > > machine ...
> 
> I have the same setup where my software iSCSI target is on an i686 box
> where as my open-iscsi initiator is on an amd64 box.
> 
> > > > > > Yes, it is. The iscsi_uevent structure defined in scsi/iscsi_if.h
> > > > > > suffers of the 64-bit-allignment-desease on i386.
> > > > > > 
> > > > > > Also please not that this interface is officialy _not_ exported.
> > > > > 
> > > > > So? What would be the correct state? Wontfix? Forwarded-UpStream?
> > > > 
> > > > If you want to get this fixed in the kernel then please report this
> > > > upstream at <https://bugzilla.kernel.org> or on an appropriate
> > > > mailing list.  If it's accepted as a real bug and fixed upstream
> > > > then we can backport the fix.
> > > 
> > > The bug has been confirmnd on the open-iscsi mailingliste and reported
> > > to be on the low priority fixlist. So basically open-iscsi is broken in
> > > Debian with a amd64 kernel and 32 bit userspace with no solution.
> > 
> > Adding Debian open-iscsi maintainers to CC.
> > 
> > Since according to upstream this is unlikey to be fixed for the Squeeze
> > kernel, maybe you should at least document in the open-iscsi package?
> 
> I am not very sure if I see the same problem.
> 
> Here, on my setup:
> 
> rrs@learner:~$ uname -a
> Linux learner 2.6.32-4-686 #1 SMP Tue Apr 6 07:02:27 UTC 2010 i686
> GNU/Linux rrs@learner:~$ apt-cache policy iscsitarget
> iscsitarget:
>   Installed: 1.4.20-1
>   Candidate: 1.4.20-1
>   Version table:
>  *** 1.4.20-1 0
>         500 http://ftp.debian.org sid/main Packages
>         100 /var/lib/dpkg/status
>      0.4.17+svn229-1.4 0
>         990 http://ftp.debian.org testing/main Packages
> 
> 
> champaran:/etc/iscsi# /etc/init.d/open-iscsi start
>  * Starting iSCSI initiator service iscsid
> [ OK ]
>  * Setting up iSCSI targets
> Logging in to [iface: default, target: iqn.2001-04.com.example:iet.test,
> portal: 192.168.2.104,3260]
> Login to [iface: default, target: iqn.2001-04.com.example:iet.test, portal:
> 192.168.2.104,3260]: successful
>                                                                            
>                                                  [ OK ]
>  * Mounting network filesystems
> [ OK ]
> 
> 
> champaran:~# uname -a
> Linux champaran 2.6.32-4-amd64 #1 SMP Mon Apr 5 21:14:10 UTC 2010 x86_64
> GNU/Linux
> 
> 
> Is there something else I need to reproduce the problem ?
> 
> 
> Regards,
> Ritesh

-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sun, 02 May 2010 06:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sun, 02 May 2010 06:42:03 GMT) Full text and rfc822 format available.

Message #95 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Sun, 2 May 2010 08:38:30 +0200
[Message part 1 (text/plain, inline)]
On Sun, May 02, 2010 at 05:04:56AM +0530, Ritesh Raj Sarraf wrote:
> rrs@learner:~$ uname -a
> Linux learner 2.6.32-4-686 #1 SMP Tue Apr 6 07:02:27 UTC 2010 i686 GNU/Linux
                      ^^^^^^^

You have an 32 bit kernel - Please try on a 64 bit kernel with
32 bit userspace - you will fail.

> rrs@learner:~$ apt-cache policy iscsitarget
> iscsitarget:
>   Installed: 1.4.20-1
>   Candidate: 1.4.20-1
>   Version table:
>  *** 1.4.20-1 0
>         500 http://ftp.debian.org sid/main Packages
>         100 /var/lib/dpkg/status
>      0.4.17+svn229-1.4 0
>         990 http://ftp.debian.org testing/main Packages
> 
> 

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sun, 02 May 2010 08:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ritesh Raj Sarraf <rrs@researchut.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sun, 02 May 2010 08:24:03 GMT) Full text and rfc822 format available.

Message #100 received at 502845@bugs.debian.org (full text, mbox):

From: Ritesh Raj Sarraf <rrs@researchut.com>
To: Florian Lohoff <f@zz.de>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Sun, 2 May 2010 13:50:24 +0530
[Message part 1 (text/plain, inline)]
Hello Florian,

On Sunday 02 May 2010 12:08:30 Florian Lohoff wrote:
> On Sun, May 02, 2010 at 05:04:56AM +0530, Ritesh Raj Sarraf wrote:
> > rrs@learner:~$ uname -a
> > Linux learner 2.6.32-4-686 #1 SMP Tue Apr 6 07:02:27 UTC 2010 i686
> > GNU/Linux
> 
>                       ^^^^^^^
> 
> You have an 32 bit kernel - Please try on a 64 bit kernel with
> 32 bit userspace - you will fail.
> 

Thanks. I will be adding the following text to README.Debian


64 bit kernel with 32 bit userspace
-------------------------------------------------
  open-iscsi running with a 64 bit kernel and 32 bit userspace
  can run into a hang during the iSCSI login phase. This is a known
  issue upstream. For details, please see Debian BTS #502845


Regards,
Ritesh
-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 03 May 2010 07:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Lohoff <f@zz.de>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 03 May 2010 07:30:03 GMT) Full text and rfc822 format available.

Message #105 received at 502845@bugs.debian.org (full text, mbox):

From: Florian Lohoff <f@zz.de>
To: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Mon, 3 May 2010 09:26:52 +0200
[Message part 1 (text/plain, inline)]
On Sun, May 02, 2010 at 01:50:24PM +0530, Ritesh Raj Sarraf wrote:
> Thanks. I will be adding the following text to README.Debian
> 
> 64 bit kernel with 32 bit userspace
> -------------------------------------------------
>   open-iscsi running with a 64 bit kernel and 32 bit userspace
>   can run into a hang during the iSCSI login phase. This is a known
>   issue upstream. For details, please see Debian BTS #502845

Are there ANY reports for successful login with amd64 kernel and
32bit userspace? I have tried everything and i didnt get anything to
work.

So IMHO the package could present a popup in the postinst in its i386 variant
and a detected amd64 kernel that it wont work in that constellation.

Flo
-- 
Florian Lohoff                                                 f@zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 03 May 2010 08:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ritesh Raj Sarraf <rrs@researchut.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 03 May 2010 08:06:04 GMT) Full text and rfc822 format available.

Message #110 received at 502845@bugs.debian.org (full text, mbox):

From: Ritesh Raj Sarraf <rrs@researchut.com>
To: Florian Lohoff <f@zz.de>
Cc: pkg-iscsi-maintainers@lists.alioth.debian.org, Moritz Muehlenhoff <jmm@inutil.org>, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [Pkg-iscsi-maintainers] Bug#502845: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Mon, 3 May 2010 13:33:38 +0530
On Monday 03 May 2010 12:56:52 Florian Lohoff wrote:
> Are there ANY reports for successful login with amd64 kernel and
> 32bit userspace? I have tried everything and i didnt get anything to
> work.
> 

None that I am aware of. For most of my testings, the focus was only on a 64 
=> 64 or a 32 => 32 config.

> So IMHO the package could present a popup in the postinst in its i386
> variant and a detected amd64 kernel that it wont work in that
> constellation.

I think README.Debian should be enough. The way open-iscsi currently is in 
Debian, a user will be required to go and have a read of the README.Debian 
doc. Having it in postinst scripts will only convey the message at install 
time.


PS: I have already committed the content to the package. A new upload should 
be soon this week.


Regards,
Ritesh
-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Wed, 27 Jul 2011 02:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Wed, 27 Jul 2011 02:51:03 GMT) Full text and rfc822 format available.

Message #115 received at 502845@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: Florian Lohoff <f@zz.de>, pkg-iscsi-maintainers@lists.alioth.debian.org, 502845@bugs.debian.org, Rainer Gauweiler <r.gauweiler@otterbach.de>
Subject: Re: linux-image-2.6.32-1-amd64 / open-iscsi amd64 login hang
Date: Wed, 27 Jul 2011 04:48:49 +0200
forwarded 502845 http://thread.gmane.org/gmane.linux.iscsi.open-iscsi/4896/focus=5070
retitle 502845 open-iscsi: login fails using 64-bit kernel with 32-bit userland
tags 502845 = upstream
quit

Ritesh Raj Sarraf wrote:
> On Monday 03 May 2010 12:56:52 Florian Lohoff wrote:

>> Are there ANY reports for successful login with amd64 kernel and
>> 32bit userspace? I have tried everything and i didnt get anything to
>> work.
>
> None that I am aware of. For most of my testings, the focus was only on a 64 
> => 64 or a 32 => 32 config.
[...]
> I think README.Debian should be enough. The way open-iscsi currently is in 
> Debian, a user will be required to go and have a read of the README.Debian 
> doc.

Thanks, all.  (I am guessing the current status is the same.)  Marking
the bug with the result of the investigation so far as I understand
it, in the hope that it might help the next person with time to
investigate that runs into this to pick up where previous work left
off.




Set Bug forwarded-to-address to 'http://thread.gmane.org/gmane.linux.iscsi.open-iscsi/4896/focus=5070'. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 27 Jul 2011 02:51:05 GMT) Full text and rfc822 format available.

Changed Bug title to 'open-iscsi: login fails using 64-bit kernel with 32-bit userland' from 'open-iscsi: no login using amd64' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 27 Jul 2011 02:51:05 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 27 Jul 2011 02:51:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Thu, 01 Nov 2012 06:21:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lisa Marie <nullogic@SDF.ORG>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>.

Your message did not contain a Subject field. They are recommended and useful because the title of a $gBug is determined using this field. Please remember to include a Subject field in your messages in future.

(Thu, 01 Nov 2012 06:21:04 GMT) Full text and rfc822 format available.


Message #126 received at 502845@bugs.debian.org (full text, mbox):

From: Lisa Marie <nullogic@SDF.ORG>
To: 502845@bugs.debian.org
Date: Thu, 1 Nov 2012 01:59:41 -0400 (UTC)
Forwarding this: https://groups.google.com/group/open-iscsi/browse_thread/thread/7b44b4b57f01eb70?hl=en#

Since I'm not sure how long it takes google groups to update, i'll go 
ahead and paste the patch here as well below.

If you apply the first patch from the above link, the second patch below 
is not needed. It is only required for a 32bit userspace to talk to an 
unpatched 32bit kernel. The first patch allows for 64/64, 32/32, and 32/64 
user/kernel setups.

I'm not sure sure if you want to patch the kernel and userspace at the 
same time, or patch userspace and sunset the below patches on the next 
convenient patch window.

Thanks,
~Lisa M

diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index dad9fd8..db97332 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2005 Dmitry Yusupov
  * Copyright (C) 2005 Alex Aizman
+ * Copyright (C) 2012 Lisa Maginnis
  * maintained by open-iscsi@googlegroups.com
  *
  * This program is free software; you can redistribute it and/or modify
@@ -106,6 +107,14 @@ struct iscsi_uevent {
 	uint32_t iferror; /* carries interface or resource errors */
 	uint64_t transport_handle;

+	/* Structs in this union can differ on size between 32bit and 64bit
+	 * systems. This will break systems running a 32bit userspace with a
+	 * 64bit kernel. It is important to specify an alignment for the 
+	 * struct(s) so that their sizes match on both in both 32 and 64bit
+	 * systems. Currently the two largest structs are:
+	 * msg_bind_conn: 20 bytes, 24 aligned to the sizeof(uint64_t)
+	 * stop_conn:     20 bytes, 24 aligned to the sizeof(uint64_t)
+	 */
 	union {
 		/* messages u -> k */
 		struct msg_create_session {
@@ -131,7 +140,7 @@ struct iscsi_uevent {
 			uint32_t	cid;
 			uint64_t	transport_eph;
 			uint32_t	is_leading;
-		} b_conn;
+		} b_conn __attribute__((aligned (sizeof(uint64_t))));
 		struct msg_destroy_conn {
 			uint32_t	sid;
 			uint32_t	cid;
@@ -157,7 +166,7 @@ struct iscsi_uevent {
 			uint32_t	cid;
 			uint64_t	conn_handle;
 			uint32_t	flag;
-		} stop_conn;
+		} stop_conn __attribute__((aligned (sizeof(uint64_t))));
 		struct msg_get_stats {
 			uint32_t	sid;
 			uint32_t	cid;
diff --git a/usr/iscsi_netlink.h b/usr/iscsi_netlink.h
index 25b41db..6b482ad 100644
--- a/usr/iscsi_netlink.h
+++ b/usr/iscsi_netlink.h
@@ -2,6 +2,7 @@
  * iSCSI Netlink attr helpers
  *
  * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2012 Lisa Maginnis
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -30,4 +31,10 @@ struct iovec;

 extern struct nlattr *iscsi_nla_alloc(uint16_t type, uint16_t len);

+#ifdef __i386__
+int fix_32bit_kernel_structs; /* If set to 1, will cause reads from the kernel to be
+			       * padded with an extra 4 bytes between iscsi_uevent.u and
+			       * iscsi_uevent.r */
+#endif
+
 #endif
diff --git a/usr/iscsid.c b/usr/iscsid.c
index b4bb65b..53381bf 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman
  * Copyright (C) 2006 Mike Christie
  * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2012 Lisa Maginnis

  * maintained by open-iscsi@googlegroups.com
  *
@@ -52,6 +53,10 @@
 #include "iscsid_req.h"
 #include "iscsi_err.h"

+#ifdef __i386__
+extern int fix_32bit_kernel_structs; /* For i386 compatibility. */
+#endif
+
 /* global config info */
 struct iscsi_daemon_config daemon_config;
 struct iscsi_daemon_config *dconfig = &daemon_config;
@@ -336,6 +341,28 @@ static void missing_iname_warn(char *initiatorname_file)
 		  "ignored.\n", initiatorname_file, initiatorname_file);
 }

+#ifdef __i386__
+/* check_kernel_compatibility()
+ * This function detects when we are built in i386 and running a x86_64 (64bit) kernel and 
+ * sets a flag. This flag is used to to signal the nlpayload_read() and nl_read() functions
+ * in netlink.c
+ */
+void check_kernel_compatibility()
+{
+  struct utsname uname_data;
+  fix_32bit_kernel_structs = 0;
+
+  /* Get our kernel and machine type for compatibility */
+  uname(&uname_data);
+
+  /* If we are not running a x86_64 kernel, enable the kernel struct fix.
+   * TODO: When/if kernel patches are made, a kernel version check should be done here. */
+  if(strcmp(uname_data.machine, "x86_64") != 0) {
+    fix_32bit_kernel_structs = 1; 
+  }
+}
+#endif
+
 int main(int argc, char *argv[])
 {
 	struct utsname host_info; /* will use to compound initiator alias */
@@ -409,6 +436,11 @@ int main(int argc, char *argv[])
 		exit(ISCSI_ERR);
 	}

+#ifdef __i386__
+	/* Check and set kernel compatibility options (x86/x86_64 user/kernel). */
+	check_kernel_compatibility();
+#endif
+
 	umask(0177);

 	mgmt_ipc_fd = -1;
diff --git a/usr/netlink.c b/usr/netlink.c
index d65cd7c..b363439 100644
--- a/usr/netlink.c
+++ b/usr/netlink.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman
  * Copyright (C) 2006 Mike Christie
  * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2012 Lisa Maginnis
  * maintained by open-iscsi@googlegroups.com
  *
  * This program is free software; you can redistribute it and/or modify
@@ -90,6 +91,38 @@ struct nlattr *iscsi_nla_alloc(uint16_t type, uint16_t len)
 	return attr;
 }

+#ifdef __i386__
+#define OLD_32BIT_UEVENT_U_END_BYTE 35 /* Location of the iscsi_uevent struct */
+/* fix_32bit_uevent_struct(char*)
+ * Aligns the iscsi_uevent struct sent from an i386 (32bit) kernel to match our
+ * alignment in iscsi_if.h by adding a 4 byte (sizeof(uint32)) block of padding
+ * between two unions (u/r) in the struct.
+ * data  Pointer to the uevent_iscsi struct.
+ * count Total number of bytes to copy.
+ * peek  Set to 1 if uevent_iscsi was pulled from nl_read()/MSG_PEEK, else
+ *       set to 0.
+*/
+void fix_32bit_uevent_struct(char *data, size_t count, int peek) {
+
+  log_debug(7, "in %s", __FUNCTION__);
+
+  /* Skip creating the offset if we are a PDU, CHAP, or STATS unless it is a peek
+   * (which is called from nl_read()) */
+  if(((uint8_t)data[0] != ISCSI_KEVENT_RECV_PDU 
+     && (uint8_t)data[0] != ISCSI_UEVENT_GET_STATS
+     && (uint8_t)data[0] != ISCSI_UEVENT_GET_CHAP) || peek) {
+
+    /* Move iscsi_uevent.r four bytes (sizeof(uint32_t)) higher  */
+    memmove(&data[OLD_32BIT_UEVENT_U_END_BYTE+sizeof(uint32_t)],
+	    &data[OLD_32BIT_UEVENT_U_END_BYTE],
+	    count-OLD_32BIT_UEVENT_U_END_BYTE-sizeof(uint32_t));
+
+    /* Clear the `uint32_t' padding between iscsi_uevent.u and iscsi_uevent.r */
+    memset(&data[OLD_32BIT_UEVENT_U_END_BYTE], 0, sizeof(uint32_t));
+  } 
+}
+#endif
+
 static int
 kread(char *data, int count)
 {
@@ -176,8 +209,17 @@ nlpayload_read(int ctrl_fd, char *data, int count, int flags)
 	 */
 	rc = recvmsg(ctrl_fd, &msg, flags);

-	if (data)
-		memcpy(data, NLMSG_DATA(iov.iov_base), count);
+	if (data) {
+               memcpy(data, NLMSG_DATA(iov.iov_base), count);
+
+#ifdef __i386__
+	       /* Check if we need to clean this data for compatibility. */
+	       if(fix_32bit_kernel_structs == 1) {
+		 fix_32bit_uevent_struct(data, count, 0);
+	  }
+#endif
+
+	}

 	return rc;
 }
@@ -1281,6 +1323,13 @@ static int ctldev_handle(void)
 	nlh = (struct nlmsghdr *)nlm_ev;
 	ev = (struct iscsi_uevent *)NLMSG_DATA(nlm_ev);

+#ifdef __i386__
+	/* Check if we need to clean this data for compatibility. */
+	if(fix_32bit_kernel_structs == 1) {
+	  fix_32bit_uevent_struct((char*)ev, sizeof(struct iscsi_uevent), 1);
+	}
+#endif
+
 	log_debug(7, "%s got event type %u\n", __FUNCTION__, ev->type);
 	/* drivers like qla4xxx can be inserted after iscsid is started */
 	switch (ev->type) {

nullogic@sdf.org
SDF Public Access UNIX System - http://sdf.org



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Thu, 01 Nov 2012 08:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 01 Nov 2012 08:27:03 GMT) Full text and rfc822 format available.

Message #131 received at 502845@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Lisa Marie <nullogic@SDF.ORG>
Cc: 502845@bugs.debian.org, open-iscsi@packages.debian.org
Subject: Re: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Thu, 1 Nov 2012 01:25:35 -0700
Hi Lisa,

Lisa Marie wrote:

> [Subject: (no subject)]

Please keep in mind that these appear as emails in a crowded inbox, where
a subject line can be very useful for providing context.

> Forwarding this: https://groups.google.com/group/open-iscsi/browse_thread/thread/7b44b4b57f01eb70?hl=en#
>
> Since I'm not sure how long it takes google groups to update, i'll go ahead
> and paste the patch here as well below.
>
> If you apply the first patch from the above link, the second patch below is
> not needed. It is only required for a 32bit userspace to talk to an
> unpatched 32bit kernel. The first patch allows for 64/64, 32/32, and 32/64
> user/kernel setups.

Thanks for working on this!

Your patches have no effect in the 64bit case (good).  In the 32bit
case, they break ABI, so they are a no-go, unfortunately.  The
userspace patch is especially dangerous, since it would make this
bug impossible to fix properly later.

Userspace processes using iscsi start by creating a netlink socket
with socket(PF_NETLINK, SOCK_RAW, NETLINK_ISCSI) and binding to it.
Afterwards, they use sendmsg and recvmsg as appropriate to send and
receive events.

We need to use a different message format when interacting with 32bit
tasks.  Kernel commit 1dacc76d0014 (net/compat/wext: send different
messages to compat tasks, 2009-07-01) can provide some inspiration.

In the send path, the way to do this is to set frag_list to the 32bit
version of the structure, like so:

 #ifdef CONFIG_COMPAT
	compat_skb = alloc_skb(len, GFP_ATOMIC);
	... fill compat_skb ...

	skb_shinfo(skb)->frag_list = compat_skb;
 #endif

Then on a 64bit kernel, 32bit processes will receive compat_skb
instead of skb.  No ABI breakage!

So much for broadcast.  When receiving messages from userspace, we
want to know whether a 32bit process sent the message.  The netlink
API doesn't tell us.  The patch [1] ("netlink: store MSG_CMSG_COMPAT
flag in netlink_skb_parms") is simple and something similar would be
likely to be accepted once there's a caller using it.

Hope that helps,
Jonathan

[1] http://thread.gmane.org/gmane.linux.network/157118/focus=157119



Added indication that 502845 affects open-iscsi Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Thu, 01 Nov 2012 08:54:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Thu, 01 Nov 2012 13:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lisa Marie <nullogic@SDF.LONESTAR.ORG>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Thu, 01 Nov 2012 13:30:03 GMT) Full text and rfc822 format available.

Message #138 received at 502845@bugs.debian.org (full text, mbox):

From: Lisa Marie <nullogic@SDF.LONESTAR.ORG>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: 502845@bugs.debian.org, open-iscsi@packages.debian.org
Subject: Re: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Thu, 1 Nov 2012 09:12:05 -0400 (UTC)
> Your patches have no effect in the 64bit case (good).  In the 32bit
> case, they break ABI, so they are a no-go, unfortunately.  The
> userspace patch is especially dangerous, since it would make this
> bug impossible to fix properly later.

The 2nd patch is set up to not break the ABI for 32bit userspace, the 
first patch would indeed break the ABI (and hence the need for the 2nd 
one).

On Thu, 1 Nov 2012, Jonathan Nieder wrote:

> Date: Thu, 1 Nov 2012 01:25:35 -0700
> From: Jonathan Nieder <jrnieder@gmail.com>
> To: Lisa Marie <nullogic@sdf.org>
> Cc: 502845@bugs.debian.org, open-iscsi@packages.debian.org
> Subject: Re: open-iscsi: login fails using 64-bit kernel with 32-bit userland
> 
> Hi Lisa,
>
> Lisa Marie wrote:
>
>> [Subject: (no subject)]
>
> Please keep in mind that these appear as emails in a crowded inbox, where
> a subject line can be very useful for providing context.
>
>> Forwarding this: https://groups.google.com/group/open-iscsi/browse_thread/thread/7b44b4b57f01eb70?hl=en#
>>
>> Since I'm not sure how long it takes google groups to update, i'll go ahead
>> and paste the patch here as well below.
>>
>> If you apply the first patch from the above link, the second patch below is
>> not needed. It is only required for a 32bit userspace to talk to an
>> unpatched 32bit kernel. The first patch allows for 64/64, 32/32, and 32/64
>> user/kernel setups.
>
> Thanks for working on this!
>
> Your patches have no effect in the 64bit case (good).  In the 32bit
> case, they break ABI, so they are a no-go, unfortunately.  The
> userspace patch is especially dangerous, since it would make this
> bug impossible to fix properly later.
>
> Userspace processes using iscsi start by creating a netlink socket
> with socket(PF_NETLINK, SOCK_RAW, NETLINK_ISCSI) and binding to it.
> Afterwards, they use sendmsg and recvmsg as appropriate to send and
> receive events.
>
> We need to use a different message format when interacting with 32bit
> tasks.  Kernel commit 1dacc76d0014 (net/compat/wext: send different
> messages to compat tasks, 2009-07-01) can provide some inspiration.
>
> In the send path, the way to do this is to set frag_list to the 32bit
> version of the structure, like so:
>
> #ifdef CONFIG_COMPAT
> 	compat_skb = alloc_skb(len, GFP_ATOMIC);
> 	... fill compat_skb ...
>
> 	skb_shinfo(skb)->frag_list = compat_skb;
> #endif
>
> Then on a 64bit kernel, 32bit processes will receive compat_skb
> instead of skb.  No ABI breakage!
>
> So much for broadcast.  When receiving messages from userspace, we
> want to know whether a 32bit process sent the message.  The netlink
> API doesn't tell us.  The patch [1] ("netlink: store MSG_CMSG_COMPAT
> flag in netlink_skb_parms") is simple and something similar would be
> likely to be accepted once there's a caller using it.
>
> Hope that helps,
> Jonathan
>
> [1] http://thread.gmane.org/gmane.linux.network/157118/focus=157119
>

nullogic@sdf.org
SDF Public Access UNIX System - http://sdf.org



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Sun, 11 Nov 2012 15:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julia Longtin <julia.longtin@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Sun, 11 Nov 2012 15:09:03 GMT) Full text and rfc822 format available.

Message #143 received at 502845@bugs.debian.org (full text, mbox):

From: Julia Longtin <julia.longtin@gmail.com>
To: 502845@bugs.debian.org
Subject: what gives
Date: Sun, 11 Nov 2012 15:05:00 +0000
[Message part 1 (text/plain, inline)]
reading the iscsi mailing list link posted, it appears the final patch
addresses the issue concerned, and works on 32/32, 32/64 and 64/64. I have
it running here in my production environment on 32/32 and 32/64 with no
issues. what's happening with this bug?

Julia Longtin
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 12 Nov 2012 08:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 12 Nov 2012 08:45:03 GMT) Full text and rfc822 format available.

Message #148 received at 502845@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Julia Longtin <julia.longtin@gmail.com>
Cc: Lisa Marie <nullogic@SDF.ORG>, Mike Christie <michaelc@cs.wisc.edu>, open-iscsi@googlegroups.com
Subject: Re: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Mon, 12 Nov 2012 00:39:59 -0800
Hi Julia,

Julia Longtin wrote:

> [Subject: what gives]

Please keep in mind that these appear as emails in a crowded inbox,
where an informative subject can be a good way to provide valuable
context.

> reading the iscsi mailing list link posted, it appears the final patch
> addresses the issue concerned, and works on 32/32, 32/64 and 64/64.

Which patch --- Lisa's userspace or kernel patch?

Both break ABI.

While the patches are both useful for insight, the userspace patch, if
widely deployed, would make the kernel interface impossible to fix.
Please make sure anyone applying it knows what they are doing.  The
test it uses for the broken ABI is

	if(strcmp(uname_data.machine, "x86_64") != 0) 
	    fix_32bit_kernel_structs = 1; 

That means:

 * once the x86_64 kernel is fixed to use the correct compat ABI,
   this patch will break userspace!

 * the test is wrong anyway.  On other 64-bit platforms with compat
   support the problem still exists just like before.

However, if you *know* that you will only be using broken kernels then
it is safe to use as a userspace workaround.

>         what's happening with this bug?

The next step is for someone to write a patch to fix the compat
interface on the kernel side.  I explained one way to do this at [1];
I would love to work on that, but unfortunately I have not had a lot
of time recently, so I won't be brokenhearted if someone else gets to
this first.

Thanks and hope that helps,
Jonathan

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=131;bug=502845



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 12 Nov 2012 16:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Hutchings <ben@decadent.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 12 Nov 2012 16:21:03 GMT) Full text and rfc822 format available.

Message #153 received at 502845@bugs.debian.org (full text, mbox):

From: Ben Hutchings <ben@decadent.org.uk>
To: Jonathan Nieder <jrnieder@gmail.com>, 502845@bugs.debian.org
Cc: Julia Longtin <julia.longtin@gmail.com>, Lisa Marie <nullogic@SDF.ORG>, Mike Christie <michaelc@cs.wisc.edu>, open-iscsi@googlegroups.com
Subject: Re: Bug#502845: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Mon, 12 Nov 2012 16:18:44 +0000
[Message part 1 (text/plain, inline)]
On Mon, 2012-11-12 at 00:39 -0800, Jonathan Nieder wrote:
[...]
> While the patches are both useful for insight, the userspace patch, if
> widely deployed, would make the kernel interface impossible to fix.
> Please make sure anyone applying it knows what they are doing.  The
> test it uses for the broken ABI is
> 
> 	if(strcmp(uname_data.machine, "x86_64") != 0) 
> 	    fix_32bit_kernel_structs = 1; 
> 
> That means:
> 
>  * once the x86_64 kernel is fixed to use the correct compat ABI,
>    this patch will break userspace!
> 
>  * the test is wrong anyway.  On other 64-bit platforms with compat
>    support the problem still exists just like before.
[...]

The test is probably right; i386 and (presumably) x32 are the only
architectures that don't have 64-bit alignment for long long.

Ben.

-- 
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 12 Nov 2012 19:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 12 Nov 2012 19:27:03 GMT) Full text and rfc822 format available.

Message #158 received at 502845@bugs.debian.org (full text, mbox):

From: Bastian Blank <waldi@debian.org>
To: Ben Hutchings <ben@decadent.org.uk>, 502845@bugs.debian.org
Cc: Jonathan Nieder <jrnieder@gmail.com>, Julia Longtin <julia.longtin@gmail.com>, Lisa Marie <nullogic@SDF.ORG>, Mike Christie <michaelc@cs.wisc.edu>, open-iscsi@googlegroups.com
Subject: Re: Bug#502845: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Mon, 12 Nov 2012 20:22:42 +0100
On Mon, Nov 12, 2012 at 04:18:44PM +0000, Ben Hutchings wrote:
> The test is probably right; i386 and (presumably) x32 are the only
> architectures that don't have 64-bit alignment for long long.

They haven't fixed this stupidity in x32?

Bastian

-- 
Where there's no emotion, there's no motive for violence.
		-- Spock, "Dagger of the Mind", stardate 2715.1



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#502845; Package linux-2.6. (Mon, 12 Nov 2012 20:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Hutchings <ben@decadent.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Mon, 12 Nov 2012 20:45:04 GMT) Full text and rfc822 format available.

Message #163 received at 502845@bugs.debian.org (full text, mbox):

From: Ben Hutchings <ben@decadent.org.uk>
To: Bastian Blank <waldi@debian.org>, 502845@bugs.debian.org, Jonathan Nieder <jrnieder@gmail.com>, Julia Longtin <julia.longtin@gmail.com>, Lisa Marie <nullogic@SDF.ORG>, Mike Christie <michaelc@cs.wisc.edu>, open-iscsi@googlegroups.com
Subject: Re: Bug#502845: open-iscsi: login fails using 64-bit kernel with 32-bit userland
Date: Mon, 12 Nov 2012 20:42:04 +0000
On Mon, Nov 12, 2012 at 08:22:42PM +0100, Bastian Blank wrote:
> On Mon, Nov 12, 2012 at 04:18:44PM +0000, Ben Hutchings wrote:
> > The test is probably right; i386 and (presumably) x32 are the only
> > architectures that don't have 64-bit alignment for long long.
> 
> They haven't fixed this stupidity in x32?
 
Not sure.  The AMD64 psABI spec seems to say that it does have 64-bit
alignment, but then x32 shares the compat layer with i386 (aside from
time_t handling) which should mean they must have the same alignment.

Ben.

-- 
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
                                                              - Albert Camus



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 16:49:29 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.