* [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4
@ 2022-12-04 7:30 Thomas Huth
2022-12-04 7:30 ` [PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks Thomas Huth
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Thomas Huth @ 2022-12-04 7:30 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel
Hi Stefan!
The following changes since commit c4ffd91aba1c3d878e99a3e7ba8aad4826728ece:
Update VERSION for v7.2.0-rc3 (2022-11-29 18:15:26 -0500)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2022-12-04
for you to fetch changes up to c1966f515d9bb6d8ed7076f4bebdc45407700100:
hw/display/next-fb: Fix comment typo (2022-12-03 22:07:07 +0100)
----------------------------------------------------------------
In case we're doing a rc4 before the release, I'd like to see
these three patches included. They contain:
* Fix for a potential undefined behavior in cleanup of migration-test
* Fix for a s390x instruction that causes Java to crash
* Fix for a typo in a comment in next-fb.c
All patches are rather small and self-contained and have been
properly reviewed, so I think it should be OK to still include
them at this point in time.
----------------------------------------------------------------
Evgeny Ermakov (1):
hw/display/next-fb: Fix comment typo
Thomas Huth (2):
tests/qtest/migration-test: Fix unlink error and memory leaks
target/s390x/tcg: Fix and improve the SACF instruction
target/s390x/tcg/insn-data.h.inc | 2 +-
hw/display/next-fb.c | 2 +-
target/s390x/tcg/cc_helper.c | 7 +++++++
tests/qtest/migration-test.c | 20 ++++++++++++++++----
4 files changed, 25 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks
2022-12-04 7:30 [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Thomas Huth
@ 2022-12-04 7:30 ` Thomas Huth
2022-12-04 7:30 ` [PULL 2/3] target/s390x/tcg: Fix and improve the SACF instruction Thomas Huth
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2022-12-04 7:30 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel
When running the migration test compiled with Clang from Fedora 37
and sanitizers enabled, there is an error complaining about unlink():
../tests/qtest/migration-test.c:1072:12: runtime error: null pointer
passed as argument 1, which is declared to never be null
/usr/include/unistd.h:858:48: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
../tests/qtest/migration-test.c:1072:12 in
(test program exited with status code 1)
TAP parsing error: Too few tests run (expected 33, got 20)
The data->clientcert and data->clientkey pointers can indeed be unset
in some tests, so we have to check them before calling unlink() with
those.
While we're at it, I also noticed that the code is only freeing
some but not all of the allocated strings in this function, and
indeed, valgrind is also complaining about memory leaks here.
So let's call g_free() on all allocated strings to avoid leaking
memory here.
Message-Id: <20221125083054.117504-1-thuth@redhat.com>
Tested-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/migration-test.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 442998d9eb..dbde726adf 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -1066,15 +1066,27 @@ test_migrate_tls_x509_finish(QTestState *from,
TestMigrateTLSX509Data *data = opaque;
test_tls_cleanup(data->keyfile);
+ g_free(data->keyfile);
+
unlink(data->cacert);
+ g_free(data->cacert);
unlink(data->servercert);
+ g_free(data->servercert);
unlink(data->serverkey);
- unlink(data->clientcert);
- unlink(data->clientkey);
- rmdir(data->workdir);
+ g_free(data->serverkey);
+ if (data->clientcert) {
+ unlink(data->clientcert);
+ g_free(data->clientcert);
+ }
+ if (data->clientkey) {
+ unlink(data->clientkey);
+ g_free(data->clientkey);
+ }
+
+ rmdir(data->workdir);
g_free(data->workdir);
- g_free(data->keyfile);
+
g_free(data);
}
#endif /* CONFIG_TASN1 */
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 2/3] target/s390x/tcg: Fix and improve the SACF instruction
2022-12-04 7:30 [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Thomas Huth
2022-12-04 7:30 ` [PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks Thomas Huth
@ 2022-12-04 7:30 ` Thomas Huth
2022-12-04 7:30 ` [PULL 3/3] hw/display/next-fb: Fix comment typo Thomas Huth
2022-12-04 23:47 ` [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2022-12-04 7:30 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel
The SET ADDRESS SPACE CONTROL FAST instruction is not privileged, it can be
used from problem space, too. Just the switching to the home address space
is privileged and should still generate a privilege exception. This bug is
e.g. causing programs like Java that use the "getcpu" vdso kernel function
to crash (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990417#26 ).
While we're at it, also check if DAT is not enabled. In that case the
instruction is supposed to generate a special operation exception.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/655
Message-Id: <20221201184443.136355-1-thuth@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/tcg/insn-data.h.inc | 2 +-
target/s390x/tcg/cc_helper.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/target/s390x/tcg/insn-data.h.inc b/target/s390x/tcg/insn-data.h.inc
index 7e952bdfc8..54d4250c9f 100644
--- a/target/s390x/tcg/insn-data.h.inc
+++ b/target/s390x/tcg/insn-data.h.inc
@@ -1365,7 +1365,7 @@
/* SERVICE CALL LOGICAL PROCESSOR (PV hypercall) */
F(0xb220, SERVC, RRE, Z, r1_o, r2_o, 0, 0, servc, 0, IF_PRIV | IF_IO)
/* SET ADDRESS SPACE CONTROL FAST */
- F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
+ C(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0)
/* SET CLOCK */
F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
/* SET CLOCK COMPARATOR */
diff --git a/target/s390x/tcg/cc_helper.c b/target/s390x/tcg/cc_helper.c
index b2e8d3d9f5..b36f8cdc8b 100644
--- a/target/s390x/tcg/cc_helper.c
+++ b/target/s390x/tcg/cc_helper.c
@@ -487,6 +487,10 @@ void HELPER(sacf)(CPUS390XState *env, uint64_t a1)
{
HELPER_LOG("%s: %16" PRIx64 "\n", __func__, a1);
+ if (!(env->psw.mask & PSW_MASK_DAT)) {
+ tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC());
+ }
+
switch (a1 & 0xf00) {
case 0x000:
env->psw.mask &= ~PSW_MASK_ASC;
@@ -497,6 +501,9 @@ void HELPER(sacf)(CPUS390XState *env, uint64_t a1)
env->psw.mask |= PSW_ASC_SECONDARY;
break;
case 0x300:
+ if ((env->psw.mask & PSW_MASK_PSTATE) != 0) {
+ tcg_s390_program_interrupt(env, PGM_PRIVILEGED, GETPC());
+ }
env->psw.mask &= ~PSW_MASK_ASC;
env->psw.mask |= PSW_ASC_HOME;
break;
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 3/3] hw/display/next-fb: Fix comment typo
2022-12-04 7:30 [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Thomas Huth
2022-12-04 7:30 ` [PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks Thomas Huth
2022-12-04 7:30 ` [PULL 2/3] target/s390x/tcg: Fix and improve the SACF instruction Thomas Huth
@ 2022-12-04 7:30 ` Thomas Huth
2022-12-04 23:47 ` [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2022-12-04 7:30 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Signed-off-by: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Message-Id: <20221125160849.23711-1-evgeny.v.ermakov@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/display/next-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c
index dd6a1aa8ae..8446ff3c00 100644
--- a/hw/display/next-fb.c
+++ b/hw/display/next-fb.c
@@ -126,7 +126,7 @@ static void nextfb_class_init(ObjectClass *oc, void *data)
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->realize = nextfb_realize;
- /* Note: This device does not any state that we have to reset or migrate */
+ /* Note: This device does not have any state that we have to reset or migrate */
}
static const TypeInfo nextfb_info = {
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4
2022-12-04 7:30 [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Thomas Huth
` (2 preceding siblings ...)
2022-12-04 7:30 ` [PULL 3/3] hw/display/next-fb: Fix comment typo Thomas Huth
@ 2022-12-04 23:47 ` Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2022-12-04 23:47 UTC (permalink / raw)
To: Thomas Huth; +Cc: Stefan Hajnoczi, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-12-04 23:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 7:30 [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Thomas Huth
2022-12-04 7:30 ` [PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks Thomas Huth
2022-12-04 7:30 ` [PULL 2/3] target/s390x/tcg: Fix and improve the SACF instruction Thomas Huth
2022-12-04 7:30 ` [PULL 3/3] hw/display/next-fb: Fix comment typo Thomas Huth
2022-12-04 23:47 ` [PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4 Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).