]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/ptrace: Don't clear calling process' TIF_SME on OOM
authorMark Brown <broonie@kernel.org>
Fri, 2 Sep 2022 13:28:02 +0000 (14:28 +0100)
committerWill Deacon <will@kernel.org>
Thu, 8 Sep 2022 13:26:59 +0000 (14:26 +0100)
commit1a38e776e2d26180e22ce686792ee606286a00fe
treecb40d09e6a721ff284d5a42ed6903c0ec23d3b2f
parent6b1541ffdf391f00444cd70b93b6d72fc62b974f
arm64/ptrace: Don't clear calling process' TIF_SME on OOM

If allocating memory for the target SVE state in za_set() fails we clear
TIF_SME for the ptracing task which is obviously not correct.  If we are
here we know that the target task already had neither TIF_SVE nor
TIF_SME set since we only need to allocate if either the target had not
used either SVE or SME and had no need to allocate state before or we
just changed the vector length with vec_set_vector_length() which clears
TIF_ for us on allocation failure so just remove the clear entirely.

Reported-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220902132802.39682-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/ptrace.c