Skip to content

Commit 02cfffb

Browse files
committed
safety comments
1 parent 28dc837 commit 02cfffb

23 files changed

+293
-465
lines changed

.github/workflows/busybox.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ CONFIG_CAT=y
209209
# CONFIG_CP is not set
210210
# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
211211
# CONFIG_FEATURE_CP_REFLINK is not set
212-
CONFIG_CUT=y
212+
# CONFIG_CUT is not set
213213
# CONFIG_DATE is not set
214214
# CONFIG_FEATURE_DATE_ISOFMT is not set
215215
# CONFIG_FEATURE_DATE_NANO is not set
@@ -449,7 +449,7 @@ CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0
449449
# CONFIG_FEATURE_FIND_REGEX is not set
450450
# CONFIG_FEATURE_FIND_CONTEXT is not set
451451
# CONFIG_FEATURE_FIND_LINKS is not set
452-
CONFIG_GREP=y
452+
# CONFIG_GREP is not set
453453
# CONFIG_EGREP is not set
454454
# CONFIG_FGREP is not set
455455
# CONFIG_FEATURE_GREP_CONTEXT is not set

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
timeout-minutes: 20
1212

1313
strategy:
14+
fail-fast: false
1415
matrix:
1516
arch: [arm, arm64, ppc64le, riscv64, x86_64]
1617
toolchain: [gcc, clang, llvm]
@@ -363,7 +364,8 @@ jobs:
363364
- run: |
364365
grep '] rust_seq_file: Rust seq_file sample (init)$' qemu-stdout.log
365366
grep '] rust_seq_file: Rust seq_file sample (exit)$' qemu-stdout.log
366-
test $(grep -c 'rust_seq_file: device opened this many times: 2' qemu-stdout.log) -eq 2
367+
grep 'rust_seq_file read log: 1' qemu-stdout.log
368+
grep 'rust_seq_file read log: 2' qemu-stdout.log
367369
368370
# Report
369371
- run: |

.github/workflows/kernel-arm64-debug-thinlto.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,7 @@ CONFIG_SAMPLE_RUST_STACK_PROBING=m
14371437
CONFIG_SAMPLE_RUST_SEMAPHORE=m
14381438
CONFIG_SAMPLE_RUST_SEMAPHORE_C=m
14391439
CONFIG_SAMPLE_RUST_RANDOM=m
1440+
CONFIG_SAMPLE_RUST_SEQ_FILE=m
14401441

14411442
#
14421443
# arm64 Debugging

.github/workflows/kernel-arm64-debug.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ CONFIG_DCACHE_WORD_ACCESS=y
10691069
#
10701070
# Pseudo filesystems
10711071
#
1072-
CONFIG_PROC_FS=y
1072+
# CONFIG_PROC_FS is not set
10731073
# CONFIG_PROC_CHILDREN is not set
10741074
# CONFIG_SYSFS is not set
10751075
# CONFIG_HUGETLBFS is not set

.github/workflows/kernel-arm64-release-thinlto.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,10 @@ CONFIG_FRAME_POINTER=y
12161216
# Generic Kernel Debugging Instruments
12171217
#
12181218
# CONFIG_MAGIC_SYSRQ is not set
1219-
# CONFIG_DEBUG_FS is not set
1219+
CONFIG_DEBUG_FS=y
1220+
CONFIG_DEBUG_FS_ALLOW_ALL=y
1221+
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1222+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
12201223
CONFIG_HAVE_ARCH_KGDB=y
12211224
# CONFIG_KGDB is not set
12221225
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
@@ -1355,6 +1358,7 @@ CONFIG_SAMPLE_RUST_STACK_PROBING=m
13551358
CONFIG_SAMPLE_RUST_SEMAPHORE=m
13561359
CONFIG_SAMPLE_RUST_SEMAPHORE_C=m
13571360
CONFIG_SAMPLE_RUST_RANDOM=m
1361+
CONFIG_SAMPLE_RUST_SEQ_FILE=m
13581362

13591363
#
13601364
# arm64 Debugging

.github/workflows/kernel-arm64-release.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ CONFIG_DCACHE_WORD_ACCESS=y
10641064
#
10651065
# Pseudo filesystems
10661066
#
1067-
CONFIG_PROC_FS=y
1067+
# CONFIG_PROC_FS is not set
10681068
# CONFIG_PROC_CHILDREN is not set
10691069
# CONFIG_SYSFS is not set
10701070
# CONFIG_HUGETLBFS is not set

.github/workflows/kernel-riscv64-debug.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,10 @@ CONFIG_FRAME_POINTER=y
11221122
# Generic Kernel Debugging Instruments
11231123
#
11241124
# CONFIG_MAGIC_SYSRQ is not set
1125-
# CONFIG_DEBUG_FS is not set
1125+
CONFIG_DEBUG_FS=y
1126+
CONFIG_DEBUG_FS_ALLOW_ALL=y
1127+
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1128+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
11261129
CONFIG_HAVE_ARCH_KGDB=y
11271130
CONFIG_HAVE_ARCH_KGDB_QXFER_PKT=y
11281131
# CONFIG_KGDB is not set

.github/workflows/kernel-riscv64-release.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,10 @@ CONFIG_FRAME_POINTER=y
11101110
# Generic Kernel Debugging Instruments
11111111
#
11121112
# CONFIG_MAGIC_SYSRQ is not set
1113-
# CONFIG_DEBUG_FS is not set
1113+
CONFIG_DEBUG_FS=y
1114+
CONFIG_DEBUG_FS_ALLOW_ALL=y
1115+
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1116+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
11141117
CONFIG_HAVE_ARCH_KGDB=y
11151118
CONFIG_HAVE_ARCH_KGDB_QXFER_PKT=y
11161119
# CONFIG_UBSAN is not set

.github/workflows/kernel-x86_64-debug-thinlto.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,9 @@ CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
12221222
CONFIG_MAGIC_SYSRQ_SERIAL=y
12231223
CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
12241224
CONFIG_DEBUG_FS=y
1225-
# CONFIG_DEBUG_FS_ALLOW_ALL is not set
1225+
CONFIG_DEBUG_FS_ALLOW_ALL=y
12261226
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1227-
CONFIG_DEBUG_FS_ALLOW_NONE=y
1227+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
12281228
CONFIG_HAVE_ARCH_KGDB=y
12291229
CONFIG_KGDB=y
12301230
CONFIG_KGDB_HONOUR_BLOCKLIST=y
@@ -1441,6 +1441,7 @@ CONFIG_SAMPLE_RUST_STACK_PROBING=m
14411441
CONFIG_SAMPLE_RUST_SEMAPHORE=m
14421442
CONFIG_SAMPLE_RUST_SEMAPHORE_C=m
14431443
CONFIG_SAMPLE_RUST_RANDOM=m
1444+
CONFIG_SAMPLE_RUST_SEQ_FILE=m
14441445
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
14451446
# CONFIG_STRICT_DEVMEM is not set
14461447

.github/workflows/kernel-x86_64-debug.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ CONFIG_DCACHE_WORD_ACCESS=y
10591059
#
10601060
# Pseudo filesystems
10611061
#
1062-
CONFIG_PROC_FS=y
1062+
# CONFIG_PROC_FS is not set
10631063
# CONFIG_PROC_CHILDREN is not set
10641064
CONFIG_KERNFS=y
10651065
CONFIG_SYSFS=y
@@ -1217,9 +1217,9 @@ CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
12171217
CONFIG_MAGIC_SYSRQ_SERIAL=y
12181218
CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
12191219
CONFIG_DEBUG_FS=y
1220-
# CONFIG_DEBUG_FS_ALLOW_ALL is not set
1220+
CONFIG_DEBUG_FS_ALLOW_ALL=y
12211221
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1222-
CONFIG_DEBUG_FS_ALLOW_NONE=y
1222+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
12231223
CONFIG_HAVE_ARCH_KGDB=y
12241224
CONFIG_KGDB=y
12251225
CONFIG_KGDB_HONOUR_BLOCKLIST=y

.github/workflows/kernel-x86_64-release-thinlto.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,10 @@ CONFIG_STACK_VALIDATION=y
12891289
# Generic Kernel Debugging Instruments
12901290
#
12911291
# CONFIG_MAGIC_SYSRQ is not set
1292-
# CONFIG_DEBUG_FS is not set
1292+
CONFIG_DEBUG_FS=y
1293+
CONFIG_DEBUG_FS_ALLOW_ALL=y
1294+
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
1295+
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
12931296
CONFIG_HAVE_ARCH_KGDB=y
12941297
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
12951298
# CONFIG_UBSAN is not set
@@ -1397,6 +1400,7 @@ CONFIG_SAMPLE_RUST_STACK_PROBING=m
13971400
CONFIG_SAMPLE_RUST_SEMAPHORE=m
13981401
CONFIG_SAMPLE_RUST_SEMAPHORE_C=m
13991402
CONFIG_SAMPLE_RUST_RANDOM=m
1403+
CONFIG_SAMPLE_RUST_SEQ_FILE=m
14001404
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
14011405
# CONFIG_STRICT_DEVMEM is not set
14021406

.github/workflows/qemu-init.sh

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
#!/bin/sh
22

3-
# busybox insmod rust_minimal.ko
4-
# busybox rmmod rust_minimal.ko
3+
busybox insmod rust_minimal.ko
4+
busybox rmmod rust_minimal.ko
55

6-
# busybox insmod rust_print.ko
7-
# busybox rmmod rust_print.ko
6+
busybox insmod rust_print.ko
7+
busybox rmmod rust_print.ko
88

9-
# busybox insmod rust_module_parameters.ko
10-
# busybox rmmod rust_module_parameters.ko
9+
busybox insmod rust_module_parameters.ko
10+
busybox rmmod rust_module_parameters.ko
1111

12-
# busybox insmod rust_sync.ko
13-
# busybox rmmod rust_sync.ko
12+
busybox insmod rust_sync.ko
13+
busybox rmmod rust_sync.ko
1414

15-
# busybox insmod rust_chrdev.ko
16-
# busybox rmmod rust_chrdev.ko
15+
busybox insmod rust_chrdev.ko
16+
busybox rmmod rust_chrdev.ko
1717

18-
# busybox insmod rust_miscdev.ko
19-
# busybox rmmod rust_miscdev.ko
18+
busybox insmod rust_miscdev.ko
19+
busybox rmmod rust_miscdev.ko
2020

21-
# busybox insmod rust_stack_probing.ko
22-
# busybox rmmod rust_stack_probing.ko
21+
busybox insmod rust_stack_probing.ko
22+
busybox rmmod rust_stack_probing.ko
2323

24-
# busybox insmod rust_semaphore.ko
25-
# busybox rmmod rust_semaphore.ko
24+
busybox insmod rust_semaphore.ko
25+
busybox rmmod rust_semaphore.ko
2626

27-
# busybox insmod rust_semaphore_c.ko
28-
# busybox rmmod rust_semaphore_c.ko
27+
busybox insmod rust_semaphore_c.ko
28+
busybox rmmod rust_semaphore_c.ko
2929

30-
# busybox insmod rust_module_parameters_loadable_default.ko
31-
# busybox insmod rust_module_parameters_loadable_custom.ko \
32-
# my_bool=n \
33-
# my_i32=345543 \
34-
# my_str=🦀mod \
35-
# my_usize=84 \
36-
# my_array=1,2,3
37-
# busybox rmmod rust_module_parameters_loadable_default.ko
38-
# busybox rmmod rust_module_parameters_loadable_custom.ko
30+
busybox insmod rust_module_parameters_loadable_default.ko
31+
busybox insmod rust_module_parameters_loadable_custom.ko \
32+
my_bool=n \
33+
my_i32=345543 \
34+
my_str=🦀mod \
35+
my_usize=84 \
36+
my_array=1,2,3
37+
busybox rmmod rust_module_parameters_loadable_default.ko
38+
busybox rmmod rust_module_parameters_loadable_custom.ko
3939

4040
busybox insmod rust_seq_file.ko
4141
busybox mkdir proc
@@ -44,14 +44,10 @@ busybox mkdir debugfs
4444
busybox mount -t debugfs debugfs /debugfs
4545
export RUST_SEQ_MINOR=$(busybox cat /proc/misc | busybox grep rust_seq_file | busybox cut -d ' ' -f 1)
4646
busybox mknod /dev/rust_seq_file0 c 10 $RUST_SEQ_MINOR
47-
busybox echo "reading from device"
4847
busybox cat /dev/rust_seq_file0
4948
busybox cat /dev/rust_seq_file0
50-
busybox echo "reading debug file"
5149
busybox cat /debugfs/rust_seq_file
52-
busybox echo "removing device file"
5350
busybox rm /dev/rust_seq_file0
54-
busybox echo "removing module"
5551
busybox rmmod rust_seq_file.ko
5652

5753
busybox reboot -f

.github/workflows/qemu-initramfs.desc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
dir /bin 0755 0 0
22
dir /sys 0755 0 0
33
dir /dev 0755 0 0
4-
file /bin/busybox busybox/busybox 0755 0 0
4+
file /bin/busybox busybox 0755 0 0
55
slink /bin/sh /bin/busybox 0755 0 0
66
file /init .github/workflows/qemu-init.sh 0755 0 0
77

8+
file /rust_print.ko samples/rust/rust_print.ko 0755 0 0
9+
file /rust_module_parameters.ko samples/rust/rust_module_parameters.ko 0755 0 0
10+
file /rust_sync.ko samples/rust/rust_sync.ko 0755 0 0
11+
file /rust_chrdev.ko samples/rust/rust_chrdev.ko 0755 0 0
12+
file /rust_miscdev.ko samples/rust/rust_miscdev.ko 0755 0 0
13+
file /rust_stack_probing.ko samples/rust/rust_stack_probing.ko 0755 0 0
14+
file /rust_semaphore.ko samples/rust/rust_semaphore.ko 0755 0 0
15+
file /rust_semaphore_c.ko samples/rust/rust_semaphore_c.ko 0755 0 0
16+
17+
file /rust_module_parameters_loadable_default.ko samples/rust/rust_module_parameters_loadable_default.ko 0755 0 0
18+
file /rust_module_parameters_loadable_custom.ko samples/rust/rust_module_parameters_loadable_custom.ko 0755 0 0
819
file /rust_minimal.ko samples/rust/rust_minimal.ko 0755 0 0
920
file /rust_seq_file.ko samples/rust/rust_seq_file.ko 0755 0 0

0 commit comments

Comments
 (0)