• Aux@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    8 months ago

    Modern CPUs and operating systems have distinction between data and code in memory. Usually only privileged processes have the right to make data executable. If you load some random stuff into memory and tell your CPU to execute it as a code, you’ll get nuked by OS.

    • uis@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      Usually only privileged processes have the right to make data executable.

      Not true. Only kernel can mark memory page as executable, but any process can request to kernel to do so. This is why JIT compilers work.