]> git.baikalelectronics.ru Git - kernel.git/commit
LoadPin: Ignore the "contents" argument of the LSM hooks
authorKees Cook <keescook@chromium.org>
Fri, 9 Dec 2022 19:54:57 +0000 (11:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:07 +0000 (13:33 +0100)
commit64c7739476f8563055f07d64c9940bba218db861
tree73924a77a76515625c7ff620622c33a7a035450d
parent193f13777d791962c10f6994498ae88a42a38bd3
LoadPin: Ignore the "contents" argument of the LSM hooks

[ Upstream commit 1a17e5b513ceebf21100027745b8731b4728edf7 ]

LoadPin only enforces the read-only origin of kernel file reads. Whether
or not it was a partial read isn't important. Remove the overly
conservative checks so that things like partial firmware reads will
succeed (i.e. reading a firmware header).

Fixes: 3239a9158ddb ("LSM: Add "contents" flag to kernel_read_file hook")
Cc: Paul Moore <paul@paul-moore.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: linux-security-module@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge@hallyn.com>
Tested-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://lore.kernel.org/r/20221209195453.never.494-kees@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/loadpin/loadpin.c