Find a file
Xin Long d6ff94afd9 vlan: move dev_put into vlan_dev_uninit
Shuang Li reported an QinQ issue by simply doing:

  # ip link add dummy0 type dummy
  # ip link add link dummy0 name dummy0.1 type vlan id 1
  # ip link add link dummy0.1 name dummy0.1.2 type vlan id 2
  # rmmod 8021q

 unregister_netdevice: waiting for dummy0.1 to become free. Usage count = 1

When rmmods 8021q, all vlan devs are deleted from their real_dev's vlan grp
and added into list_kill by unregister_vlan_dev(). dummy0.1 is unregistered
before dummy0.1.2, as it's using for_each_netdev() in __rtnl_kill_links().

When unregisters dummy0.1, dummy0.1.2 is not unregistered in the event of
NETDEV_UNREGISTER, as it's been deleted from dummy0.1's vlan grp. However,
due to dummy0.1.2 still holding dummy0.1, dummy0.1 will keep waiting in
netdev_wait_allrefs(), while dummy0.1.2 will never get unregistered and
release dummy0.1, as it delays dev_put until calling dev->priv_destructor,
vlan_dev_free().

This issue was introduced by Commit 563bcbae3b ("net: vlan: fix a UAF in
vlan_dev_real_dev()"), and this patch is to fix it by moving dev_put() into
vlan_dev_uninit(), which is called after NETDEV_UNREGISTER event but before
netdev_wait_allrefs().

Fixes: 563bcbae3b ("net: vlan: fix a UAF in vlan_dev_real_dev()")
Reported-by: Shuang Li <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-09 13:33:39 +00:00
arch - fix missed change for PTR->PTR_WD conversion 2022-02-03 06:45:34 -08:00
block block: add bio_start_io_acct_time() to control start_time 2022-01-28 12:28:15 -07:00
certs certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty 2022-01-23 00:08:44 +09:00
crypto lib/crypto: add prompts back to crypto libraries 2022-01-18 13:03:55 +01:00
Documentation Networking fixes for 5.17-rc3, including fixes from bpf, netfilter, 2022-02-03 16:54:18 -08:00
drivers net: amd-xgbe: disable interrupts during pci removal 2022-02-09 12:52:59 +00:00
fs Notable bug fixes: 2022-02-02 10:14:31 -08:00
include net: fix a memleak when uncloning an skb dst and its metadata 2022-02-09 11:41:47 +00:00
init lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
ipc proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
kernel gcc-plugins/stackleak: Use noinstr in favor of notrace 2022-02-03 17:02:21 -08:00
lib kasan: test: fix compatibility with FORTIFY_SOURCE 2022-01-30 09:56:58 +02:00
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers 2021-12-16 14:33:10 +01:00
mm Revert "mm/gup: small refactoring: simplify try_grab_page()" 2022-02-03 06:51:42 -08:00
net vlan: move dev_put into vlan_dev_uninit 2022-02-09 13:33:39 +00:00
samples Merge branch 'akpm' (patches from Andrew) 2022-01-20 10:41:01 +02:00
scripts ftrace: Have architectures opt-in for mcount build time sorting 2022-01-27 19:15:44 -05:00
security selinux/stable-5.17 PR 20220203 2022-02-03 16:44:12 -08:00
sound proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
tools Networking fixes for 5.17-rc3, including fixes from bpf, netfilter, 2022-02-03 16:54:18 -08:00
usr kbuild: remove include/linux/cyclades.h from header file check 2022-01-27 08:51:08 +01:00
virt Two larger x86 series: 2022-01-28 19:00:26 +02:00
.clang-format genirq/msi: Make interrupt allocation less convoluted 2021-12-16 22:22:20 +01:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap mailmap: update Christian Brauner's email address 2022-02-01 11:21:31 -08:00
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: netfilter: update git links 2022-02-04 05:39:57 +01:00
Makefile Linux 5.17-rc2 2022-01-30 15:37:07 +02: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.