Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: riscv: reset global pointer on exception #81155

Merged
merged 3 commits into from
Nov 14, 2024

Commits on Nov 10, 2024

  1. arch: riscv: add macro to access hardware registers

    Add macros to read / write hardware registers.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    ycsin committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    3898597 View commit details
    Browse the repository at this point in the history
  2. arch: riscv: reset global pointer on exception

    Reset the gp on exception entry from u-mode to protect the kernel
    against a possible rogue user thread.
    
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    ycsin committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    6193a93 View commit details
    Browse the repository at this point in the history
  3. tests: arch: riscv: make sure that gp reg can't be corrupted

    Add a test to make sure that the `gp` global pointer register used for
    relative addressing when `CONFIG_RISCV_GP` is enabled can't be
    corrupted by a rogue user thread.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    ycsin committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    3a82ebb View commit details
    Browse the repository at this point in the history