-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove check for scsi_transport_iscsi version, as it breaks on Slackware #1
Conversation
On 12/11/2011 04:37 PM, Josh Hayes-Sheen wrote:
This is a known problem. We are supposed to modify the module code so Are you the iscsi maintainer for slackware? |
On 12/12/2011 01:04 PM, Mike Christie wrote:
Oh yeah, the check is there because if you try to use the newer |
heh, I'm no maintainer of anything, Just encountered the problem while working on a project for school, fixed it with some help from an old forum post, and figured since I was in my programming/github groove I'd push the change your way, to publish it in case it's useful to someone else.
This shouldn't technically be a slackware specific problem then right? It's just that Slackware by default builds in scsi_transport_iscsi while many other distros just leave it as a module? I wouldn't even know where to start in terms of fixing it in the module, and while maybe I'd come back to it someday, it might be worth mailing the lkml if you need assistance in terms of the actual kernel/module interface code?
Oh I know my "fix" is nasty duct-tape, but it helped me, and I wanted to make it available to others, I honestly don't expect you to actually apply it to your code-base :P |
On 12/12/2011 04:29 PM, Josh Hayes-Sheen wrote:
Ah, crap. Sorry that this slowed you down. I hate when that happens.
Yeah, it is not a problem specific to slackware. It is a problem for any
Yeah, it is kinda nasty. That is why it has not got fixed (you probably
:) |
I removed the check. We have not been using it. Instead we have been checking on a per feature basis, so it was not needed. |
log:modify iSCSI shared memory permissions for logs
I got a kernel NULL pointer derference report as below: BUG: kernel NULL pointer dereference, address: 0000000000000038 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [open-iscsi#1] PREEMPT SMP NOPTI CPU: 4 PID: 1050 Comm: cat Not tainted 5.19.0 open-iscsi#38 RIP: 0010:kernel_getpeername+0xf/0x30 Call Trace: <TASK> ? iscsi_sw_tcp_conn_get_param+0x11f/0x17f show_conn_ep_param_ISCSI_PARAM_CONN_ADDRESS+0x90/0xb0 dev_attr_show+0x1d/0x50 sysfs_kf_seq_show+0xad/0x120 kernfs_seq_show+0x2c/0x40 seq_read_iter+0x12e/0x4d0 ? aa_file_perm+0x177/0x590 kernfs_fop_read_iter+0x183/0x210 new_sync_read+0xfe/0x180 ? 0xffffffff81000000 vfs_read+0x14d/0x1a0 ksys_read+0x6d/0xf0 __x64_sys_read+0x1a/0x20 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The life cycle of socket is: login: ep_connect(create sock) ---> bind_conn(bind sock to conn) logout: ep_disconnect(close sock) ---> stop_conn(unbind sock from conn) The calling order is wrong on logout, will cause this issue in the following scenarios: iscsi logout get sock param by sysfs -------------------------------- --------------------------- User Space | Kernel Space Kernel Space -------------------------------- --------------------------- session_conn_shutdown ep_disconnect close(conn->socket_fd) sock_close __sock_release sock->ops = NULL iscsi_sw_tcp_conn_get_param sock = tcp_sw_conn->sock; kernel_getsockname sock->ops->getname ^^^^^^^^^ NULL pointer dereference ipc->stop_conn __kipc_call iscsi_sw_tcp_conn_stop iscsi_sw_tcp_release_conn sock = NULL So change the calling order of ep_disconnect() and stop_conn() to fix this issue. Signed-off-by: Li Jinlin <lijinlin3@huawei.com>
This probably isn't the best way to handle this, but for now this is a quick-fix to let open-iscsi work on Slackware 13.37 and probably other versions.
The basic issue is that on Slackware with the default 2.6.37.6 kernel, there is no version parameter available through /sys/module/scsi_transport_iscsi/. I'm not sure why this is, the support is compiled into the default kernel and with this change applied iscsid and friends seem to work with no issues.