Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • QEMU QEMU
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 787
    • Issues 787
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • QEMUQEMU
  • QEMUQEMU
  • Issues
  • #1065
Closed
Open
Issue created Jun 06, 2022 by TrungNguyen1909@TrungNguyen1909

cputlb: uninitialized local variable in tlb_set_page_with_attrs cause SIGSEGV when a CPU access an unmapped IOMMU page

Host environment

  • Operating system: Any
  • OS/kernel version: Any
  • Architecture: Any
  • QEMU flavor: qemu-system
  • QEMU version:QEMU emulator version 7.0.0 (v6.2.0-3146-g7e0e865ad5-dirty)

Emulated/Virtualized environment

  • Architecture: TCG-based

Description of problem

When a TCG cpu accesses an unmapped page within an IOMMU region that causes a translation fault, QEMU SIGSEGVs in io_readx. The reason was that in address_space_translate_for_iotlb, xlat is not set on a permission fault. As a result, xlat in tlb_set_page_with_attr is uninitialized. This in turn causes various mis-calculation and eventually crashes in io_readx.

Suggested fix

I would suggest setting *xlat = addr before the for loop in address_space_translate_for_iotlb so that if the translation fail, we can still have a guest error log that shows a meaningful address.

Edited Jun 07, 2022 by TrungNguyen1909
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking