Skip to content
Commit 6cbac1e4 authored by Matan Barak's avatar Matan Barak Committed by Doug Ledford
Browse files

IB/mlx5: Allow mapping the free running counter on PROT_EXEC

The current mlx5 code disallows mapping the free running counter of
mlx5 based hardwares when PROT_EXEC is set.
Although this behaviour is correct, Linux does add an implicit VM_EXEC
to the vm_flags if the READ_IMPLIES_EXEC bit is set in the process
personality. This happens for example if the process stack is
executable.

This causes libmlx5 to output a warning and prevents the user from
reading the free running clock.
Executing the init segment of the hardware isn't a security risk
(at least no more than executing a process own stack), so we just
prevent writes to there.

Fixes: d69e3bcf

 ('IB/mlx5: Mmap the HCA's core clock register to
		      user-space')
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Reviewed-by: default avatarHaggai Eran <haggaie@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent ee71b968
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment