Skip to content
  • Eric Blake's avatar
    5de47735
    nbd: Tolerate more errors to structured reply request · 5de47735
    Eric Blake authored
    
    
    A server may have a reason to reject a request for structured replies,
    beyond just not recognizing them as a valid request; similarly, it may
    have a reason for rejecting a request for a meta context.  It doesn't
    hurt us to continue talking to such a server; otherwise 'qemu-nbd
    --list' of such a server fails to display all available details about
    the export.
    
    Encountered when temporarily tweaking nbdkit to reply with
    NBD_REP_ERR_POLICY.  Present since structured reply support was first
    added (commit d795299b reused starttls handling, but starttls is
    different in that we can't fall back to other behavior on any error).
    
    Note that for an unencrypted client trying to connect to a server that
    requires encryption, this defers the point of failure to when we
    finally execute a strict command (such as NBD_OPT_GO or NBD_OPT_LIST),
    now that the intermediate NBD_OPT_STRUCTURED_REPLY does not diagnose
    NBD_REP_ERR_TLS_REQD as fatal; but as the protocol eventually gets us
    to a command where we can't continue onwards, the changed error
    message doesn't cause any security concerns.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20190824172813.29720-3-eblake@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    [eblake: fix iotest 233]
    5de47735
    nbd: Tolerate more errors to structured reply request
    Eric Blake authored
    
    
    A server may have a reason to reject a request for structured replies,
    beyond just not recognizing them as a valid request; similarly, it may
    have a reason for rejecting a request for a meta context.  It doesn't
    hurt us to continue talking to such a server; otherwise 'qemu-nbd
    --list' of such a server fails to display all available details about
    the export.
    
    Encountered when temporarily tweaking nbdkit to reply with
    NBD_REP_ERR_POLICY.  Present since structured reply support was first
    added (commit d795299b reused starttls handling, but starttls is
    different in that we can't fall back to other behavior on any error).
    
    Note that for an unencrypted client trying to connect to a server that
    requires encryption, this defers the point of failure to when we
    finally execute a strict command (such as NBD_OPT_GO or NBD_OPT_LIST),
    now that the intermediate NBD_OPT_STRUCTURED_REPLY does not diagnose
    NBD_REP_ERR_TLS_REQD as fatal; but as the protocol eventually gets us
    to a command where we can't continue onwards, the changed error
    message doesn't cause any security concerns.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20190824172813.29720-3-eblake@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    [eblake: fix iotest 233]
Loading