lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87mt8oy0yu.fsf@toke.dk>
Date:   Fri, 18 Nov 2022 12:08:09 +0100
From:   Toke Høiland-Jørgensen <toke@...nel.org>
To:     Rong Tao <rtoax@...mail.com>, andrii.nakryiko@...il.com,
        sdf@...gle.com
Cc:     andrii@...nel.org, ast@...nel.org, bpf@...r.kernel.org,
        daniel@...earbox.net, dxu@...uu.xyz, haoluo@...gle.com,
        john.fastabend@...il.com, jolsa@...nel.org, kpsingh@...nel.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        lkp@...el.com, lorenzo@...nel.org, martin.lau@...ux.dev,
        memxor@...il.com, mykolal@...com, rongtao@...tc.cn,
        rtoax@...mail.com, shuah@...nel.org, song@...nel.org, yhs@...com
Subject: Re: [PATCH bpf-next v2] selftests/bpf: Fix error: undeclared
 identifier 'NF_NAT_MANIP_SRC'

Rong Tao <rtoax@...mail.com> writes:

> From: Rong Tao <rongtao@...tc.cn>
>
> commit 472caa69183f("netfilter: nat: un-export nf_nat_used_tuple")
> introduce NF_NAT_MANIP_SRC/DST enum in include/net/netfilter/nf_nat.h,
> and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_nat_info
> kfunc") use NF_NAT_MANIP_SRC/DST in test_bpf_nf.c.
>
> In bpf kself-test config (tools/testing/selftests/bpf/config) nf_nat
> is compiled as built-in, this issue occurs just if it is compiled as
> module. we just hardcode 1/0 here.
>
> How to reproduce the error:
>
>    $ make -C tools/testing/selftests/bpf/
>    ...
>       CLNG-BPF [test_maps] test_bpf_nf.bpf.o
>       error: use of undeclared identifier 'NF_NAT_MANIP_SRC'
>             bpf_ct_set_nat_info(ct, &saddr, sport, NF_NAT_MANIP_SRC);
>                                                          ^
>       error: use of undeclared identifier 'NF_NAT_MANIP_DST'
>             bpf_ct_set_nat_info(ct, &daddr, dport, NF_NAT_MANIP_DST);
>                                                          ^
>    2 errors generated.
>
> Signed-off-by: Rong Tao <rongtao@...tc.cn>

This will fix the compilation, but the selftest won't actually work when
nf_nat is compiled as a module (see [0]). Would be better to fix the
test properly instead of just papering over the compilation issue like
this. That requires a bit more surgery to the selftests, though...

-Toke

[0] https://lore.kernel.org/r/87leoh372s.fsf@toke.dk

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ