mbox series

[-fixes,0/2] Fix WX mappings in the linear mapping after module unloading

Message ID 20231213134027.155327-1-alexghiti@rivosinc.com (mailing list archive)
Headers show
Series Fix WX mappings in the linear mapping after module unloading | expand

Message

Alexandre Ghiti Dec. 13, 2023, 1:40 p.m. UTC
I fell onto a bunch of WX mappings in the linear mapping after a module
gets unloaded, this is because our module_alloc() does not set the
VM_FLUSH_RESET_PERMS flag (patch 1) and that
set_direct_map_default_noflush() must clean the X bit (patch 2).

Note that the Fixes tags are correct but patch 2 will fail to apply
since a change in this function just landed in 6.7.

Alexandre Ghiti (2):
  riscv: Fix module_alloc() that did not reset the linear mapping
    permissions
  riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC

 arch/riscv/kernel/module.c | 3 ++-
 arch/riscv/mm/pageattr.c   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

patchwork-bot+linux-riscv@kernel.org Dec. 21, 2023, 3 a.m. UTC | #1
Hello:

This series was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Wed, 13 Dec 2023 14:40:25 +0100 you wrote:
> I fell onto a bunch of WX mappings in the linear mapping after a module
> gets unloaded, this is because our module_alloc() does not set the
> VM_FLUSH_RESET_PERMS flag (patch 1) and that
> set_direct_map_default_noflush() must clean the X bit (patch 2).
> 
> Note that the Fixes tags are correct but patch 2 will fail to apply
> since a change in this function just landed in 6.7.
> 
> [...]

Here is the summary with links:
  - [-fixes,1/2] riscv: Fix module_alloc() that did not reset the linear mapping permissions
    https://git.kernel.org/riscv/c/2f748fa7b60a
  - [-fixes,2/2] riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
    https://git.kernel.org/riscv/c/3b5c14361d61

You are awesome, thank you!