mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Petr Pavlu <ppavlu@suse.cz>, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Petr Pavlu <petr.pavlu@suse.com>
Subject: Re: [PATCH] target/iscsi: Fix detection of excess number of login exchanges
Date: Mon, 28 Feb 2022 19:23:56 -0600	[thread overview]
Message-ID: <a7e1f13e-326f-fdba-5272-9cbc7ba2a3cf@oracle.com> (raw)
In-Reply-To: <20220222124217.21715-1-ppavlu@suse.cz>

On 2/22/22 6:42 AM, Petr Pavlu wrote:
> From: Petr Pavlu <petr.pavlu@suse.com>
> 
> Function iscsi_target_do_login() attempts to cancel a connection when
> a number of login exchanges reaches MAX_LOGIN_PDUS (7). This is done by
> having a local counter and incrementing+checking it as the function
> processes requests in a loop. A problem is that since the login rework in
> back in 2013, the function always processes only a single request and the
> loop is terminated at the end of the first iteration. This means the
> counter reaches only value 1 and any excess number of login requests is
> never rejected.
> 
> Fix the problem by introducing iscsi_login.negotiation_exchanges counter
> and update the logic to count exchanges per each login phase as described
> in RFC 7143:
>> 6.2. Text Mode Negotiation:
>> [...]
>> In the Login Phase (see Section 6.3), every stage is a separate
>> negotiation. [...]
>> [...]
>> An iSCSI initiator or target MAY terminate a negotiation that does
>> not terminate within an implementation-specific reasonable time or
>> number of exchanges but SHOULD allow at least six (6) exchanges.
> 

It wasn't clear to me what this fixes. Today, are initiators sending more
than 6 exchanges and if so what happens to the target? Is it crashing or
annoying to user or cause some sort of endless login so we run out of
resources? Or is this more of code cleanup?

When does this happen and with what initiators?

  reply	other threads:[~2022-03-01  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 12:42 Petr Pavlu
2022-03-01  1:23 ` Mike Christie [this message]
2022-03-11  9:15   ` Petr Pavlu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7e1f13e-326f-fdba-5272-9cbc7ba2a3cf@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=petr.pavlu@suse.com \
    --cc=ppavlu@suse.cz \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®