- kvm-net-tap-linux.c-avoid-abort-when-setting-invalid-fd.patch [RHEL-113894] - kvm-crypto-only-verify-CA-certs-in-chain-of-trust.patch [RHEL-111934] - kvm-crypto-remove-extraneous-pointer-usage-in-gnutls-cer.patch [RHEL-111934] - kvm-crypto-fix-error-reporting-in-cert-chain-checks.patch [RHEL-111934] - kvm-crypto-allow-client-server-cert-chains.patch [RHEL-111934] - kvm-crypto-stop-requiring-key-encipherment-usage-in-x509.patch [RHEL-111934] - kvm-crypto-switch-to-newer-gnutls-API-for-distinguished-.patch [RHEL-111934] - kvm-crypto-remove-redundant-parameter-checking-CA-certs.patch [RHEL-111934] - kvm-crypto-add-missing-free-of-certs-array.patch [RHEL-111934] - kvm-crypto-replace-stat-with-access-for-credential-check.patch [RHEL-111934] - kvm-crypto-remove-redundant-access-checks-before-loading.patch [RHEL-111934] - kvm-crypto-move-check-for-TLS-creds-dir-property.patch [RHEL-111934] - kvm-crypto-use-g_autofree-when-loading-x509-credentials.patch [RHEL-111934] - kvm-crypto-remove-needless-indirection-via-parent_obj-fi.patch [RHEL-111934] - kvm-crypto-move-release-of-DH-parameters-into-TLS-creds-.patch [RHEL-111934] - kvm-crypto-shorten-the-endpoint-server-check-in-TLS-cred.patch [RHEL-111934] - kvm-crypto-remove-duplication-loading-x509-CA-cert.patch [RHEL-111934] - kvm-crypto-reduce-duplication-in-handling-TLS-priority-s.patch [RHEL-111934] - kvm-crypto-introduce-method-for-reloading-TLS-creds.patch [RHEL-111934] - kvm-crypto-introduce-a-wrapper-around-gnutls-credentials.patch [RHEL-111934] - kvm-crypto-fix-lifecycle-handling-of-gnutls-credentials-.patch [RHEL-111934] - kvm-crypto-make-TLS-credentials-structs-private.patch [RHEL-111934] - kvm-crypto-deprecate-use-of-external-dh-params.pem-file.patch [RHEL-111934] - kvm-crypto-avoid-loading-the-CA-certs-twice.patch [RHEL-111934] - kvm-crypto-avoid-loading-the-identity-certs-twice.patch [RHEL-111934] - kvm-crypto-expand-logic-to-cope-with-multiple-certificat.patch [RHEL-111934] - kvm-crypto-support-upto-5-parallel-certificate-identitie.patch [RHEL-111934] - kvm-docs-creation-of-x509-certs-compliant-with-post-quan.patch [RHEL-111934] - kvm-iommufd-Introduce-handler-for-device-ATS-support.patch [RHEL-184675] - kvm-vfio-pci-Add-ats-property.patch [RHEL-184675] - Resolves: RHEL-113894 ([RHEL.10.2][virual network] Hit qemu coredump when removed an interface that the guest is using from the host) - Resolves: RHEL-111934 (QEMU support for loading multiple sets of x509 certs for PQC hybrid mode) - Resolves: RHEL-184675 (NVIDIA:Backport vfio/pci: add vfio-pci ATS control property - RHEL 10.3)
68 lines
2.4 KiB
Diff
68 lines
2.4 KiB
Diff
From a280e29d82926826575b509cceec10f81a9c2350 Mon Sep 17 00:00:00 2001
|
|
From: "Houqi (Nick) Zuo" <hzuo@redhat.com>
|
|
Date: Mon, 8 Dec 2025 12:35:18 +0800
|
|
Subject: [PATCH 01/30] net/tap-linux.c: avoid abort when setting invalid fd
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
RH-Author: Laurent Vivier <lvivier@redhat.com>
|
|
RH-MergeRequest: 506: net/tap-linux.c: avoid abort when setting invalid fd
|
|
RH-Jira: RHEL-113894
|
|
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
|
|
RH-Acked-by: Koushik Dutta <None>
|
|
RH-Commit: [1/1] 76405de0ad722774e385f8cc0a7567fa8cffcac8 (lvivier/qemu-kvm-centos)
|
|
|
|
JIRA: https://redhat.atlassian.net/browse/RHEL-113894
|
|
|
|
This patch removes abort() call in the tap_fd_set_vnet_hdr_len()
|
|
function. If the fd is found to be in a bad state (e.g., EBADFD
|
|
or ENODEV), the function will print an error message.
|
|
|
|
When QEMU creates a tap device automatically and the tap device is
|
|
manually removed from the host while the guest is running, the tap
|
|
device file descriptor becomes invalid. Later, when the guest executes
|
|
shutdown, the tap_fd_set_vnet_hdr_len() function may be called and
|
|
abort QEMU with a core dump when attempting to use the invalid fd.
|
|
The expected behavior for this negative test case is that QEMU should
|
|
report an error but continue running rather than aborting.
|
|
|
|
Testing:
|
|
- Start QEMU with automatically created tap device
|
|
- Manually remove the tap device on the host
|
|
- Execute shutdown in the guest
|
|
- Verify QEMU reports an error but does not abort
|
|
|
|
Fixes: 0caed25cd171 ("virtio: Call set_features during reset")
|
|
Signed-off-by: Houqi (Nick) Zuo <hzuo@redhat.com>
|
|
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
|
(cherry picked from commit a1708203b583ec04fb9b793840dc282d3c89a20d)
|
|
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
|
---
|
|
net/tap-linux.c | 9 +++++----
|
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/net/tap-linux.c b/net/tap-linux.c
|
|
index 8e275d2ea4..7996e305c7 100644
|
|
--- a/net/tap-linux.c
|
|
+++ b/net/tap-linux.c
|
|
@@ -209,10 +209,11 @@ bool tap_probe_has_tunnel(int fd)
|
|
|
|
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
|
{
|
|
- if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
|
|
- fprintf(stderr, "TUNSETVNETHDRSZ ioctl() failed: %s. Exiting.\n",
|
|
- strerror(errno));
|
|
- abort();
|
|
+ int ret;
|
|
+
|
|
+ ret = ioctl(fd, TUNSETVNETHDRSZ, &len);
|
|
+ if (ret != 0) {
|
|
+ error_report("TUNSETVNETHDRSZ ioctl() failed: %s.", strerror(errno));
|
|
}
|
|
}
|
|
|
|
--
|
|
2.52.0
|
|
|