block: fix use-after-free in disk_part_iter_next
Ming Lei authored
commit aebf5db9

 upstream.

Make sure that bdgrab() is done on the 'block_device' instance before
referring to it for avoiding use-after-free.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
3d13ebbd
Name Last commit Last update
Documentation USB: UAS: introduce a quirk to set no_write_same
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text
arch KVM: arm64: Don't access PMCR_EL0 when no PMU is available
block block: fix use-after-free in disk_part_iter_next
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
crypto crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
drivers wan: ds26522: select CONFIG_BITREVERSE
firmware Fix built-in early-load Intel microcode alignment
fs btrfs: send: fix wrong file path when there is an inode with a pending rmdir
include vmlinux.lds.h: Add PGO and AutoFDO input sections
init printk: reduce LOG_BUF_SHIFT range for H8300
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
kernel workqueue: Kick a worker based on the actual activation of delayed works
lib lib/genalloc: fix the overflow when size is too big
mm mm/swapfile: do not sleep with a spin lock held
net net: ipv6: fib: flush exceptions when purging route
samples samples: bpf: Fix lwt_len_hist reusing previous BPF map
scripts depmod: handle the case of /sbin/depmod without /sbin in PATH
security ima: Don't modify file descriptor mode on the fly
sound ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
tools perf record: Fix memory leak when using '--user-regs=?' to list registers
usr initramfs: restore default compression behavior
virt KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace
.clang-format clang-format: Set IndentWrappedFunctionNames false
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
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.
See Documentation/00-INDEX for a list of what is contained in each file.

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.