qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 37/45] linux-user/aarch64: Do not allow duplicate or short


From: Richard Henderson
Subject: Re: [PATCH v4 37/45] linux-user/aarch64: Do not allow duplicate or short sve records
Date: Tue, 5 Jul 2022 09:02:26 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 7/5/22 09:00, Richard Henderson wrote:
On 7/4/22 17:38, Peter Maydell wrote:
          case TARGET_SVE_MAGIC:
+            if (sve || size < sizeof(struct target_sve_context)) {
+                goto err;
+            }
              if (cpu_isar_feature(aa64_sve, env_archcpu(env))) {
                  vq = sve_vq(env);
                  sve_size = QEMU_ALIGN_UP(TARGET_SVE_SIG_CONTEXT_SIZE(vq), 16);
-                if (!sve && size == sve_size) {
+                if (size == sve_size) {
                      sve = (struct target_sve_context *)ctx;
                      break;
                  }

On the other hand, the kernel seems to happily allow records
which are larger than the SVE_SIG_CONTEXT_SIZE, whereas we
ignore the record unless there's an exact size match.

Yeah, this gets fixed properly in patch 39.
Perhaps I should simply squash this with that?

Bah! No, those are two separate checks: the minimum size to contain vq and flags (target_sve_context) and the minimum size to contain all of the vector data (TARGET_SVE_SIG_CONTEXT_SIZE).

The latter *is* fixed in patch 39, but this one should stay as-is.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]