Bug 22236 - [Anolis23][x86_64][社区nightly & 6.6.88] kernel-selftests测试case:openat2.openat2_test、openat2.resolve_test、openat2.rename_attack_test编译报错
Summary: [Anolis23][x86_64][社区nightly & 6.6.88] kernel-selftests测试case:openat2.openat2...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: shuming
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-30 17:03 UTC by gaohongmei
Modified: 2025-07-14 19:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaohongmei 2025-06-30 17:03:29 UTC
Description of problem:

kernel-selftests测试case:openat2.openat2_test、openat2.resolve_test、openat2.rename_attack_test编译报错

Version-Release number of selected component (if applicable):
# uname -r
6.6.88-cbp.git.8932083f9.an23.x86_64

# cat /etc/os-release 
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"



How reproducible:


Steps to Reproduce:
[root@iZbp1d4zy1f9ous1diwpyqZ kernel-selftests]# cd openat2/
[root@iZbp1d4zy1f9ous1diwpyqZ openat2]# ll
total 52
-rw-r--r--. 1 root root  2182 Jun 30 10:09 helpers.c
-rw-r--r--. 1 root root  3569 Jun 30 10:09 helpers.h
-rw-r--r--. 1 root root   246 Jun 30 10:09 Makefile
-rw-r--r--. 1 root root 10086 Jun 30 10:09 openat2_test.c
-rw-r--r--. 1 root root  3669 Jun 30 10:09 rename_attack_test.c
-rw-r--r--. 1 root root 21258 Jun 30 10:09 resolve_test.c

[root@iZbp1d4zy1f9ous1diwpyqZ openat2]# make
gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan     openat2_test.c helpers.c helpers.h  -o /var/tmp/tone/run/kernel-selftests/openat2/openat2_test
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [../lib.mk:174: /var/tmp/tone/run/kernel-selftests/openat2/openat2_test] Error 1

[root@iZbp1d4zy1f9ous1diwpyqZ openat2]# cat Makefile 
# SPDX-License-Identifier: GPL-2.0-or-later

CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan
TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test

include ../lib.mk

$(TEST_GEN_PROGS): helpers.c helpers.h


安装 yum install libasan libubsan后编译报错相同。

Actual results:
编译成功

Expected results:
编译失败

Additional info:

# free -h 
               total        used        free      shared  buff/cache   available
Mem:            15Gi       992Mi        13Gi        46Mi       975Mi        13Gi
Swap:             0B          0B          0B

# lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          46 bits physical, 57 bits virtual
  Byte Order:             Little Endian
CPU(s):                   4
  On-line CPU(s) list:    0-3
Vendor ID:                GenuineIntel
  BIOS Vendor ID:         Alibaba Cloud
  Model name:             Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
    BIOS Model name:      pc-i440fx-2.1  CPU @ 0.0GHz
    BIOS CPU family:      1
    CPU family:           6
    Model:                106
    Thread(s) per core:   2
    Core(s) per socket:   2
    Socket(s):            1
    Stepping:             6
    BogoMIPS:             5399.99
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp l
                          m constant_tsc rep_good nopl nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2
                          apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault ibrs_enhanced fsgsbase tsc_adjust bmi1
                           avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt
                           xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcn
                          tdq rdpid fsrm arch_capabilities
Virtualization features:  
  Hypervisor vendor:      KVM
  Virtualization type:    full
Caches (sum of all):      
  L1d:                    96 KiB (2 instances)
  L1i:                    64 KiB (2 instances)
  L2:                     2.5 MiB (2 instances)
  L3:                     48 MiB (1 instance)
NUMA:                     
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-3
Vulnerabilities:          
  Gather data sampling:   Unknown: Dependent on hypervisor status
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
  Reg file data sampling: Not affected
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Vulnerable
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
  Srbds:                  Not affected
  Tsx async abort:        Not affected
Comment 1 gaohongmei 2025-07-14 10:58:16 UTC
6月24日就开始出现

https://tone.openanolis.cn/ws/jfupduzb/test_result/161386
Comment 2 yuki_syq alibaba_cloud_group 2025-07-14 19:44:09 UTC
报错是因为找不到libasan.a静态库,gcc需要这个静态库来确保在加载其他库之前加载Address
Sanitizer的库,以达到监控效果。libasan.a静态库由libasan-static包提供,需要在测试准备阶段提前安装
Comment 3 yuki_syq alibaba_cloud_group 2025-07-14 19:46:30 UTC
正确加载libasan.a后,openat2的所有测试用例可以pass