btrfs: fix possible NULL-pointer dereference in integrity checks
Johannes Thumshirn authored
[ Upstream commit 3dbd351d ]

A user reports a possible NULL-pointer dereference in
btrfsic_process_superblock(). We are assigning state->fs_info to a local
fs_info variable and afterwards checking for the presence of state.

While we would BUG_ON() a NULL state anyways, we can also just remove
the local fs_info copy, as fs_info is only used once as the first
argument for btrfs_num_copies(). There we can just pass in
state->fs_info as well.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205003

Signed-off-by: default avatarJohannes Thumshirn <jth@kernel.org>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
ebf8e541
Name Last commit Last update
Documentation fbdev: fix numbering of fbcon options
LICENSES LICENSES: Rename other to deprecated
arch x86/mm: Fix NX bit clearing issue in kernel_map_pages_in_pgd
block block, bfq: do not plug I/O for bfq_queues with no proc refs
certs PKCS#7: Refactor verify_pkcs7_signature()
crypto crypto: essiv - fix AEAD capitalization and preposition use in help text
drivers pwm: Remove set but not set variable 'pwm'
fs btrfs: fix possible NULL-pointer dereference in integrity checks
include raid6/test: fix a compilation warning
init Revert "um: Enable CONFIG_CONSTRUCTORS"
ipc ipc/msg.c: consolidate all xxxctl_down() functions
kernel watchdog/softlockup: Enforce that timestamp is valid on boot
lib debugobjects: Fix various data races
mm mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush
net bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map
samples samples/bpf: Set -fno-stack-protector when building BPF programs
scripts kbuild: remove *.tmp file when filechk fails
security selinux: ensure we cleanup the internal AVC counters on error in avc_update()
sound ASoC: SOF: Intel: hda: Fix SKL dai count
tools usbip: Fix unsafe unaligned pointer usage
usr gen_initramfs_list.sh: fix 'bad variable name' error
virt KVM: arm64: Treat emulated TVAL TimerValue as a signed 32-bit integer
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore Merge tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
.mailmap Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
COPYING COPYING: use the new text with points to the license files
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer
Kbuild kbuild: do not descend to ./Kbuild when cleaning
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst
MAINTAINERS MAINTAINERS: correct entries for ISDN/mISDN section
Makefile Linux 5.4.21
README Drop all 00-INDEX files from Documentation/
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.