[Bug 1424780] Re: iscsitarget crash in 3.19 backport

Stefan Bader stefan.bader at canonical.com
Tue Feb 24 10:06:17 UTC 2015


Ok, I think I got something that works by only changing do_recv:

static int do_recv(struct iscsi_conn *conn, int state)
{
        mm_segment_t oldfs;
        struct msghdr msg;
        struct iovec iov[ISCSI_CONN_IOV_MAX];
       ^ Undone that change and still compiles
        size_t iovlen = ISCSI_CONN_IOV_MAX;
       ^ Need that later to avoid long lines, personal taste

        int i, len, res;
        ...
        if (conn->read_msg.msg_iter.nr_segs < iovlen)
                iovlen = conn->read_msg.msg_iter.nr_segs;
        ^ Old code was looking at msg.msg_iter which is not set, yet

        for (i = 0, len = 0; i < iovlen; i++) {
                iov[i] = conn->read_msg.msg_iter.iov[i];
                len += iov[i].iov_len;
        }
        iov_iter_init(&msg.msg_iter, READ, iov, iovlen, len);
       ^ were using ++i which overshot by one and conn->read_len
          but since len is calculated above and used in sock_recvmsg
          below it seems appropriate to use it here...

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to iscsitarget in Ubuntu.
https://bugs.launchpad.net/bugs/1424780

Title:
  iscsitarget crash in 3.19 backport

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iscsitarget/+bug/1424780/+subscriptions



More information about the Ubuntu-server-bugs mailing list