From: David Vernet <void@manifault.com>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Alexei Starovoitov <ast@kernel.org>,
bpf@vger.kernel.org
Subject: Re: [linux-next:master 7935/14039] progs/task_kfunc_failure.c:76:36: error: no member named 'last_wakee' in 'struct task_struct'
Date: Mon, 12 Dec 2022 17:52:10 -0600 [thread overview]
Message-ID: <Y5e+qj8M3LZafhGK@maniforge.lan> (raw)
In-Reply-To: <202212130502.iuVFgkdf-lkp@intel.com>
On Tue, Dec 13, 2022 at 05:35:01AM +0800, kernel test robot wrote:
> Hi David,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: f925116b24c0c42dc6d5ab5111c55fd7f74e8dc7
> commit: fe147956fca4604b920e6be652abc9bea8ce8952 [7935/14039] bpf/selftests: Add selftests for new task kfuncs
> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
> reproduce:
> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=fe147956fca4604b920e6be652abc9bea8ce8952
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout fe147956fca4604b920e6be652abc9bea8ce8952
> make O=/tmp/kselftest headers
> make O=/tmp/kselftest -C tools/testing/selftests
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
Ah, task->last_wakee isn't defined on UP builds, my mistake. This patch
fixes the issue. I'll send the patch to the bpf list in a separate
email.
From 80ec7fa20b0beb1b047bfc66b49b0910c578da83 Mon Sep 17 00:00:00 2001
From: David Vernet <void@manifault.com>
Date: Mon, 12 Dec 2022 17:34:40 -0600
Subject: [PATCH bpf-next] bpf/selftests: Use parent instead of last_wakee in
task kfunc test
Commit fe147956fca4 ("bpf/selftests: Add selftests for new task kfuncs")
added a negative selftest called task_kfunc_acquire_trusted_walked which
ensures that a BPF program that gets a struct task_struct * pointer from
walking a struct is properly rejected by the verifier if it tries to
pass that pointer to a task kfunc. In order to do this, it uses
task->last_wakee, but unfortunately that's not defined on UP builds.
Just use task->parent instead.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: fe147956fca4 ("bpf/selftests: Add selftests for new task kfuncs")
Signed-off-by: David Vernet <void@manifault.com>
---
tools/testing/selftests/bpf/progs/task_kfunc_failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
index 87fa1db9d9b5..60508c20041f 100644
--- a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
+++ b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
@@ -73,7 +73,7 @@ int BPF_PROG(task_kfunc_acquire_trusted_walked, struct task_struct *task, u64 cl
struct task_struct *acquired;
/* Can't invoke bpf_task_acquire() on a trusted pointer obtained from walking a struct. */
- acquired = bpf_task_acquire(task->last_wakee);
+ acquired = bpf_task_acquire(task->parent);
bpf_task_release(acquired);
return 0;
--
2.38.1
prev parent reply other threads:[~2022-12-12 23:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 21:35 kernel test robot
2022-12-12 23:52 ` David Vernet [this message]
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=Y5e+qj8M3LZafhGK@maniforge.lan \
--to=void@manifault.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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