All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH for 11.2] io: fix busy-wait when uncorking
Date: Tue,  1 Dec 2026 18:15:59 +0000	[thread overview]
Message-ID: <20261201181559.3015655-1-berrange@redhat.com> (raw)

If we have corked data pending on the TLS channel, when uncorking
if we don't make progress sending any data, the code currently
busy-waits as it mistakenly expects QCRYPTO_TLS_SESSIONERR_BLOCK.

This return value is never set by the uncork method, as that will
always return the amount of outstanding data. IOW, to detect this
situation we need to look for the amount of corked data being
unchanged.

The busy-waiting would allow a lesser privileged, but none the less
authenticated & authorized, network client to create a denial of
service attack on the whole VM which can be owned by a user with
high privileges.

Fixes: https://gitlab.com/qemu-project/qemu/-/work_items/5027
Fixes: CVE-2026-141376
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 io/channel-tls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io/channel-tls.c b/io/channel-tls.c
index 5b0524e68dd..1da9cd08ef0 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -462,7 +462,7 @@ static ssize_t qio_channel_tls_writev(QIOChannel *ioc,
      */
     while (tioc->corked) {
         ssize_t ret = qcrypto_tls_session_write_uncork(tioc->session, errp);
-        if (ret == QCRYPTO_TLS_SESSION_ERR_BLOCK) {
+        if (ret == tioc->corked) {
             if (done) {
                 return done;
             } else {
-- 
2.56.1



             reply	other threads:[~2026-12-01 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 18:15 Daniel P. Berrangé [this message]
2026-12-01 22:36 ` [PATCH for 11.2] io: fix busy-wait when uncorking Eric Blake

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=20261201181559.3015655-1-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.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 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.