Go to file
Ondrej Mosnacek b17dd53cac selinux: fix NULL-pointer dereference when hashtab allocation fails
commit dc27f3c5d10c58069672215787a96b4fae01818b upstream.

When the hash table slot array allocation fails in hashtab_init(),
h->size is left initialized with a non-zero value, but the h->htable
pointer is NULL. This may then cause a NULL pointer dereference, since
the policydb code relies on the assumption that even after a failed
hashtab_init(), hashtab_map() and hashtab_destroy() can be safely called
on it. Yet, these detect an empty hashtab only by looking at the size.

Fix this by making sure that hashtab_init() always leaves behind a valid
empty hashtab when the allocation fails.

Cc: stable@vger.kernel.org
Fixes: 03414a49ad ("selinux: do not allocate hashtabs dynamically")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-26 10:39:21 +01:00
arch KVM: nVMX: don't use vcpu->arch.efer when checking host state on nested state load 2021-11-26 10:39:20 +01:00
block block: Check ADMIN before NICE for IOPRIO_CLASS_RT 2021-11-26 10:39:19 +01:00
certs
crypto crypto: pcrypt - Delay write to padata->info 2021-11-18 14:04:12 +01:00
Documentation fscrypt: allow 256-bit master keys with AES-256-XTS 2021-11-18 14:03:54 +01:00
drivers scsi: ufs: core: Fix task management completion timeout race 2021-11-26 10:39:21 +01:00
fs btrfs: fix memory ordering between normal and ordered work functions 2021-11-26 10:39:20 +01:00
include RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-26 10:39:21 +01:00
init bootconfig: init: Fix memblock leak in xbc_make_cmdline() 2021-11-21 13:46:35 +01:00
ipc ipc: WARN if trying to remove ipc object which is absent 2021-11-26 10:39:19 +01:00
kernel tracing: Add length protection to histogram string copies 2021-11-26 10:39:14 +01:00
lib lib/xz: Validate the value before assigning it to an enum variable 2021-11-18 14:03:58 +01:00
LICENSES
mm hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-11-26 10:39:21 +01:00
net cfg80211: call cfg80211_stop_ap when switch from P2P_GO type 2021-11-26 10:39:20 +01:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-18 14:04:11 +01:00
scripts scripts/lld-version.sh: Rewrite based on upstream ld-version.sh 2021-11-21 13:46:37 +01:00
security selinux: fix NULL-pointer dereference when hashtab allocation fails 2021-11-26 10:39:21 +01:00
sound ALSA: gus: fix null pointer dereference on pointer block 2021-11-26 10:39:11 +01:00
tools perf tests: Remove bash construct from record+zstd_comp_decomp.sh 2021-11-26 10:39:13 +01:00
usr
virt KVM: do not shrink halt_poll_ns below grow_start 2021-10-09 14:40:58 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.10.81 2021-11-21 13:46:37 +01: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.