]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pkey: fix paes selftest failure with paes and pkey static build
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 15 Sep 2020 09:00:17 +0000 (11:00 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 3 Nov 2020 14:12:16 +0000 (15:12 +0100)
commita57d5ad809899519d9678a1d5f3dfcdeb7a58c6b
tree1ba9f4c3d1aaa4c96acb30ccfe48c9b806a18928
parentd6f20dcc6783e1e83386da29d40ab6923d591a7d
s390/pkey: fix paes selftest failure with paes and pkey static build

When both the paes and the pkey kernel module are statically build
into the kernel, the paes cipher selftests run before the pkey
kernel module is initialized. So a static variable set in the pkey
init function and used in the pkey_clr2protkey function is not
initialized when the paes cipher's selftests request to call pckmo for
transforming a clear key value into a protected key.

This patch moves the initial setup of the static variable into
the function pck_clr2protkey. So it's possible, to use the function
for transforming a clear to a protected key even before the pkey
init function has been called and the paes selftests may run
successful.

Reported-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
Cc: <stable@vger.kernel.org> # 4.20
Fixes: e854798bb2be ("s390/pkey: move pckmo subfunction available checks away from module init")
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/pkey_api.c