]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'enforce W^X for trampoline and dispatcher'
authorAlexei Starovoitov <ast@kernel.org>
Tue, 27 Sep 2022 03:40:44 +0000 (20:40 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Sep 2022 03:40:44 +0000 (20:40 -0700)
commitacc19ffedcae3b367eb327a7f456950d236d590d
tree0967cb40ef2d0af8f6beab452a0ed72cb0640c52
parent828b512daea2cc78f33845b4bd48dcab43e8c3ae
parent5a214b2def770b0df301515866b2394e716cbed0
Merge branch 'enforce W^X for trampoline and dispatcher'

Song Liu says:

====================

Changes v1 => v2:
1. Update arch_prepare_bpf_dispatcher to use a RO image and a RW buffer.
   (Alexei) Note: I haven't found an existing test to cover this part, so
   this part was tested manually (comparing the generated dispatcher is
   the same).

Jeff Layton reported CPA W^X warning linux-next [1]. It turns out to be
W^X issue with bpf trampoline and bpf dispatcher. Fix these by:

1. Use bpf_prog_pack for bpf_dispatcher;
2. Set memory permission properly with bpf trampoline.

[1] https://lore.kernel.org/lkml/c84cc27c1a5031a003039748c3c099732a718aec.camel@kernel.org/
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>