Re: [PATCH v14 bpf-next 6/6] selftests/bpf: Add test that uses fsverity and xattr to sign a file
From: Song Liu <song@kernel.org>
Date: 2023-11-29 11:20:39
Also in:
bpf, linux-fsdevel
From: Song Liu <song@kernel.org>
Date: 2023-11-29 11:20:39
Also in:
bpf, linux-fsdevel
On Tue, Nov 28, 2023 at 10:47 PM Alexei Starovoitov [off-list ref] wrote:
On Tue, Nov 28, 2023 at 4:37 PM Song Liu [off-list ref] wrote:quoted
+char digest[MAGIC_SIZE + sizeof(struct fsverity_digest) + SHA256_DIGEST_SIZE];when vmlinux is built without CONFIG_FS_VERITY the above fails in a weird way: CLNG-BPF [test_maps] test_sig_in_xattr.bpf.o progs/test_sig_in_xattr.c:36:26: error: invalid application of 'sizeof' to an incomplete type 'struct fsverity_digest' 36 | char digest[MAGIC_SIZE + sizeof(struct fsverity_digest) + SHA256_DIGEST_SIZE]; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~ Is there a way to somehow print a hint during the build what configs users need to enable to pass the build ?
Patch 5/6 added CONFIG_FS_VERITY to tools/testing/selftests/bpf/config. This is a more general question for all required CONFIG_* specified in the file (and the config files for other selftests). In selftests/bpf/Makefile, we have logic to find vmlinux. We can add similar logic to find .config used to build the vmlinux, and grep for each required CONFIG_* from the .config file. Does this sound like a viable solution? Thanks, Song