All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC bpf-next 0/3] bpf: Improve verifier coverage on sparc64 et al.
@ 2018-11-29  7:41 David Miller
  0 siblings, 0 replies; only message in thread
From: David Miller @ 2018-11-29  7:41 UTC (permalink / raw)
  To: daniel; +Cc: ast, netdev


On sparc64 a ton of test cases in test_verifier.c fail because
the memory accesses in the test case are unaligned (or cannot
be proven to be aligned by the verifier).

Perhaps we can eventually try to (carefully) modify each one
with this problem to not use unaligned accesses but:

1) That is delicate work.

2) The changes might not fully respect the original
   intention of the testcase.

3) In some cases, such a transformation might not even
   be feasible at all.

So add an "any alignment" flags to tell the verifier to forcefully
disable it's alignment checks completely.

test_verifier.c is then annotated to use this flag when necessary.

The presence of the flag in each test case is good documentation
to anyone who wants to actually tackling the job of eliminating
the unaligned memory accesses in the test cases.

I've also seen several weird things in test cases, like trying to
access __skb->mark in a packet buffer.

A couple of unresolves issues, in my opinion:

1) Maybe make this privileged, or at least prevent executing programs
   that have had the 'any alignment' flag passed to the verifier when
   we are on an inefficient unaligned access cpu.

2) Since we don't actually execute the "ACCEPT" cases (only enforced
   in the test_verifier.c code, see #1) maybe we should report them
   in some special way so that this is clear in the output.

This gets rid of 104 test_verifier.c failures on sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-29 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29  7:41 [PATCH RFC bpf-next 0/3] bpf: Improve verifier coverage on sparc64 et al David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.