Go to file
Magnus Karlsson 537cf4e3cc xsk: Fix umem cleanup bug at socket destruct
Fix a bug that is triggered when a partially setup socket is
destroyed. For a fully setup socket, a socket that has been bound to a
device, the cleanup of the umem is performed at the end of the buffer
pool's cleanup work queue item. This has to be performed in a work
queue, and not in RCU cleanup, as it is doing a vunmap that cannot
execute in interrupt context. However, when a socket has only been
partially set up so that a umem has been created but the buffer pool
has not, the code erroneously directly calls the umem cleanup function
instead of using a work queue, and this leads to a BUG_ON() in
vunmap().

As there in this case is no buffer pool, we cannot use its work queue,
so we need to introduce a work queue for the umem and schedule this for
the cleanup. So in the case there is no pool, we are going to use the
umem's own work queue to schedule the cleanup. But if there is a
pool, the cleanup of the umem is still being performed by the pool's
work queue, as it is important that the umem is cleaned up after the
pool.

Fixes: e5e1a4bc91 ("xsk: Fix possible memory leak at socket close")
Reported-by: Marek Majtyka <marekx.majtyka@intel.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Marek Majtyka <marekx.majtyka@intel.com>
Link: https://lore.kernel.org/bpf/1605873219-21629-1-git-send-email-magnus.karlsson@gmail.com
2020-11-20 15:52:39 +01:00
arch powerpc fixes for CVE-2020-4788 2020-11-19 11:32:31 -08:00
block block: add a return value to set_capacity_revalidate_and_notify 2020-11-12 13:59:04 -07:00
certs .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
crypto drivers-5.10-2020-10-12 2020-10-13 13:04:41 -07:00
Documentation powerpc fixes for CVE-2020-4788 2020-11-19 11:32:31 -08:00
drivers bnxt_en: fix error return code in bnxt_init_board() 2020-11-19 21:49:01 -08:00
fs gfs2: Fix regression in freeze_go_sync 2020-11-18 16:28:11 +01:00
include xsk: Fix umem cleanup bug at socket destruct 2020-11-20 15:52:39 +01:00
init bootconfig: Extend the magic check range to the preceding 3 bytes 2020-11-12 20:36:52 -05:00
ipc ipc: adjust proc_ipc_sem_dointvec definition to match prototype 2020-09-05 12:14:29 -07:00
kernel Networking fixes for 5.10-rc5, including fixes from the WiFi (mac80211), 2020-11-19 13:33:16 -08:00
lib lib/strncpy_from_user.c: Mask out bytes after NUL terminator. 2020-11-19 11:56:16 -08:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm Networking fixes for 5.10-rc5, including fixes from the WiFi (mac80211), 2020-11-19 13:33:16 -08:00
net xsk: Fix umem cleanup bug at socket destruct 2020-11-20 15:52:39 +01:00
samples Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2020-11-06 17:49:34 -08:00
scripts Networking fixes for 5.10-rc4, including fixes from the bpf subtree. 2020-11-12 14:02:04 -08:00
security selinux/stable-5.10 PR 20201113 2020-11-14 12:04:02 -08:00
sound ASoC: Fixes for v5.10 2020-11-05 18:19:32 +01:00
tools Networking fixes for 5.10-rc5, including fixes from the WiFi (mac80211), 2020-11-19 13:33:16 -08:00
usr Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
virt kvm: x86/mmu: Support dirty logging for the TDP MMU 2020-10-23 03:42:13 -04:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: docs: ignore sphinx_*/ directories 2020-09-10 10:44:31 -06:00
.mailmap mailmap: fix entry for Dmitry Baryshkov/Eremin-Solenikov 2020-11-14 11:26:03 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS Samsung changes for v5.10 2020-11-13 13:16:27 +01:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: Update XDP and AF_XDP entries 2020-11-20 15:44:14 +01:00
Makefile Linux 5.10-rc4 2020-11-15 16:44:31 -08:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.