Crash (buffer overflow detected) in processFileDelete: unchecked m_Extensions[FD_Sid] length in memcpy
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Start with processFileDelete() in sysmonforlinux.c around line 707, where the issue identifies the unchecked FD_Sid copy; inspect how the received perf record and extension lengths are represented. Check whether other process* handlers make similar copies, as the report suggests. Done means invalid lengths are rejected safely so a malformed event cannot abort Sysmon; the issue does not name a test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
sysmon aborts with *** buffer overflow detected *** (SIGABRT) in processFileDelete(). The length passed to memcpy comes straight from the event's m_Extensions[FD_Sid] and is not validated. In the core dump below, that length is 16,779,777 bytes (0x1000a01), while the destination is the 64 KiB stack buffer newData.
Environment
- SysmonForLinux 1.5.3, sysinternalsebpf 2.2.2 (Microsoft apt packages)
- Proxmox VE 9.2 (Debian 13 based), kernel 7.0.14-4-pve, x86_64
- ZFS root, with ZFS replication received regularly (
zfs recv, mass file deletions)
Frequency
The crash happened 6 times on one host over ~3 weeks. It never happened on two identical nodes with the same config. The affected node is the one that receives the most ZFS replication traffic, so the trigger looks related to heavy unlink activity.
Config
FileDelete was not logged at all. The config only had an empty group:
<RuleGroup name="" groupRelation="or">
<FileDelete onmatch="include"/>
</RuleGroup>
Even an empty include group activates the unlink/unlinkat tracing (SetSyscallActive), so processFileDelete() runs for every delete. Removing the FileDelete group completely works around the problem, because FileDelete has no rule default.
Backtrace (systemd-coredump + gdb)
#4 __fortify_fail () from libc.so.6
#5 __chk_fail () from libc.so.6
#6 memcpy (__len=16779777, __src=<optimized out>, __dest=0x7ffcc99d9b08) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
#7 processFileDelete (eventHdr=0x7ea31742a3ac) at /__w/1/s/SysmonForLinux/sysmonforlinux.c:707
#8 perf_buffer__process_record (e=<optimized out>, ctx=<optimized out>) at libbpf.c:13999
#9 perf_event_read_simple (mmap_mem=..., mmap_size=67108864, ...) at libbpf.c:13625
#10 perf_buffer__process_records (...) at libbpf.c:14021
#11 perf_buffer__poll (pb=..., timeout_ms=1000) at libbpf.c:14046
#12 telemetryStart (...) at /__w/1/s/sysinternalsEBPF/telemetryLoader.c:1586
#13 main (...) at /__w/1/s/SysmonForLinux/sysmonforlinux.c:1736
Line 707 in the 1.5.3 tag is:
memcpy(newPtr, ptr, event->m_Extensions[FD_Sid]);
Suggested fix
In processFileDelete(), check the extension lengths (FD_Sid, FD_FileName, FD_ImagePath) before copying:
- their sum must fit into
newDataminus the header and struct size; - it must not exceed the size of the received perf record.
If the check fails, drop the event and log it instead of aborting the whole service. The same pattern may be worth checking in the other process* handlers that copy extension data.
I can provide more details from the core dump if useful.
- Ngôn ngữ chính
- C
- Star
- 2.2k
- Fork
- 222
- Merge trung bình
- 4 giờ 50 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/Sysmon-Linux
-
ProcessCreate: ParentImage is empty when the parent starts the process from a non-main threadĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
microsoft/Sysmon-Linux#253 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoft/Sysmon-Linux#247 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 12/100
microsoft/Sysmon-Linux#246 · 3 bình luận ·
-
Sysmon service executable remains `(deleted)` after restart, causing repeated needrestart restarts and systemd start-limit-hitCó thể làm lại được @MarioHewardt đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mở
microsoft/Sysmon-Linux#244 · 1 người được giao ·
-
ProcessTerminate events intermittently report an unrelated user's UID instead of the terminating process's UIDCó thể đã có người làm @MarioHewardt đã nhận 111 ngày trước. Đang mở
microsoft/Sysmon-Linux#238 · 1 người được giao ·
Tất cả issue của microsoft/Sysmon-Linux
Issue tương tự
-
Implement looks_size reporterĐang mởenhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
bug multiplayer status: planned
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ChupathingyCE/chupathingyce#851 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
HigherOrderCO/Bend#2104 ·
-
Research radar digest 2026-W46Đang mởresearch-radar
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted program
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
hffgzktbcc-blip/ounce-core#297 ·
Maintainer thường phản hồi trong vòng 1 ngày