• Yajun Deng's avatar
    netlink: Deal with ESRCH error in nlmsg_notify() · fef773fc
    Yajun Deng authored
    Yonghong Song report:
    The bpf selftest tc_bpf failed with latest bpf-next.
    The following is the command to run and the result:
    $ ./test_progs -n 132
    [   40.947571] bpf_testmod: loading out-of-tree module taints kernel.
    test_tc_bpf:PASS:test_tc_bpf__open_and_load 0 nsec
    test_tc_bpf:PASS:bpf_tc_hook_create(BPF_TC_INGRESS) 0 nsec
    test_tc_bpf:PASS:bpf_tc_hook_create invalid hook.attach_point 0 nsec
    test_tc_bpf_basic:PASS:bpf_obj_get_info_by_fd 0 nsec
    test_tc_bpf_basic:PASS:bpf_tc_attach 0 nsec
    test_tc_bpf_basic:PASS:handle set 0 nsec
    test_tc_bpf_basic:PASS:priority set 0 nsec
    test_tc_bpf_basic:PASS:prog_id set 0 nsec
    test_tc_bpf_basic:PASS:bpf_tc_attach replace mode 0 nsec
    test_tc_bpf_basic:PASS:bpf_tc_query 0 nsec
    test_tc_bpf_basic:PASS:handle set 0 nsec
    test_tc_bpf_basic:PASS:priority set 0 nsec
    test_tc_bpf_basic:PASS:prog_id set 0 nsec
    libbpf: Kernel error message: Failed to send filter delete notification
    test_tc_bpf_basic:FAIL:bpf_tc_detach unexpected error: -3 (errno 3)
    test_tc_bpf:FAIL:test_tc_internal ingress unexpected error: -3 (errno 3)
    
    The failure seems due to the commit
        cfdf0d9a ("rtnetlink: use nlmsg_notify() in rtnetlink_send()")
    
    Deal with ESRCH error in nlmsg_notify() even the report variable is zero.
    Reported-by: default avatarYonghong Song <yhs@fb.com>
    Signed-off-by: default avatarYajun Deng <yajun.deng@linux.dev>
    Link: https://lore.kernel.org/r/20210719051816.11762-1-yajun.deng@linux.devSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    fef773fc
af_netlink.c 68.2 KB