Go to file
Lv Yunlong 8880e98d3f drivers/block/null_blk/main: Fix a double free in null_init.
[ Upstream commit 72ce11ddfa4e9e1879103581a60b7e34547eaa0a ]

In null_init, null_add_dev(dev) is called.
In null_add_dev, it calls null_free_zoned_dev(dev) to free dev->zones
via kvfree(dev->zones) in out_cleanup_zone branch and returns err.
Then null_init accept the err code and then calls null_free_dev(dev).

But in null_free_dev(dev), dev->zones is freed again by
null_free_zoned_dev().

My patch set dev->zones to NULL in null_free_zoned_dev() after
kvfree(dev->zones) is called, to avoid the double free.

Fixes: 2984c8684f962 ("nullb: factor disk parameters")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Link: https://lore.kernel.org/r/20210426143229.7374-1-lyl2019@mail.ustc.edu.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:55 +08:00
Documentation dt-bindings: net: ethernet-controller: fix typo in NVMEM 2021-05-20 16:07:03 +08:00
LICENSES Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arch x86/events/amd/iommu: Fix sysfs type mismatch 2021-05-20 16:07:54 +08:00
block block: only update parent bi_status when bio fail 2021-05-20 16:07:05 +08:00
certs certs: Fix blacklist flag type confusion 2021-04-12 12:52:25 +08:00
crypto crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS 2021-05-20 16:07:34 +08:00
drivers drivers/block/null_blk/main: Fix a double free in null_init. 2021-05-20 16:07:55 +08:00
fs ovl: fix missing revert_creds() on error path 2021-05-20 16:07:44 +08:00
include tty: fix return value for unsupported ioctls 2021-05-20 16:07:50 +08:00
init init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM 2021-05-20 16:06:54 +08:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2021-03-16 16:27:51 +08:00
kernel sched/debug: Fix cgroup_path[] serialization 2021-05-20 16:07:54 +08:00
lib avoid __memcat_p link failure 2021-05-20 16:07:18 +08:00
mm mm: fix race by making init_zero_pfn() early_initcall 2021-05-20 16:06:49 +08:00
net cfg80211: scan: drop entry from hidden_list on overflow 2021-05-20 16:07:41 +08:00
package net: open CONFIG_XFRM_OFFLOAD for x86 public 2021-05-18 07:22:15 +00:00
samples samples, bpf: Add missing munmap in xdpsock 2021-04-12 12:52:57 +08:00
scripts ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount 2021-04-12 12:52:52 +08:00
security security: commoncap: fix -Wstringop-overread warning 2021-05-20 16:07:35 +08:00
sound ALSA: hda/realtek: ALC285 Thinkpad jack pin quirk is unreachable 2021-05-20 16:07:43 +08:00
tools perf ftrace: Fix access to pid in array when setting a pid filter 2021-05-20 16:07:18 +08:00
usr Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virt KVM: Stop looking for coalesced MMIO zones if the bus is destroyed 2021-05-20 16:07:44 +08:00
.clang-format Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.cocciconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.get_maintainer.ignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitattributes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
COPYING Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
CREDITS Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kbuild Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2021-03-16 16:34:24 +08:00
Makefile Makefile: Move -Wno-unused-but-set-variable out of GCC only block 2021-05-20 16:07:33 +08:00
README Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
README.md Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
backport_remove_lists.txt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tools_key.pub Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00

README.md

Tencent Linux Kernel 4.0