Bug 5576 - fix race condition when computing ocontext SIDs
Summary: fix race condition when computing ocontext SIDs
Status: NEW
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: general/others (show other bugs) general/others
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-20 19:42 UTC by gcc_2023
Modified: 2023-06-21 11:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gcc_2023 2023-06-20 19:42:55 UTC
问题现象:
k8s挂载tmpfs文件系统的挂载点(newshm)目录安全下文(system_u:object_r:adjtime_t:s0)不对, 导致启动容器启动失败。

问题原因:
1、该问题应该上游内核一个bug。大致原因就是就mount tmpfs时候设置tmpfs文件系统的安全上文时,在内核的SID(安全标示)表里去查询对应安全上文里的ID时候,取到CPU的  cached里中间SID值了,所以,导致设置标签不对。已有补丁修解决了该问题,该补丁采用内存屏障来保证cache数据(SID)一致性。
2、补丁链接如下:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/security/selinux/ss/services.c?h=linux-5.4.y&id=b06b1f46306a5fdcb9da8c9cf59e643a357ff6b8
Comment 1 小龙 admin 2023-06-20 19:46:19 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/1769
Comment 2 小龙 admin 2023-06-21 11:42:28 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/1773