Commit a4ff09a1 authored by Magnus Karlsson's avatar Magnus Karlsson Committed by Xie XiuQi
Browse files

xsk: add missing smp_rmb() in xsk_mmap



mainline inclusion
from mainline-v5.0-rc7
commit e6762c8b
category: bugfix
bugzilla: 10762
CVE: NA

-------------------------------------------------

All the setup code in AF_XDP is protected by a mutex with the
exception of the mmap code that cannot use it. To make sure that a
process banging on the mmap call at the same time as another process
is setting up the socket, smp_wmb() calls were added in the umem
registration code and the queue creation code, so that the published
structures that xsk_mmap needs would be consistent. However, the
corresponding smp_rmb() calls were not added to the xsk_mmap
code. This patch adds these calls.

Fixes: 37b07693 ("xsk: add missing write- and data-dependency barrier")
Fixes: c0c77d8f ("xsk: add user memory registration support sockopt")
Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarLin Miaohe <linmiaohe@huawei.com>
Reviewed-by: default avatarMao Wenan <maowenan@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 5d946333
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment