Closed
【openEuler-24.03-SP3】分域调度使能时写sysfs触发bitmap空指针 #8540
zqiao216Add on  Feb 25Closed at  Apr 10
zqiao216Collaborators
Feb 25 Create

环境信息

【OS版本】(如openEuler-22.03-LTS,参考命令"cat /etc/os-release"结果)
openEuler-24.03-SP3
【内核版本】(如kernel-5.10.0-60.138.0.165,参考命令"uname -r"结果)
6.6.0-132.0.0.111.oe2403sp3.aarch64
【硬件平台】(缺陷相关的硬件信息,如:处理器型号、内存、磁盘、网卡、BIOS 等信息)

【组网信息】(和网络、性能相关的问题,应该说明详细的组网和场景信息)

缺陷信息

【问题复现步骤】

#!/bin/bash

NUM_CLUSTER=24
# 开启内核调度特性
echo SOFT_DOMAIN > /sys/kernel/debug/sched/features

for ((i=0; i<NUM_CLUSTER; i++)); do
    # 创建 cgroup 目录
    CGROUP_PATH="/sys/fs/cgroup/cpu/multiredis-cluster$i"
    mkdir -p "$CGROUP_PATH"

    # 设置该域内的 CPU 数量
    echo 16 > "$CGROUP_PATH/cpu.soft_domain_nr_cpu"

    # 核心逻辑:根据 i 的范围分配不同的 soft_domain 编号
    if (( i >= 0 && i <= 11 )); then
        echo 1 > "$CGROUP_PATH/cpu.soft_domain"
    elif (( i >= 12 && i <= 23 )); then
        echo 2 > "$CGROUP_PATH/cpu.soft_domain"
    fi

    # 打印确认(可选,方便调试)
    echo "Cluster $i assigned to soft_domain $(cat $CGROUP_PATH/cpu.soft_domain)"
done

【实际结果】请描述出问题的结果和影响

[  613.826873] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018
[  613.836366] Mem abort info:
[  613.839850]   ESR = 0x0000000096000004
[  613.844291]   EC = 0x25: DABT (current EL), IL = 32 bits
[  613.850294]   SET = 0, FnV = 0
[  613.854040]   EA = 0, S1PTW = 0
[  613.857871]   FSC = 0x04: level 0 translation fault
[  613.863440] Data abort info:
[  613.867007]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[  613.873182]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[  613.878924]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[  613.884928] user pgtable: 4k pages, 48-bit VAs, pgdp=000008814ad2d000
[  613.892061] [0000000000000018] pgd=0000000000000000, p4d=0000000000000000
[  613.899544] Internal error: Oops: 0000000096000004 [#1] SMP
[  613.905804] Modules linked in: rfkill ipmi_ssif uio_pdrv_genirq uio hibmc_drm acpi_ipmi ofpart drm_vram_helper drm_ttm_helper cmdlinepart arm_smmuv3_pmu arm_spe_pmu ttm ipmi_si drm_display_helper spi_nor mlx5_ib ipmi_devintf hns3_pmu drm_kms_helper mtd hisi_ptt hisi_pcie_pmu ipmi_msghandler ptp_hisi hisi_uncore_cpa_pmu hisi_uncore_pa_pmu hisi_uncore_sllc_pmu hisi_uncore_hha_pmu vfat fat hisi_uncore_ddrc_pmu hisi_uncore_l3c_pmu hisi_uncore_pmu hns_roce_hw_v2 ib_uverbs cppc_cpufreq ib_core fuse drm nfnetlink ext4 mbcache jbd2 crct10dif_ce ghash_ce sm4_ce sm4_ce_cipher sm4 sm3_ce sha3_ce sha512_ce sha512_arm64 nvme hisi_sas_v3_hw sha2_ce nvme_core hisi_sas_main mlx5_core sha256_arm64 hclge t10_pi sha1_ce libsas ahci sbsa_gwdt libahci scsi_transport_sas hns3 crc64_rocksoft_generic crc64_rocksoft libata crc64 mlxfw hnae3 host_edma_drv hisi_uncore_freq spi_hisi_sfc_v3xx hisi_trng_v2 hns_mdio dm_mirror dm_region_hash dm_log dm_multipath dm_mod aes_neon_bs aes_neon_blk aes_ce_blk aes_ce_cipher
[  613.993879] CPU: 16 PID: 14436 Comm: fydd_cluster.sh Kdump: loaded Not tainted 6.6.0-132.0.0.111.oe2403sp3.aarch64 #1
[  614.005177] Hardware name: To be filled by O.E.M. S920X20/BC83AMDAA01-7282C, BIOS 20.55 01/09/2025
[  614.014823] pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[  614.022471] pc : __bitmap_or+0x1c/0x38
[  614.026910] lr : __sched_group_set_soft_domain+0x1f4/0x350
[  614.033084] sp : ffff8000b35eb7d0
[  614.037082] x29: ffff8000b35ebb90 x28: ffff8000b35eb9e8 x27: 0000000000000018
[  614.044906] x26: 0000000000000010 x25: ffff088091eb3018 x24: ffff0880aceba000
[  614.052729] x23: 0000000000000010 x22: ffff088091eb3200 x21: 0000000000000000
[  614.060552] x20: ffffcb93cf28fa90 x19: ffff8000b35eb808 x18: 0000000000000000
[  614.068375] x17: 0000000000000000 x16: 0000000000000000 x15: 0000aaaaf320cfc0
[  614.076198] x14: 0000000000000000 x13: 0000000000000000 x12: ffff8000b35ebc00
[  614.084020] x11: ffff08808f678528 x10: ffff08810f678527 x9 : ffffcb93cdaaaed4
[  614.091843] x8 : ffff8000b35eb9b0 x7 : 0000000000000000 x6 : 0000000000000005
[  614.099665] x5 : ffff8000b35eb808 x4 : ffff088091eb3940 x3 : 0000000000000000
[  614.107488] x2 : 0000000000000018 x1 : ffff8000b35eb988 x0 : ffff8000b35eb988
[  614.115311] Call trace:
[  614.118441]  __bitmap_or+0x1c/0x38
[  614.122528]  sched_group_set_soft_domain+0xd8/0xf8
[  614.128007]  cpu_soft_domain_write_s64+0x1c/0x30
[  614.133311]  cgroup_file_write+0x16c/0x1b0
[  614.138095]  kernfs_fop_write_iter+0x130/0x208
[  614.143454]  new_sync_write+0xb0/0x158
[  614.148116]  vfs_write+0x21c/0x2b0
[  614.152423]  ksys_write+0x78/0x118
[  614.156727]  __arm64_sys_write+0x24/0x38
[  614.161547]  invoke_syscall+0x50/0x128
[  614.166189]  el0_svc_common.constprop.0+0xc8/0xf0
[  614.171786]  do_el0_svc+0x48/0x78
[  614.175993]  el0_slow_syscall+0x44/0x1b8
[  614.180809]  el0t_64_sync_handler+0x100/0x130
[  614.186059]  el0t_64_sync+0x188/0x190
[  614.190613] Code: 2a0303e6 b4000123 d2800003 f8637824 (f8637845) 
[  614.197601] SMP: stopping secondary CPUs
[  614.206130] Starting crashdump kernel...
[  614.211047] Bye!

【期望结果】请描述出期望的结果和影响
功能正常,不触发panic
【其他相关附件信息】比如 syslog、dmesg、panic、lockup、kdump 信息、图片等

# 这里可以附上相关文本信息

【已分析信息】如已经做过分析和定位,请尽量附上详细的分析结果
1NPS配置下,单个NUMA node的cluster数量多于16个,触发数组越界

二、缺陷分析结构反馈
影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

修复是否涉及abi变化(是/否):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 Added label: sig/Kernel
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 changed custom state from 已挂起 to 待办的
openeuler-ci-bot
openeuler-ci-botCollaborators
Feb 25 Comments:
likedislike
openeuler-ci-bot
openeuler-ci-botCollaborators
Feb 25 Comments:

@
issue变更为 [已取消/已挂起] 状态前,请操作者填写相关原因
请按如下格式评论原因后,重新进行操作


/reason xxxxxx

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 Assign allen-shi as responsible person
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 Modify description of issue
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 Removed responsible person allen-shi
openeuler-ci-bot
openeuler-ci-botCollaborators
Feb 25 Comments:

@allen-shi , @alvin-ling , @baratta , @caixu-blue , @chenguangli , @chenjiesong , @chenjunxin1992 , @chenke2026 , @chenwei_kernel , @chiqijun , @chriszjh , @colyli , @CTC-XiboWang , @duanqiangwen , @fangfeng123 , @fanghaiqinghw , @gaojuxin09 , @georgeguo , @giree2 , @GongLei- , @gouhao2022 , @guohaocs2c , @guzitao , @hailan94 , @hanjunguo , @hanliyang , @haochengxie , @hellotcc , @hitmoon , @hjx_gitff , @hongwu-wang , @htforge , @hu-chunzhi , @hunan4222 , @jackknight , @jentlestea , @jerry_lilijun , @jiaoff , @junlong-zheng , @juntianlinux , @kailiu42 , @kaitiandu , @kazero00 , @kevinzhu1 , @kile2009 , @koishimind , @kongzizaixian , @kylin-mayukun , @lengchao , @leoliu-oc , @liaotao-wave , @li-huisong , @linan888 , @lindv , @linyunsheng , @liulongfang , @LiuYongQiang0816 , @lixuefeng-loongson , @LiYihang226 , @lostway1 , @lujialin2 , @maobibo , @mao-hongbo , @markyuan4ta21 , @mingqian218472 , @mufengyan , @newbeats , @pi3orama , @qinirao , @robinorg , @rock_hw , @sanglipeng , @shuaijiakun , @shu-shengming , @sming56_admin , @stavewu , @stkid , @sun_hua_cx , @sunying2022 , @SuperSix173 , @Tankll2021 , @TrueAI , @wangboe2022 , @wangxiongfeng , @wenzhiwei11 , @whoisxxx , @wkfxxx , @woqidaideshi , @wsoydl , @xingmz1 , @xukuohai , @yeweihua999 , @ygn-ndwd-official , @yonghu_4dc5 , @young1c , @young-sun , @yuehaibing_planb , @yuzenghui1 , @zhang-changzhong , @zhangwei123171 , @zhangyi089 , @zhenpengzheng , @zhujianwei001 , @zichengqu , @zqiao216
以下的要求不是强制性的, 未按模板评论时对issue无任何影响
issue处理注意事项:
1. 当前issue受影响的分支提交pr时, 须在pr描述中填写当前issue编号进行关联, 否则无法关闭当前issue;
2. 模板内容需要填写完整, 无论是受影响或者不受影响都需要填写完整内容,未引入的分支不需要填写, 否则无法关闭当前issue;
3. 以下为模板中需要填写完整的内容, 请复制到评论区回复, 注: 内容的标题名称(影响性分析说明, 缺陷严重等级, 受影响版本排查(受影响/不受影响), 修复是否涉及abi变化(是/否))不能省略,省略后defect-manager将无法正常解析填写内容.
评论区可能使用到的指令说明:

指令 指令说明 使用权限
/check-issue 触发defect-manager校验 不限
/reason xxx /reason +挂起或取消条件 不限

影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

abi变化(是/否):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

缺陷issue处理具体操作请参考:
https://gitcode.com/Coopermassaki/cve-manager/blob/master/cve-vulner-manager/doc/md/defect-manager-manual.md
pr关联issue具体操作请参考:
https://docs.gitcode.com/docs/help/home/org_project/pullrequests/pr-related-issue

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 25 Added label: DEFECT/UNFIXED
11 event messages are collapsed here。 See more
openeuler-ci-botopeneuler-ci-botCollaborators
Feb 26 Assign allen-shi as responsible person
zqiao216Collaborators
Apr 10 Comments:

/close

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Apr 10 changed custom state from 待办的 to 已完成
openeuler-ci-botopeneuler-ci-botCollaborators
Apr 10 Close issue
openeuler-ci-botopeneuler-ci-botCollaborators
Apr 10 Removed label: DEFECT/UNFIXED
openeuler-ci-bot
openeuler-ci-botCollaborators
Apr 10 Comments:

@allen-shi 未对受影响版本排查/abi变化进行分析

likedislike