public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Rafael David Tinoco <rafaeldtinoco@gmail.com>
To: stable@vger.kernel.org
Cc: rafaeldtinoco@gmail.com, andriin@fb.com, daniel@iogearbox.net,
	yanivagman@gmail.com
Subject: [PATCH] bpf: Track contents of read-only maps as scalars
Date: Sat, 21 Aug 2021 17:31:07 -0300	[thread overview]
Message-ID: <20210821203108.215937-1-rafaeldtinoco@gmail.com> (raw)

During tracee-ebpf regression tests, it was discovered that a CO-RE capable
eBPF program, that relied on a kconfig BTF extern, could not be loaded with
the following error:

libbpf: prog 'tracepoint__raw_syscalls__sys_enter': failed to attach to raw
 tracepoint 'sys_enter': Invalid argument

That happened because the CONFIG_ARCH_HAS_SYSCALL_WRAPPER variable had the
wrong value, despite kconfig map existing, misleading the eBPF program
execution (which would then have different pointers, not accepted by the
verifier during load time).

I got the patch proposed here by bisecting upstream tree with the testcase
just described. I kindly ask you to include this patch in the LTS v5.4.x
series so CO-RE (Compile Once - Run Everywhere) eBPF programs, relying in
kconfig settings, can be correctly loaded in kernel series v5.4.

Link: https://github.com/aquasecurity/tracee/issues/851#issuecomment-903074596

I have tested latest 5.4 stable tree with this patch and it fixes the issue.

-rafaeldtinoco



             reply	other threads:[~2021-08-21 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 20:31 Rafael David Tinoco [this message]
2021-08-21 20:31 ` [PATCH] bpf: Track contents of read-only maps as scalars Rafael David Tinoco
2021-09-01  8:41   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210821203108.215937-1-rafaeldtinoco@gmail.com \
    --to=rafaeldtinoco@gmail.com \
    --cc=andriin@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=stable@vger.kernel.org \
    --cc=yanivagman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox