From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
qemu-block@nongnu.org (open list:Block layer core)
Subject: [PATCH] nbd/server: Reject tls-authz without tls-creds
Date: Tue, 1 Dec 2026 15:59:59 -0600 [thread overview]
Message-ID: <20261201220009.406226-2-eblake@redhat.com> (raw)
qemu-nbd already rejects --tls-authz without --tls-creds on the
command line. However, the QMP nbd-server-start command was silent
when requesting tls-authz without tls-creds, even though
authentication is only possible when coupled with a TLS handshake.
Although this is only a configuration bug on the part of the user, it
is worth being noisy about the inconsistent request.
Reported-by: Kathryn Walker
Fixes: https://gitlab.com/qemu-project/qemu/-/work-items/5028
Signed-off-by: Eric Blake <eblake@redhat.com>
---
blockdev-nbd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 696474aea93..e92a76f471e 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -171,6 +171,11 @@ void nbd_server_start(SocketAddress *addr, uint32_t handshake_max_secs,
return;
}
+ if (tls_authz && !tls_creds) {
+ error_setg(errp, "tls-authz only makes sense with tls-creds");
+ return;
+ }
+
nbd_server = g_new0(NBDServerData, 1);
nbd_server->max_connections = max_connections;
nbd_server->handshake_max_secs = handshake_max_secs;
--
2.56.1
next reply other threads:[~2026-12-01 22:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 21:59 Eric Blake [this message]
2026-12-02 8:52 ` [PATCH] nbd/server: Reject tls-authz without tls-creds Daniel P. Berrangé
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=20261201220009.406226-2-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.