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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+khW7jcXf=qLQB1zcV9TQKNKb64onWicmrx3iH8FNj5broahA@mail.gmail.com>
Date:   Mon, 11 Jan 2021 10:59:26 -0800
From:   Hao Luo <haoluo@...gle.com>
To:     Yonghong Song <yhs@...com>
Cc:     Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>,
        Alexei Starovoitov <ast@...nel.org>
Subject: Re: [PATCH v2 bpf-next 4/7] selftests/bpf: sync RCU before unloading bpf_testmod

Acked-by: Hao Luo <haoluo@...gle.com>

On Sun, Jan 10, 2021 at 8:05 PM Yonghong Song <yhs@...com> wrote:
>
>
>
> On 1/8/21 2:09 PM, Andrii Nakryiko wrote:
> > If some of the subtests use module BTFs through ksyms, they will cause
> > bpf_prog to take a refcount on bpf_testmod module, which will prevent it from
> > successfully unloading. Module's refcnt is decremented when bpf_prog is freed,
> > which generally happens in RCU callback. So we need to trigger
> > syncronize_rcu() in the kernel, which can be achieved nicely with
> > membarrier(MEMBARRIER_CMD_GLOBAL) syscall. So do that in kernel_sync_rcu() and
> > make it available to other test inside the test_progs. This synchronize_rcu()
> > is called before attempting to unload bpf_testmod.
> >
> > Fixes: 9f7fa225894c ("selftests/bpf: Add bpf_testmod kernel module for testing")
> > Suggested-by: Alexei Starovoitov <ast@...nel.org>
> > Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
>
> Acked-by: Yonghong Song <yhs@...com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ