请教下,假设内核合入了对应补丁。 如果用户态程序是用 2.34之前的glibc编译出来的,代码中使用固定的 MINSIGSTKSZ。这种程序在与新内核交互时是否可能出现前面说的栈溢出情况? 因为客户的程序很多并不是在最新版本上编译出来使用的。
-----邮件原件----- 发件人: Wang, Lin X lin.x.wang@intel.com 发送时间: 2022年10月24日 19:19 收件人: Zhengzengkai zhengzengkai@huawei.com; Tian, Jun J jun.j.tian@intel.com; Zhoukang (A) zhoukang7@huawei.com; kernel@openeuler.org 抄送: Xiexiuqi xiexiuqi@huawei.com; Zeng, Jason jason.zeng@intel.com; Dukaitian (Dukaitian, Intelligent Computing R&D) dukaitian@huawei.com; Huxinwei huxinwei@huawei.com; Hushiyuan hushiyuan@huawei.com; Xuhanbing xuhanbing@huawei.com 主题: RE: [PATCH openEuler-5.10 0/4] Try to fix kabi change caused by Intel AMX
uapi/auxvec: Define the aux vector AT_MINSIGSTKSZ
这个patch是“Improve Minimum Alternate Stack Size”这组patch中的一个, 实现的功能之一就是动态计算出当前用户栈所需要满足的最小要求,用户 可以直接调用用户态接口而无需依赖libc:
getauxval(AT_MINSIGSTKSZ);
libc在2.34之前给出的MINSIGSTKSZ是一个固定值,可能会造成栈溢出(比 如使用了AVX512:https://bugzilla.kernel.org/show_bug.cgi?id=153531%EF%BC%89%EF%BC%8C%E5%9C%A... AMX这类动态特性加入后就完全不能满足要求了,所以2.34+也实现了类 似功能,通过#include <signal.h>就可以获得deliver signal所需要满足的要求。
Br,
Lin
-----Original Message----- From: Zhengzengkai zhengzengkai@huawei.com Sent: Monday, October 24, 2022 5:10 PM To: Tian, Jun J jun.j.tian@intel.com; Zhoukang (A) zhoukang7@huawei.com; kernel@openeuler.org Cc: Xiexiuqi xiexiuqi@huawei.com; Zeng, Jason jason.zeng@intel.com; Wang, Lin X lin.x.wang@intel.com; Dukaitian (Dukaitian, Intelligent Computing R&D) dukaitian@huawei.com; Huxinwei huxinwei@huawei.com; Hushiyuan hushiyuan@huawei.com; Xuhanbing xuhanbing@huawei.com Subject: 答复: [PATCH openEuler-5.10 0/4] Try to fix kabi change caused by Intel AMX
好的,谢谢!我们也再评估下, 另外 uapi目录修改的那个头文件, 是给用户态libc库用的吗? 是否有libc的对 应补丁;
-----邮件原件----- 发件人: Tian, Jun J [mailto:jun.j.tian@intel.com] 发送时间: 2022年10月24日 15:41 收件人: Zhoukang (A) zhoukang7@huawei.com; Zhengzengkai zhengzengkai@huawei.com; kernel@openeuler.org 抄送: Xiexiuqi xiexiuqi@huawei.com; Zeng, Jason jason.zeng@intel.com; Wang, Lin X lin.x.wang@intel.com; Dukaitian (Dukaitian, Intelligent Computing R&D) dukaitian@huawei.com; Huxinwei huxinwei@huawei.com; Hushiyuan hushiyuan@huawei.com; Xuhanbing xuhanbing@huawei.com 主题: RE: [PATCH openEuler-5.10 0/4] Try to fix kabi change caused by Intel AMX
目前看为了统一KABI的检查,最好还是利用__GENKSYMS__包含对应已有 修改的kernel struct和ABI。 这样防止SPR代码合并后check-kabi持续误报的问题,我们也会对SPR相应 的KABI change的部分统一 通过这个方式处理以保持一致。当然前提是大家已经审视过SPR相应 change并没有被引用或者影响可控。
修改KABI CRC工具未来也可能造成其他潜在问题,比如不参与checksum检 查的KABI未来可能有 第三方module会引用。
Thanks, Jun Tian
-----Original Message----- From: Zhoukang (A) zhoukang7@huawei.com Sent: Saturday, October 22, 2022 3:54 PM To: Zhengzengkai zhengzengkai@huawei.com; kernel@openeuler.org Cc: Xiexiuqi xiexiuqi@huawei.com; Zeng, Jason jason.zeng@intel.com; Wang, Lin X lin.x.wang@intel.com; Tian, Jun J jun.j.tian@intel.com; Dukaitian (Dukaitian, Intelligent Computing R&D) dukaitian@huawei.com; Huxinwei huxinwei@huawei.com;
Hushiyuan
hushiyuan@huawei.com; Xuhanbing xuhanbing@huawei.com Subject: RE: [PATCH openEuler-5.10 0/4] Try to fix kabi change caused by Intel AMX
代码注释有点少, 无法体现KABI兼容思路与驱动的使用约束;
兼容补丁基于下面设计约束进行设计: 内核KABI白名单主要是为第3方驱动提供稳定的运行环境; 因此fpu, task_thread, 中断数据结构内部成员, 禁止驱动代码使用; 已经排查过
driver
目录确实没有驱动使用的情况; 基于上面约束, 因此当前fix kabi的补丁仅是避免了检查工具的误报;
另外一种解决思路: 直接修改kabi CRC计算工具, 将特定数据结构的CRC值清除; 同时需要在
编
译阶段检查驱动没有使用特定的数据结构成员;
-----Original Message----- From: Zhengzengkai Sent: Saturday, October 22, 2022 3:39 PM To: kernel@openeuler.org Cc: Xiexiuqi xiexiuqi@huawei.com; Zhoukang (A) zhoukang7@huawei.com; jason.zeng@intel.com; lin.x.wang@intel.com; jun.j.tian@intel.com; Dukaitian (Dukaitian, Intelligent Computing R&D) dukaitian@huawei.com; Zhengzengkai zhengzengkai@huawei.com Subject: [PATCH openEuler-5.10 0/4] Try to fix kabi change caused by Intel AMX
These four patches try to avoid or fix kabi change caused by Intel AMX PR: https://gitee.com/openeuler/kernel/pulls/58
Zheng Zengkai (4): x86: Avoid kabi change caused by adding pkru element in thread_struct x86/extable: Avoid kabi change caused by exception table rework x86/fpu: Avoid kabi change caused by struct fpu mm: Fix kabi change caused by saved_auxv[] in mm_struct for x86_64
arch/x86/include/asm/extable.h | 4 ++++ arch/x86/include/asm/fpu/types.h | 4 ++++ arch/x86/include/asm/processor.h | 2 ++ arch/x86/include/uapi/asm/auxvec.h | 1 + include/linux/mm_types.h | 15 +++++++++++++++ 5 files changed, 26 insertions(+)
-- 2.20.1
Kernel mailing list -- kernel@openeuler.org To unsubscribe send an email to kernel-leave@openeuler.org