Skip to content

[BUG] none-initialized pagetable data #19874

Description

@evolution124

Description / Steps to reproduce the issue

  1. run qemu with backend file to simulate ram with random initialized ram data.
  2. mmu pagetable in linker script is NONLOAD
  3. mmu qemu_rv_kernel_mappings dose not initialize pagetable with initial value (like zero)
  4. when mmu find initialized mapping, will use none-initialized value which cause error.
static void map_region(uintptr_t paddr, uintptr_t vaddr, size_t size, uint32_t mmuflags)
{
  uintptr_t alignaddr;
  uintptr_t endaddr;
  uintptr_t pbase;

  endaddr = vaddr + size;
 
  while (vaddr < endaddr)
    {
      /* See if a mapping exists ? */
      /* mmu_ln_getentry will get un initialized value */
      pbase = mmu_pte_to_paddr(mmu_ln_getentry(
                 KMM_SPBASE_IDX, KMM_SPBASE, vaddr));

On which OS does this issue occur?

[OS: Windows], [OS: Linux]

What is the version of your OS?

Ubuntu 24.04

NuttX Version

96f440f0c068f278cc11a956c2c6cf52ff79cf01

Issue Architecture

[Arch: risc-v]

Issue Area

[Area: Memory Management], [Area: Board support]

Host information

qemu to run the rv64
qemu-system-riscv64 --version
QEMU emulator version 10.0.0

Verification

  • I have verified before submitting the report.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: risc-vIssues related to the RISC-V (32-bit or 64-bit) architectureArea: Board supportBoard support issuesArea: Memory ManagementMemory Management issuesOS: LinuxIssues related to Linux (building system, etc)OS: WindowsIssues related to Windows (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions