mmap of non-mappable character devices succeeds
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c, linux
调研方向
Start by tracing the mmap handling and mmap_refused_errno logic, then compare how character-device and anon-inode file descriptors are classified. The issue gives /dev/null, /dev/urandom, /dev/zero, and several anon-inode descriptors as cases to investigate. Done means the no-limit and over-limit results match Linux for these cases, including ENODEV for devices that cannot be mapped.
由索引模型根据 Issue 内容生成。
描述
mmap of a character device that Linux cannot map succeeds under elfuse. Linux returns ENODEV, because the device's file operations have no mmap.
Measured with a probe, under elfuse at #485 (6fbbc9f) and on Linux:
| fd | Linux, no limit | elfuse, no limit | Linux, over RLIMIT_AS | elfuse, over RLIMIT_AS |
|---|---|---|---|---|
/dev/null |
ENODEV | maps | ENODEV | ENOMEM |
/dev/urandom |
ENODEV | maps | ENODEV | ENOMEM |
/dev/zero |
maps | maps | ENOMEM | ENOMEM |
| eventfd, epoll, timerfd, signalfd | ENODEV | other errno | ENODEV | ENODEV |
"Over RLIMIT_AS" is an 8 GiB MAP_PRIVATE PROT_READ request with the limit at 4 GiB. The probe found two gaps:
- Character devices: elfuse does not track which ones can be mapped. A fix would decide this per device (for example, allow
/dev/zeroand refuse the others with ENODEV) on the no-limit path. The over-limit path inmmap_refused_errnowould then use the same check. - Anon-inode fds: with no limit set, they return a different errno than Linux's ENODEV.
Raised by review on #485 (r4506898326).
- 主要语言
- C
- 星标
- 287
- 派生
- 33
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 18
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sysprog21/elfuse 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
libreswan/libreswan#3185 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
-
category:port-update
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
llvm:instcombine
难度 2/5 1-3 小时 新手友好度 64/100
llvm/llvm-project#246503 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复