Kernel sources for Moto G9 (Play) (Guamp)
Find a file
David Howells 9cf7b6615f certs: Fix blacklist flag type confusion
[ Upstream commit 4993e1f9479a4161fd7d93e2b8b30b438f00cb0f ]

KEY_FLAG_KEEP is not meant to be passed to keyring_alloc() or key_alloc(),
as these only take KEY_ALLOC_* flags.  KEY_FLAG_KEEP has the same value as
KEY_ALLOC_BYPASS_RESTRICTION, but fortunately only key_create_or_update()
uses it.  LSMs using the key_alloc hook don't check that flag.

KEY_FLAG_KEEP is then ignored but fortunately (again) the root user cannot
write to the blacklist keyring, so it is not possible to remove a key/hash
from it.

Fix this by adding a KEY_ALLOC_SET_KEEP flag that tells key_alloc() to set
KEY_FLAG_KEEP on the new key.  blacklist_init() can then, correctly, pass
this to keyring_alloc().

We can also use this in ima_mok_init() rather than setting the flag
manually.

Note that this doesn't fix an observable bug with the current
implementation but it is required to allow addition of new hashes to the
blacklist in the future without making it possible for them to be removed.

Fixes: 734114f878 ("KEYS: Add a system blacklist keyring")
Reported-by: Mickaël Salaün <mic@linux.microsoft.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Mickaël Salaün <mic@linux.microsoft.com>
cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 09:39:44 +01:00
arch MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0 2021-03-04 09:39:38 +01:00
block bfq: Avoid false bfq queue merging 2021-03-04 09:39:31 +01:00
certs certs: Fix blacklist flag type confusion 2021-03-04 09:39:44 +01:00
crypto crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key() 2021-03-04 09:39:41 +01:00
Documentation dm integrity: conditionally disable "recalculate" feature 2021-01-30 13:32:13 +01:00
drivers regulator: axp20x: Fix reference cout leak 2021-03-04 09:39:44 +01:00
firmware
fs quota: Fix memory leak when handling corrupted quota file 2021-03-04 09:39:42 +01:00
include certs: Fix blacklist flag type confusion 2021-03-04 09:39:44 +01:00
init fgraph: Initialize tracing_graph_pause at task creation 2021-02-13 13:51:13 +01:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2020-05-20 08:18:40 +02:00
kernel ima: Free IMA measurement buffer after kexec syscall 2021-03-04 09:39:42 +01:00
lib lib/string: Add strscpy_pad() function 2021-02-13 13:51:15 +01:00
LICENSES
mm memcg: fix a crash in wb_workfn when a device disappears 2021-02-13 13:51:15 +01:00
net bpf: Fix bpf_fib_lookup helper MTU check for SKB ctx 2021-03-04 09:39:36 +01:00
samples samples: bpf: Fix lwt_len_hist reusing previous BPF map 2020-12-30 11:25:57 +01:00
scripts scripts/recordmcount.pl: support big endian for ARCH sh 2021-03-04 09:39:30 +01:00
security certs: Fix blacklist flag type confusion 2021-03-04 09:39:44 +01:00
sound ASoC: cpcap: fix microphone timeslot mask 2021-03-04 09:39:40 +01:00
tools objtool: Don't fail on missing symbol table 2021-02-07 14:48:38 +01:00
usr initramfs: restore default compression behavior 2020-04-13 10:44:59 +02:00
virt kvm: check tlbs_dirty directly 2021-02-23 15:01:00 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2020-09-26 18:01:31 +02:00
Makefile Linux 4.19.177 2021-02-23 15:01:00 +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.
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.