Cannot get I/O access to '/dev/mem'
维护者通常 4 天内回复
@demoray 已经在做这个了。
开始于 2026年8月12日。
评估
这个 Issue 还没有评估数据。
描述
Hello. My attempt to get I/O access to '/dev/mem' fails. May the details provided be somehow useful to investigate what prevents it.
$ hostnamectl | sed -n '8p;12p' | awk '$1=$1'
Operating System: Fedora Linux 44 (Workstation Edition)
Kernel: Linux 7.1.7-200.fc44.x86_64
Parameters the kernel was compiled with that are relevant for this report:
$ grep _STRICT_DEVMEM /boot/config-$(uname -r)
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y
I learned that the main kernel configuration option for controlling I/O access to '/dev/mem' is 'CONFIG_STRICT_DEVMEM'. Lacking knowledge to recompile the kernel, thus my alternative was to add the parameter/key 'strict-devmem=0' to my kernel cmdline:
$ cat /etc/kernel/cmdline
root=UUID=(...) ro rootflags=subvol=root rhgb quiet strict-devmem=0
Test
$ sudo dd if=/dev/mem of=/dev/null
dd: error reading '/dev/mem': Operation not permitted
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0943418 s, 11.1 MB/s
This program
$ file -b avml
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=669c613fbe2bc57310816a6071922ee2203ed86f, stripped
$ stat avml | sed -n '3,4p'
Device: 0,53 Inode: 831989 Links: 1
Access: (0755/-rwxr-xr-x) Uid: (1000/...) Gid: (1000/...)
No permission correlated
$ ./avml acquire --source /dev/mem mem_dump
Error: error: unable to parse /proc/iomem
caused by:
0: need CAP_SYS_ADMIN to read /proc/iomem
Expected!
$ sudo !!
sudo ./avml acquire --source /dev/mem mem_dump
Error: error: unable to read memory
caused by:
0: unable to create memory snapshot from source: /dev/mem
1: unable to create memory snapshot
2: write block failed: 1048576..2483167231
3: io error: unable to read memory page
4: Operation not permitted (os error 1)
I cannot say whether the layout that is presented in 'cat /proc/iomem' represents what is readable within that limit. That seems to me out of topic though.
So, I thought I could expect that the operation would be at last permitted. Since it is not, it's still limited to the first megabyte, which is as expected on a recent Linux kernel. May I ask, do you happen to have a suggestion on this matter?
- 主要语言
- Rust
- 星标
- 1.1k
- 派生
- 95
- 平均合并
- 4 天 7 小时
- 30 天内合并 PR
- 8
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/avml 的其他 Issue
-
Potential off-by-one in /proc/iomem parsing: final byte of System RAM ranges omitted可能已有人在做 @demoray 于 2 天前认领。 未关闭
难度 3/5 半天 新手友好度 64/100
维护者通常 4 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/avml#607 · 3 条评论 · 3 个 reaction ·
维护者通常 4 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 4 天内回复
相似的 Issue
-
✨ enhancement needs-discussion
难度 1/5 1 小时以内 新手友好度 85/100
-
area:docs documentation good first issue priority:low
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
triage:accepted
难度 2/5 1-3 小时 新手友好度 65/100
open-telemetry/otel-arrow#4343 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
mishraprafful/multihull#150 ·
维护者通常 1 天内回复
-
area:tooling bug good first issue priority:P3
难度 2/5 1-3 小时 新手友好度 72/100
michaelnavazhylau/ngspice-rs#129 ·
维护者通常 1 天内回复