summary refs log tree commit diff stats
path: root/results/classifier/user-mode-bugs/2647
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-05 20:00:38 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-05 20:00:38 +0200
commit96049c939b1916d80532630d63c14e04d5244f1d (patch)
tree7fb9df428f074078e714f1e038210cdff887185a /results/classifier/user-mode-bugs/2647
parent40bbb77d4dfebff4f99c2f90b2c0db737b0ecc5a (diff)
downloadqemu-analysis-96049c939b1916d80532630d63c14e04d5244f1d.tar.gz
qemu-analysis-96049c939b1916d80532630d63c14e04d5244f1d.zip
lock user-mode and semantic-bugs
Diffstat (limited to 'results/classifier/user-mode-bugs/2647')
-rw-r--r--results/classifier/user-mode-bugs/264749
1 files changed, 49 insertions, 0 deletions
diff --git a/results/classifier/user-mode-bugs/2647 b/results/classifier/user-mode-bugs/2647
new file mode 100644
index 000000000..ef37f48ac
--- /dev/null
+++ b/results/classifier/user-mode-bugs/2647
@@ -0,0 +1,49 @@
+
+
+A code error in accel/tcg/user-exec.c
+Description of problem:
+accel/tcg/user-exec.c:
+```
+static int probe_access_internal(CPUArchState *env, vaddr addr,
+                                 int fault_size, MMUAccessType access_type,
+                                 bool nonfault, uintptr_t ra)
+{
+    int acc_flag;
+    bool maperr;
+
+    switch (access_type) {
+    case MMU_DATA_STORE:
+        acc_flag = PAGE_WRITE_ORG;
+        break;
+    case MMU_DATA_LOAD:
+        acc_flag = PAGE_READ;
+        break;
+    case MMU_INST_FETCH:
+        acc_flag = PAGE_EXEC;
+        break;
+    default:
+        g_assert_not_reached();
+    }
+
+    if (guest_addr_valid_untagged(addr)) {
+        int page_flags = page_get_flags(addr);
+        if (page_flags & acc_flag) {
+            if ((acc_flag == PAGE_READ || acc_flag == PAGE_WRITE)
+                && cpu_plugin_mem_cbs_enabled(env_cpu(env))) {
+                return TLB_MMIO;
+            }
+            return 0; /* success */
+        }
+        maperr = !(page_flags & PAGE_VALID);
+    } else {
+        maperr = true;
+    }
+
+    if (nonfault) {
+        return TLB_INVALID_MASK;
+    }
+
+    cpu_loop_exit_sigsegv(env_cpu(env), addr, access_type, maperr, ra);
+}
+```
+The conditional judgment "acc_flag == PAGE_WRITE" seems to have an issue, because acc_flag can only be PAGE_WRITE_ORG, PAGE_READ or PAGE_EXEC from the previous code.