“0539a1de4f4941a35d47b7ae9dffab761eaa29d3”上不存在“test/git@gitcode.net:openanolis/dragonwell8_jdk.git”
arm64/sve: Better handle failure to allocate SVE register storage
mainline inclusion from mainline-v5.15-rc1 commit 7559b7d7 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5ITJT CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7559b7d7d651d397debbcd838bd49ec4b9e0a4a4 ------------------------------------------------- Currently we "handle" failure to allocate the SVE register storage by doing a BUG_ON() and hoping for the best. This is obviously not great and the memory allocation failure will already be loud enough without the BUG_ON(). As the comment says it is a corner case but let's try to do a bit better, remove the BUG_ON() and add code to handle the failure in the callers. For the ptrace and signal code we can return -ENOMEM gracefully however we have no real error reporting path available to us for the SVE access trap so instead generate a SIGKILL if the allocation fails there. This at least means that we won't try to soldier on and end up trying to access the nonexistant state and while it's obviously not ideal for userspace SIGKILL doesn't allow any handling so minimises the ABI impact, making it easier to improve the interface later if we come up with a better idea. Signed-off-by: NMark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210824153417.18371-1-broonie@kernel.orgSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com> Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Showing
想要评论请 注册 或 登录