]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'bpf: Support <8-byte scalar spill and refill'
authorAlexei Starovoitov <ast@kernel.org>
Sun, 26 Sep 2021 20:07:28 +0000 (13:07 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Sep 2021 20:07:28 +0000 (13:07 -0700)
commit2b3ec67c4a746147c6bb5c13dca0a5e76346bca3
treedbea750e919a475e18b051f991552847ec0b65ff
parent7db677f5cfa4c4973576a4f0d40d24577d4fcd16
parent38602d656b30d664bfa4f051dd1d7c6a2d6fdcae
Merge branch 'bpf: Support <8-byte scalar spill and refill'

Martin KaFai says:

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

The verifier currently does not save the reg state when
spilling <8byte bounded scalar to the stack.  The bpf program
will be incorrectly rejected when this scalar is refilled to
the reg and then used to offset into a packet header.
The later patch has a simplified bpf prog from a real use case
to demonstrate this case.  The current work around is
to reparse the packet again such that this offset scalar
is close to where the packet data will be accessed to
avoid the spill.  Thus, the header is parsed twice.

The llvm patch [1] will align the <8bytes spill to
the 8-byte stack address.  This set is to make the necessary
changes in verifier to support <8byte scalar spill and refill.

[1] https://reviews.llvm.org/D109073

v2:
- Changed the xdpwall selftest in patch 3 to trigger a u32
  spill at a non 8-byte aligned stack address.  The v1 has
  simplified the real example too much such that it only
  triggers a u32 spill but does not spill at a non
  8-byte aligned stack address.
- Changed README.rst in patch 3 to explain the llvm dependency
  for the xdpwall test.
====================

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